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

Project1

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

[已经过期] 套装系统莫名出错

[复制链接]

Lv1.梦旅人

梦石
0
星屑
85
在线时间
87 小时
注册时间
2013-1-13
帖子
66
跳转到指定楼层
1
发表于 2015-8-8 17:01:41 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我用的是这个套装系统,当我给一个敌人攻击附加暗属性时,他攻击我就会出错。。。套装属性我还没来得及加,为啥会这样呢。。
RUBY 代码复制
  1. #============================================================================
  2. # Equipment Sets v2.1e
  3. # By Emerald
  4. #----------------------------------------------------------------------------
  5. # You're free to use the script for any game, as long as you give credits
  6. #----------------------------------------------------------------------------
  7. # Version History
  8. # 1.0 -> Script fully ready for public use. Addes sets, unlimited set items,
  9. #        set bonuses for the 8 basic stats, set bonuses requirement (how many
  10. #        items of the set is the actor wearing?)
  11. # 1.1 -> a. changed the set bonuses work. Instead of [parameter, bonus] you now
  12. #        use [sort, parameter, bonus]. Also added sorts 0 and 2. Check SPECIAL
  13. #        VALUES for their corresponding parameters.
  14. #        b. Added sort 1: Standard Parameters (Percentage). The corresponding
  15. #        parameters are the same as for sort 0. See SPECIAL VALUES for extra
  16. #        notes.
  17. # 1.2 -> Added Sort 3: Special Parameters. The values for the parameters can be
  18. #        found in SPECIAL VALUES, just as usual. Addes Sort 4: Skills!! These
  19. #        use a different syntax than the other bonuses, so be sure to check
  20. #        SPECIAL VALUES if you are unfamiliar with them.
  21. # 1.3 -> a. rewritten most of the code to remove so major bugs. Also cleaned
  22. #        code (about 140 lines less this time, WITH 4 added Sorts). Added
  23. #        Module Emerald (EME). Sets and Set_Bonuses move to Module EME. Added
  24. #        MAX_ELEMENTS to Module EME. Added Sort 5 (Elemental Efficiency), Sort
  25. #        6 (Debuff Rate), Sort 7 (State Rate), Sort 8 (State Resist) and Sort 9
  26. #        (Attack Elements). See SPECIAL VALUES for instructions.
  27. #        WARNING these are still in Beta Stage, so report all bugs found.  
  28. #        b. removed many, MANY major bugs! Removed a bug where unequipping
  29. #        resulted in an undefined array, removed some typos, fixed the bonuses
  30. #        for almost EVERY Sort, removed some more typos, shortened code a little
  31. #        bit, removed some more minor bugs regarding change_equip.
  32. # 1.4 -> More bug fixes. Also added Sort 10 (Attack States), Sort 11 (Equipment
  33. #        Types) and Sort 12 (Attack Specials). Refer to SPECIAL VALUES for
  34. #        all needed information.
  35. # 1.5 -> Bug fix to discard_equip(...). Added the foruth value of Sort 11
  36. #        (Dual Wielding), added Sort 13, Sort 14, Sort 15, Sort 16 and Sort 17
  37. #        which are Additional Skill Types, Sealed Skill Types, Sealed Skills,
  38. #        Fixed Equip Types and Sealed Equip Types respectively. As usual, go to
  39. #        SPECIAL VALUES for the needed instructions.
  40. # 1.6 -> Added a compatibility patch for Fomar's Dual Wield -> Free Hands script.
  41. # 1.7 -> Added Sorts 18 (special flags), 19 (party abilities) and 20 (other
  42. #        traits). See SPECIAL VALUES for the instructions.
  43. # 1.8a-> Added sounds to be played when a certain amount of set pieces has been
  44. #        equipped. Also removed a bug regarding skipping amounts of pieces.
  45. # 1.8b-> Small bugfix regarding set sounds.
  46. # 1.8c-> Small bugfix regarding attack states.
  47. #
  48. # 2.0 -> MAJOR REWRITE. Aliased a few more methods than before, to further
  49. #        increases compatability. Added a method which initializes sets which
  50. #        are worn by actors at the start of the game. Halved the code used to
  51. #        determine if items belong to sets. Scraped a few uneccessairy methods.
  52. #        Practically removed 2/3 of my version of release_unequipable_equips,
  53. #        and made the EES + Fomar123's Dual Wield -> Free Hands script patch
  54. #        1 line instead of 10. Almost entirely changed the way Set Skills and
  55. #        Set Equipment Options work. Also fixed a few bugs in the progress
  56. #        (for example additions of variable 2 which I accidentally left in the
  57. #        script.)
  58. # 2.1a-> Start of the debugging patch. Added a function to remove bonuses when
  59. #        unequipping stuff, like usual. Forgot to re-add in 2.0 >.<
  60. # 2.1b-> Fixed a small typo.
  61. # 2.1c-> Fixed initalizition of set equips.
  62. # 2.1d-> Fixed a bug regarding bonuses not being applied upon optimizing equips
  63. #        and a bug regarding the removing of bonuses when unequipping stuff.
  64. # 2.1e-> Removed something which I should have added (regarding the BaseItem
  65. #        class) in release_unequippable_items. This also fixed the compatibility
  66. #        issues with Tsukihime's Effect Manager.
  67. #----------------------------------------------------------------------------
  68. # Started with a Iron Sword? Pretty good. Found a Gold Sword? Awesome! Found
  69. # the complete Bronze Set? Bad stuff...
  70. # Unless, they give you bonuses! In other words, this script allows you to create
  71. # bonuses for wearing multiple items of a set... Just wanted to make it sound
  72. # more fun...
  73. #
  74. # Instructions:
  75. #
  76. # Just as always, put this script between Бе Materials and Бе Main. Put this script
  77. # below any script which rewrites change_equip and above any script which aliases
  78. # 'param' in Game_Actor (usually in Game_BattlerBase, but it only matters if it
  79. # is rewritten/aliased in Game_Actor).
  80. #
  81. # Set MAX_ELEMENTS below module EME and above Sets to the maximum number of
  82. # elements in the database. Else, the script won't recognize any above the value.
  83. #
  84. #
  85. # SETS
  86. #
  87. # To create sets (sorry, no names yet) go to Sets in the configuration part.
  88. # Add the set id, followed by an array containing arrays. The latter arrays
  89. # must be at least two elements long, one for the type of equipment, one for the
  90. # id.
  91. # Examples:
  92. #
  93. # 1 => [[0, 1], [1, 2]], <- The []'s define an array. The arrays like the [0,1]
  94. # and [1, 2] should be at least two elements long (each element is separated by
  95. # a comma.
  96. #
  97. # 2 => [[0, 5], [0, 6], [1, 5], [1,7]], <- If the array is not the last in the
  98. # list, add a comma or you'll get an error. This goes for every array.
  99. #
  100. # set id => [[equipment type, equipment id], [equipment type, equipment id]]
  101. #
  102. # NOTE:
  103. # The set id MUST be 0 or higher. The variable in which the sets are stored (which
  104. # is called a hash) usually begins with 1 =>, so that's why that's also in the
  105. # standard config.
  106. # The Equipment Types are 0 (weapons) and 1 (armors.)
  107. # DO NOT COPY the ID of items in the database. If you put all the useless 0's
  108. # in front of the real ID, you'll get an error/the script won't work.
  109. # Furthermore, you can have an infinite amount of equipment belonging (is that a
  110. # word?) to a set, so don't worry about compatibility issues with Extra Equipment
  111. # Slots scripts. Unless they rewrite change_equip, than there's a slight chance
  112. # on problems. This can be fixed, however, by putting this script below any
  113. # script which rewrites change_equip.
  114. # Also, you can have multiple weapons in array and the same equipment in different
  115. # sets.
  116. #
  117. #
  118. # SET BONUSES
  119. #
  120. # For set bonuses, go to Set_Bonuses. Use the follwing syntax to add bonuses:
  121. #
  122. # set id => {
  123. #    amount of pieces required => [[sort, parameter, bonus]]
  124. #           },
  125. #
  126. # Specifications:
  127. # set id = the same set id as in Sets.
  128. #
  129. # amount of pieces required = the amount of pieces the player must be wearing in
  130. # order to receive the bonuses. If you want to skip one, just skip it. Like:
  131. # 1 => blablabla
  132. # 3 => blablabla
  133. #
  134. # sort = type of bonus. For all sorts, see SPECIAL VALUES.
  135. #
  136. # parameter = the parameter which receives the bonus. For all parameters, see
  137. # SPECIAL VALUES.
  138. #
  139. # bonus = the bonus to be added to parameter. Note that this is a direct bonus,
  140. # not a percentage. If the vale is negative, the bonus will become negative. If
  141. # the value is 0, there will be no bonus to that stat.
  142. #
  143. #
  144. # SPECIAL VALUES
  145. # Sets
  146. # ----
  147. # Equipment types: 0 and 1. 0 is the Weapons tab in the database, 1 is the
  148. # Armors tab in the database.
  149. #
  150. # Set_Bonuses
  151. # ---
  152. # Sorts:
  153. # 0  - Standard Parameter
  154. # 1  - Standard Parameter (Percentage)
  155. # 2  - Extra Parameter
  156. # 3  - Special Paramater
  157. # 4  - Skills (WARNING, DIFFERENT SYNTAX!! See Skills on how to use them)
  158. # 5  - Elemental Efficiency
  159. # 6  - Debuff Rate
  160. # 7  - State Rate
  161. # 8  - State Resistance (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  162. # 9  - Attack Elements (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  163. # 10 - Attack States
  164. # 11 - Equipment Types (WARNING, DIFFERENT SYNTAX!! See Equipment Types on how
  165. #                       to use them)
  166. # 12 - Attack Specials
  167. # 13 - Additional Skill Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  168. # 14 - Sealed Skill Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  169. # 15 - Sealed Skills (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  170. # 16 - Fixed Equip Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  171. # 17 - Sealed Equip Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  172. # 18 - Special Flags (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  173. # 19 - Party Abilities (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  174. # 20 - Other Traits
  175. #
  176. # Standard Parameters: (Sort 0)
  177. # 0 - MaxHp
  178. # 1 - MaxMp
  179. # 2 - Attack
  180. # 3 - Defense
  181. # 4 - Magic Attack (Spirit)
  182. # 5 - Magic Defence (Resistance)
  183. # 6 - Agility
  184. # 7 - Luck
  185. #
  186. # Standard Parameters (Percentage): (Sort 1)
  187. # 0 - MaxHp
  188. # 1 - MaxMp
  189. # 2 - Attack
  190. # 3 - Defense
  191. # 4 - Magic Attack (Spirit)
  192. # 5 - Magic Defence (Resistance)
  193. # 6 - Agility
  194. # 7 - Luck
  195. # Note that stats are calculated this way:
  196. # Basic + Equipment Bonuses + Set Bonuses (normal) + Set Bonuses (percentages,
  197. # equal to bonus% (in [1, parameter, bonus]) * basic + equipment bonuses)
  198. #
  199. # Extra Parameters: (Sort 2)
  200. # 0 - Hit Rate
  201. # 1 - Evasion
  202. # 2 - Critical Rate
  203. # 3 - Critical Evasion
  204. # 4 - Magical Evasion
  205. # 5 - Magical Reflection
  206. # 6 - Counter Rate
  207. # 7 - HP Regen
  208. # 8 - MP Regen
  209. # 9 - TP Regen
  210. #
  211. # Special Parameters: (Sort 3)
  212. # 0 - Target Rate/ Accuracy Rate(in Eng Translation Patch)/ Aggro Rate
  213. # 1 - Guard Effect Rate
  214. # 2 - Recovery Effect Rate
  215. # 3 - Pharmacology/ Knowledge in Medicine(in Eng Translation Patch)
  216. # 4 - MP Cost Rate
  217. # 5 - TP Charge Rate
  218. # 6 - Physical Damage Rate
  219. # 7 - Magical Damage Rate
  220. # 8 - Floor Damage Rate
  221. # 9 - Experience Rate
  222. #
  223. # Skills: (Sort 4)
  224. # These skills don't have parameter values. Instead, the last two elements in
  225. # their array have a different effect than usual:
  226. # [sort (4), -----, skill_id]
  227. # Sort = still the same and of course 4
  228. # ----- = before this was Active, but that is no longer required. In order to
  229. # by-pass the need to change this to skill_id (for people who had this script
  230. # before v2.0), this variable has become unused instead of deleted all-together.
  231. # You can put anything you want here, it doesn't even have to be an integer.
  232. # Skill_Id = the id of the skill which the actor learns.
  233. #
  234. # Elemental Efficiency: (Sort 5)
  235. # Values are the same as Element IDs in the database. (SO NO 0!!)
  236. # If the bonus is negative, the actor becomes more resistant to the element.
  237. # If the bonus is positive, the actor becomes weaker to the element.
  238. #
  239. # Debuff Rate: (Sort 6)
  240. # 0 - MaxHp
  241. # 1 - MaxMp
  242. # 2 - Attack
  243. # 3 - Defense
  244. # 4 - Magic Attack (Spirit)
  245. # 5 - Magic Defence (Resistance)
  246. # 6 - Agility
  247. # 7 - Luck
  248. # If the bonus is negative, the actor becomes more resistant to debuffs regarding
  249. # the set parameter.
  250. # If the bonus is positive, the actor becomes weaker to debuffs regarding the set
  251. # parameter.
  252. #
  253. # State Rate: (Sort 7)
  254. # Values are the same as the State IDs in the database (SO NO 0!!)
  255. # If the bonus is negative, the actor becomes more resistant to the state.
  256. # If the bonus is positive, the actor becomes weaker to the state.
  257. #
  258. # State Resist: (Sort 8)
  259. # Values are the same as the State IDs in the database (SO NO 0!!)
  260. # If the bonus is positive, the actor becomes fully resistant to the set state.
  261. # However, if the bonus is negative, the actor LOSES full resistance to the set
  262. # state!
  263. #
  264. # Attack Elements: (Sort 9)
  265. # Values are the same as the Element IDs in the database (SO NO 0!!)
  266. # If the bonus is positive, the element is added to the attack elements.
  267. # However, if the bonus is negative, the element is REMOVED from the attack
  268. # elements!
  269. #
  270. # Attack States: (Sort 10)
  271. # Values are the same as the State IDs in the database (SO NO 0!!)
  272. # Bonus is the chance of the state to occur.
  273. #
  274. # Equipment Types: (Sort 11)
  275. # 0 as parameter means that the bonus type is a Weapon Type.
  276. # 1 as parameter means that the bonus type is a Weapon Type, but instead it will
  277. # be REMOVED from the list of weapon types.
  278. # 2 as parameter means that the bonus type is an Armor Type.
  279. # 3 as parameter means that the bonus type is an Armor Type, but instead it will
  280. # be REMOVED from the list of armor types.
  281. # 4 as parameter allows Dual Wielding.
  282. # Bonus is the same as the ID of the Equipment Types in the database.
  283. # Note that removed types override added types. So you can first remove an
  284. # equip type and afterwards add it, but you can first add it and then remove it.
  285. #
  286. # Attack Specials: (Sort 12)
  287. # 0 - Attack Speed
  288. # 1 - Additional Attacks
  289. # Both in percentages. So for additional attacks, not 1 but 100.
  290. #
  291. # Additional Skill Types: (Sort 13)
  292. # Values are the same as the Skill Types IDs in the database (SO NO 0!!)
  293. # If the bonus is positive, the skill types is added.
  294. # However, if the bonus is negative, the skill type is REMOVED!
  295. #
  296. # Sealed Skill Types: (Sort 14)
  297. # Exact the same as above, only if the bonus is positive the type gets sealed,
  298. # if the bonus is negative the type gets removed from the sealed types.
  299. #
  300. # Sealed Skills: (Sort 15)
  301. # Again, exact the same as above. Only this time, replace the skill type id by
  302. # the skill id.
  303. #
  304. # Fixed Equip Types: (Sort 16)
  305. # Exact the same as Sealed Skill Types, only the equip types get fixed. Of course,
  306. # replace skill type id by equip type id.
  307. #
  308. # Sealed Equip Types: (Sort 17)
  309. # And yet again, exact the same only the equip types get sealed. Of course,
  310. # replace skill type id by equip type id.
  311. #
  312. # Special Flags: (Sort 18)
  313. # 0 - Auto Combat
  314. # 1 - Guard
  315. # 2 - Substitute/Cover
  316. # 3 - Same TP in next battle
  317. # For bonus, put a positive number (or 0) for added trait, and negative number
  318. # for removed trait.
  319. #
  320. # Party Abilities: (Sort 19)
  321. # 0 - Encounter cut down by half
  322. # 1 - No encounters
  323. # 2 - No suprise attacks
  324. # 3 - Preemptive strike rate up
  325. # 4 - Double currency from battles
  326. # 5 - Double items from battles
  327. # For bonus, put a positive number (or 0) for added trait, and negative number
  328. # for removed trait.
  329. #
  330. # Others Traits: (Sort 20)
  331. # 0 - Max TP up by bonus
  332. # 1 - Atk Skill becomes bonus (skill ID) / So, if you have [20, 1, 10] the actor's
  333. # attack skill becomes 10.
  334. # 2 - Guard Skill becomes bonus (skill ID) / So, if you have [20, 2, 10] the
  335. # actor's guard skill becomes 10,
  336. #----------------------------------------------------------------------------
  337. # Credits to:
  338. # Lettuce, if it wasn't for his RMVX Item Sets script, I would not have learned
  339. # how Arrays and Hashes work.
  340. # Many members at [url]www.rpgmakervxace.net[/url] for pointing out various bugs and whatnot.
  341. # You for reading through the wall of text ^^ (at least... I hope you did that..)
  342. #----------------------------------------------------------------------------
  343. # If you have any issues with this script, contact me at
  344. # [url]http://www.rpgmakervxace.net/index.php?/topic/1092-ees-emeralds-equipment-sets/[/url]
  345. #============================================================================
  346. #
  347. # CONFIGURATION
  348. #
  349. #============================================================================
  350.  
  351. module EME
  352.  
  353.   MAX_ELEMENTS = 10
  354.  
  355. #----------------------------------------------------------------------------
  356. # Sets syntax
  357. #----------------------------------------------------------------------------
  358. # Sets = {
  359. #          set_id => [[equipment_type, equipment_id]]
  360. #        }
  361. #
  362. # set_id must be bigger than 0
  363. # equipment_type can be either 0 (weapon) or 1 (armor)
  364. # Add a comma after a ']' if it's not the last element in the array/hash.
  365. #
  366. # Don't forget to add a ungettable item at the end! Else, the last item will
  367. # count for two!
  368. #----------------------------------------------------------------------------
  369.  
  370. Sets = {
  371.          1 => [[0, 61],[0,62],[0,63],[1, 61]],
  372.          2 => [[1, 75], [0, 64],[0,65],[0,66]],
  373.          3 => [[1, 76], [0, 67],[0,68],[0,69]],
  374.          4 => [[1, 77], [0, 70],[0,71],[0,72]],
  375.          5 => [[1, 78], [0, 73],[0,74],[0,75]],
  376.          6 => [[1, 75], [0, 64]],
  377.          7 => [[1, 75], [0, 65]]
  378.          }
  379.  
  380. #----------------------------------------------------------------------------
  381. # Sets syntax
  382. #----------------------------------------------------------------------------
  383. # Set_Bonuses = {
  384. #       set id => {
  385. #         amount of pieces required => [[sort, parameter, bonus]], [sort, random parameter, 0]]
  386. #                 }
  387. #                }
  388. #
  389. # set_id must correspond to set_id of Sets
  390. # amount of pieces required indicates how many pieces of the set the actor must
  391. # be wearing before receiving the bonus. If you want to skip one, make the only
  392. # element in it's array [0, 0, 0].
  393. # sort indicates which kind of parameters the bonuses change. See SPECIAL VALUES
  394. # for all sorts.
  395. # parameter can be a value depending on sort. See SPECIAL VALUES in the
  396. # instructions for their corresponding stats.
  397. # Bonus is a direct value added to 'parameter'. If 0, no bonus is added. If
  398. # negative, bonus becomes negative.
  399. # Random paramter is just a random parameter to prevent the last bonus from
  400. # being doubled. Always make the bonus of this element 0.
  401. #
  402. # Add a comma after a ']' or '}' if it's not the last element in the array/hash.
  403. #
  404. # Don't forget to add a bonus of [0, 0, 0] at the end! Or else, the last bonus
  405. # will be doubled!
  406. #----------------------------------------------------------------------------
  407. Set_Bonuses =
  408. {
  409.   1 => {
  410.     1 => [[0, 0, 500]],
  411.     2 => [[0, 0, 0]]
  412.        },
  413.  
  414.   2 => {
  415.     1 => [[0, 0, 500]]
  416.        },
  417.  
  418.   3 => {
  419.     1 => [[0, 0, 500]],
  420.     2 => [[0, 0, 0]]
  421.        },
  422.  
  423.   4 => {
  424.     1 => [[0, 0, 500]],
  425.     2 => [[0, 0, 0]]
  426.        },
  427.  
  428.   5 => {
  429.     1 => [[0, 0, 500]],
  430.     2 => [[0, 0, 0]]
  431.        },
  432.  
  433.   6 => {
  434.     1 => [[0, 0, 500]],
  435.     2 => [[0, 0, 0]]
  436.        },
  437.  
  438.   7 => {
  439.     1 => [[0, 0, 500]],
  440.     2 => [[0, 0, 0]]
  441.        },
  442. }
  443.  
  444. #-----------------------------------------------------------------------------
  445. # Sets syntax
  446. #-----------------------------------------------------------------------------
  447. # Set_Sounds = {
  448. #   set_id => {
  449. #     amount_of_pieces_required => [file_name, volume, pitch]
  450. #   }
  451. # }
  452. #
  453. # Resembles the other two parts so I think not much of an explanation is needed.
  454. # When the required amount of pieces has been equipped, the sound sound will be
  455. # played. Doesn't apply for unequipping. Again, watch the comma's!!
  456. #----------------------------------------------------------------------------
  457. Set_Sounds =
  458. {
  459.   1 => {
  460.     1 => ["Flash1", 100, 100],
  461.     3 => ["Flash1", 100, 100]# <- comma here since it isn't the last one!
  462.        },
  463.  
  464.   2 => {
  465.     4 => ["Flash2", 70, 100] # <- comma here since it isn't the last one!
  466.        },
  467.  
  468.   3 => {
  469.     4 => ["Flash2", 70, 100] # <- comma here since it isn't the last one!
  470.        },
  471.  
  472.   4 => {
  473.     4 => ["Flash2", 70, 100] # <- comma here since it isn't the last one!
  474.        },
  475.  
  476.   5 => {
  477.     4 => ["Flash2", 70, 100] # <- comma here since it isn't the last one!
  478.        },
  479.  
  480.   6 => {
  481.     4 => ["Flash2", 70, 100] # <- comma here since it isn't the last one!
  482.        },
  483.   7 => {
  484.     4 => ["Flash2", 70, 100] # <- comma here since it isn't the last one!
  485.        }
  486. }
  487.  
  488. end
  489.  
  490. # Only edit things past here if you know what you're doing
  491.  
  492. $imported = {} if $imported.nil?
  493. $imported["Emerald's Equipment Sets"] = true
  494.  
  495. #============================================================================
  496. #
  497. # Game_Actor
  498. # Handles everything for this script.
  499. #============================================================================
  500. class Game_Actor < Game_Battler
  501.  
  502.   attr_reader :active_sets
  503.   attr_reader :item_sets
  504.  
  505.   alias eme_ees_setup setup
  506.   def setup(actor_id)
  507.     @non_set_skills = []
  508.     @skill_from_sets = false
  509.     reset_bonuses
  510.     @active_sets = []
  511.     @item_sets = [0] * (EME::Sets.size + 1)
  512.     eme_ees_setup(actor_id)
  513.   end
  514.  
  515.   alias eme_init_equips init_equips
  516.   def init_equips(equips)
  517.     eme_init_equips(equips)
  518.     equips.each_with_index{|item_id, i|
  519.       etype_id = index_to_etype_id(i)
  520.       slot_id = empty_slot(etype_id)
  521.       for set_id in 1..EME::Sets.size
  522.         for ees_set_equip in EME::Sets[set_id]
  523.           if item_id != nil and slot_id != nil and ees_is_the_set_item?(etype_id == 0 ? $data_weapons[item_id] : $data_armors[item_id], ees_set_equip)
  524.             @item_sets[set_id] += 1
  525.             @active_sets.push(set_id) unless @active_sets.include?(set_id)
  526.           end
  527.         end
  528.       end
  529.     }
  530.     refresh
  531.   end
  532.  
  533.   def ees_is_the_set_item?(item, ees_set_equip)
  534.     return (((ees_set_equip[0] == 0 and item.is_a?(RPG::Weapon)) or (ees_set_equip[0] == 1 and item.is_a?(RPG::Armor))) and ees_set_equip[1] == item.id)
  535.   end
  536.  
  537.   alias eme_ees_learn_skill learn_skill
  538.   def learn_skill(skill_id)
  539.     eme_ees_learn_skill(skill_id)
  540.     @non_set_skills.push(skill_id) unless @skill_from_sets
  541.     @skill_from_sets = false
  542.   end
  543.  
  544.   alias eme_ebs_change_equip change_equip
  545.   def change_equip(slot_id, item)
  546.       for set_id in 1..EME::Sets.size
  547.         for ees_set_equip in EME::Sets[set_id]
  548.           if slot_id != nil and @equips[slot_id] != nil and @equips[slot_id].object != nil
  549.             if ees_is_the_set_item?(@equips[slot_id].object, ees_set_equip)
  550.               @item_sets[set_id] -= 1
  551.               @active_sets.delete(set_id) if @item_sets[set_id] == 0
  552.             end
  553.           end
  554.           if item != nil and ees_is_the_set_item?(item, ees_set_equip)
  555.             @item_sets[set_id] += 1
  556.             @active_sets.push(set_id) unless @active_sets.include?(set_id)
  557.             if EME::Set_Sounds.has_key?(set_id) and EME::Set_Sounds[set_id].has_key?(set_amount_wearing(set_id))
  558.               sound = EME::Set_Sounds[set_id][set_amount_wearing(set_id)]
  559.               Audio.se_play("Audio/SE/" + sound[0], sound[1], sound[2])
  560.             end
  561.           end
  562.         end
  563.       end
  564.     set_check
  565.     eme_ebs_change_equip(slot_id, item)
  566.   end
  567.  
  568.   def unlearn_set_skills(set_id)
  569.     EME::Set_Bonuses[set_id].each_value{|bonus_array|
  570.       bonus_array.each{|bonus|
  571.         if bonus[0] == 4
  572.           forget_skill(bonus[2]) unless @non_set_skills.include?(bonus[2])
  573.           @ees_skills.delete(bonus[2])
  574.         end
  575.       }
  576.     }
  577.   end
  578.  
  579.   def item_set_reset_all
  580.     @active_sets.each{|set_id| item_set_reset(set_id)}
  581.   end
  582.  
  583.   def item_set_reset(set_id)
  584.     return unless set_id > 0 and @item_sets[set_id] > 0
  585.     unlearn_set_skills(set_id)
  586.   end
  587.  
  588.   def release_unequippable_items(item_gain = true)
  589.     @equips.each_with_index do |item, i|
  590.       if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
  591.         trade_item_with_party(nil, item.object) if item_gain
  592.         item.object = nil
  593.       end
  594.     end
  595.   end
  596.  
  597.   def release_unequippable_items(item_gain = true)
  598.     loop do
  599.       change_equips = 0
  600.       @equips.each_with_index do |item, i|
  601.         if !equippable?(item.object) or item.object.etype_id != equip_slots[i]
  602.           next if (RPG::Weapon.method_defined?(:two_handed?) and dual_wield? and (equip_slots[i] == 1 and item.object.etype_id == 0))
  603.           trade_item_with_party(nil, item.object) if item_gain
  604.           change_equips += 1 unless item.object.nil?
  605.           unless item.object.nil?
  606.           for set_id in 1..EME::Sets.size
  607.             for ees_set_equip in EME::Sets[set_id]
  608.               if ees_is_the_set_item?(item.object, ees_set_equip)
  609.                 @item_sets[set_id] -= 1
  610.                 @active_sets.delete(set_id) if @item_sets[set_id] == 0
  611.               end
  612.             end
  613.           end
  614.           end
  615.           item.object = nil
  616.         end
  617.       end
  618.       set_check
  619.       break if change_equips == 0
  620.     end
  621.   end
  622.  
  623.   alias eme_ebs_discard_equip discard_equip
  624.   def discard_equip(item)
  625.     slot_id = equips.index(item)
  626.     if slot_id != nil
  627.       for set_id in 1..EME::Sets.size
  628.         for ees_set_equip in EME::Sets[set_id]
  629.           if ees_is_the_set_item?(item, ees_set_equip)
  630.             @item_sets[set_id] -= 1
  631.             @active_sets.delete(set_id) if @item_sets[set_id] == 0
  632.           end
  633.         end
  634.       end
  635.     end
  636.     eme_ebs_discard_equip(item)
  637.     refresh
  638.   end
  639.  
  640.   def set_amount_wearing(set_id)
  641.     return @item_sets[set_id]
  642.   end
  643.  
  644.   def set_check
  645.     item_set_reset_all
  646.     reset_bonuses
  647.     @active_sets.each{|set| change_bonuses(set) unless set == nil}
  648.   end
  649.  
  650.   def change_bonuses(set_id)
  651.     return if set_id == 0 or set_amount_wearing(set_id) == 0
  652.     EME::Set_Bonuses[set_id].each_key{|key|
  653.       if set_amount_wearing(set_id) >= key
  654.         for g in 0...EME::Set_Bonuses[set_id][key].size
  655.           sort = EME::Set_Bonuses[set_id][key][g][0]
  656.           stat = EME::Set_Bonuses[set_id][key][g][1]
  657.           stat_bonus = EME::Set_Bonuses[set_id][key][g][2]
  658.           case EME::Set_Bonuses[set_id][key][g][0]
  659.           when 0
  660.             sets_param_change(stat, stat_bonus)
  661.           when 1
  662.             sets_per_param_change(stat, stat_bonus)
  663.           when 2
  664.             sets_xparam_change(stat, stat_bonus)
  665.           when 3
  666.             sets_sparam_change(stat, stat_bonus)
  667.           when 4
  668.             next if skill_learn?(stat_bonus)
  669.             @skill_from_sets = true
  670.             learn_skill(stat_bonus)
  671.             @ees_skills.push(stat_bonus)
  672.           when 5
  673.             stat -= 1
  674.             sets_element_rate_change(stat, stat_bonus)
  675.           when 6
  676.             stat -= 1
  677.             sets_debuff_rate_change(stat, stat_bonus)
  678.           when 7
  679.             stat -= 1
  680.             sets_state_rate_change(stat, stat_bonus)
  681.           when 8
  682.             sets_state_resist_change(stat, stat_bonus)
  683.           when 9
  684.             sets_atk_elements_change(stat, stat_bonus)
  685.           when 10
  686.             sets_atk_states_change(stat) if stat_bonus > 0
  687.             sets_atk_states_rate_change(stat, stat_bonus)
  688.           when 11
  689.             if stat < 2
  690.               change_sets_additional_wtypes(stat_bonus, (stat == 0 ? true : false))
  691.             elsif stat < 4
  692.               change_sets_additional_atypes(stat_bonus, (stat == 2))
  693.             elsif stat == 4
  694.               @eme_ebs_two_swords_style = true
  695.             end
  696.           when 12
  697.             sets_atk_specials_change(stat, stat_bonus)
  698.           when 13
  699.             add_sets_skill_types(stat, stat_bonus)
  700.           when 14
  701.             add_sets_sealed_skill_types(stat, stat_bonus)
  702.           when 15
  703.             add_sets_sealed_skills(stat, stat_bonus)
  704.           when 16
  705.             add_sets_fixed_equip_types(stat, stat_bonus)
  706.           when 17
  707.             add_sets_sealed_equip_types(stat, stat_bonus)
  708.           when 18
  709.             stat_bonus < 0 ? change_special_flags(stat, true) : change_special_flags(stat)
  710.           when 19
  711.             stat_bonus < 0 ? change_party_abilities(stat, true) : change_party_abilities(stat)
  712.           when 20
  713.             case stat
  714.             when 0
  715.               set_bonus_max_tp(stat_bonus)
  716.             when 1
  717.               set_atk_skill(stat_bonus)
  718.             when 2
  719.               set_grd_skill(stat_bonus)
  720.             end
  721.           end
  722.         end
  723.       end
  724.     }
  725.   end
  726.  
  727. #-------------------------------------------#
  728. # LABEL FOR AUTHOR                          #
  729. # Don't mind this ;)                        #
  730. #-------------------------------------------#
  731.  
  732.   def reset_bonuses
  733.     @sets_param_plus = [0] * 8
  734.     @sets_per_param_plus = [0] * 8
  735.     @sets_xparam_plus = [0] * 10
  736.     @sets_sparam_plus = [0] * 10
  737.     @sets_element_rate = [0] * (EME::MAX_ELEMENTS)
  738.     @sets_debuff_rate = [0] * 8
  739.     @sets_state_rate = [0] * ($data_states.size + 1)
  740.     @sets_state_resist = []
  741.     @sets_state_resist_remove = []
  742.     @sets_atk_elements = []
  743.     @sets_atk_elements_remove = []
  744.     @sets_atk_states = []
  745.     @sets_atk_states_rate = [0] * $data_states.size
  746.     @sets_atk_speed_plus = 0
  747.     @sets_atk_times_plus = 0
  748.     @sets_skill_types = []
  749.     @sets_skill_types_remove = []
  750.     @sets_sealed_skill_types = []
  751.     @sets_sealed_skill_types_remove = []
  752.     @sets_sealed_skills = []
  753.     @sets_sealed_skills_remove = []
  754.     @sets_fixed_equip_types = []
  755.     @sets_fixed_equip_types_remove = []
  756.     @sets_sealed_equip_types = []
  757.     @sets_sealed_equip_types_remove = []
  758.  
  759.     @ees_added_special_flags = []
  760.     @ees_removed_special_flags = []
  761.     @ees_added_party_abilities = []
  762.     @ees_removed_party_abilities = []
  763.     @ees_bonus_max_tp = 0
  764.     @new_atk_skill = nil
  765.     @new_grd_skill = nil
  766.  
  767.     @ees_skills = []
  768.     @sets_wtypes = []
  769.     @sets_atypes = []
  770.     @sets_removed_wtypes = []
  771.     @sets_removed_atypes = []
  772.     @eme_ebs_two_swords_style = false
  773.   end
  774.  
  775.   def sets_param_plus(param_id)
  776.     @sets_param_plus[param_id]
  777.   end
  778.  
  779.   def sets_param_change(param_id, value)
  780.     @sets_param_plus[param_id] += value
  781.   end
  782.  
  783.   def sets_per_param_plus(param_id)
  784.     value = param_base(param_id) + param_plus(param_id)
  785.     value *= @sets_per_param_plus[param_id] / 100
  786.     return value
  787.   end
  788.  
  789.   def sets_per_param_change(param_id, value)
  790.     @sets_per_param_plus[param_id] += value
  791.   end
  792.  
  793.   def sets_xparam_plus(param_id)
  794.     @sets_xparam_plus[param_id]
  795.   end
  796.  
  797.   def sets_xparam_change(param_id, value)
  798.     @sets_xparam_plus[param_id] += value
  799.   end
  800.  
  801.   def sets_sparam_plus(param_id)
  802.     @sets_sparam_plus[param_id]
  803.   end
  804.  
  805.   def sets_sparam_change(param_id, value)
  806.     @sets_sparam_plus[param_id] += value
  807.   end
  808.  
  809.   def sets_element_rate(element_id)
  810.     @sets_element_rate[element_id]
  811.   end
  812.  
  813.   def sets_element_rate_change(element_id, value)
  814.     @sets_element_rate[element_id] += value
  815.   end
  816.  
  817.   def sets_debuff_rate(param_id)
  818.     @sets_debuff_rate[param_id]
  819.   end
  820.  
  821.   def sets_debuff_rate_change(param_id, value)
  822.     @sets_debuff_rate[param_id] += value
  823.   end
  824.  
  825.   def sets_state_rate(state_id)
  826.     @sets_state_rate[state_id]
  827.   end
  828.  
  829.   def sets_state_rate_change(state_id, value)
  830.     @sets_state_rate[state_id] += value
  831.   end
  832.  
  833.   def sets_state_resist(state_id)
  834.     @sets_state_resist[state_id]
  835.   end
  836.  
  837.   def sets_state_resist_remove(state_id)
  838.     @sets_state_resist_remove[state_id]
  839.   end
  840.  
  841.   def sets_state_resist_change(state_id, value)
  842.     value >= 0 ? (@sets_state_resist.push(state_id) unless @sets_state_resist.include?(state_id)) : (@sets_state_resist_remove.delete(state_id) unless @sets_state_resist_remove.include?(state_id))
  843.   end
  844.  
  845.   def sets_atk_elements(element_id)
  846.     @sets_atk_elements[element_id]
  847.   end
  848.  
  849.   def sets_atk_elements_remove(element_id)
  850.     @sets_atk_elements_remove[element_id]
  851.   end
  852.  
  853.   def sets_atk_elements_change(element_id, value)
  854.     value >= 0 ? (@sets_atk_elements.push(element_id) unless @sets_atk_elements.include?(element_id)) : (@sets_attack_elements_remove.delete(element_id) unless @sets_atk_elements_remove.include?(element_id))
  855.   end
  856.  
  857.   def sets_atk_states(state_id)
  858.     @sets_atk_states[state_id]
  859.   end
  860.  
  861.   def sets_atk_states_change(state_id)
  862.     @sets_atk_states.push(state_id) unless @sets_atk_states.include?(state_id)
  863.   end
  864.  
  865.   def sets_atk_states_rate(state_id)
  866.     @sets_atk_states_rate[state_id]
  867.   end
  868.  
  869.   def sets_atk_states_rate_change(state_id, value)
  870.     @sets_atk_states_rate[state_id] += value
  871.   end
  872.  
  873.   def sets_atk_speed_plus
  874.     @sets_atk_speed_plus
  875.   end
  876.  
  877.   def sets_atk_times_plus
  878.     @sets_atk_times_plus
  879.   end
  880.  
  881.   def sets_atk_specials_change(parameter, value)
  882.     parameter == 0 ? @sets_atk_speed_plus += value : @sets_atk_times_plus += value
  883.   end
  884.  
  885.   def sets_skill_types(skill_type_id)
  886.     @sets_skill_types[skill_type_id]
  887.   end
  888.  
  889.   def sets_skill_types_remove(skill_type_id)
  890.     @sets_skill_types_remove[skill_type_id]
  891.   end
  892.  
  893.   def add_sets_skill_types(skill_type_id, value)
  894.     value >= 0 ? (@sets_skill_types.push(skill_type_id) unless @sets_skill_types.include?(skill_type_id)) : (@sets_skill_types_remove.delete(skill_type_id) unless @sets_skill_types_remove.include?(skill_type_id))
  895.   end
  896.  
  897.   def sets_sealed_skill_types(skill_type_id)
  898.     @sets_sealed_skill_types[skill_type_id]
  899.   end
  900.  
  901.   def sets_sealed_skill_types_remove(skill_type_id)
  902.     @sets_sealed_skill_types_remove[skill_type_id]
  903.   end
  904.  
  905.   def add_sealed_skill_types(skill_type_id, value)
  906.     value >= 0 ? (@sets_sealed_skill_types.push(skill_type_id) unless @sets_sealed_skill_types.include?(skill_type_id)) : (@sets_sealed_skill_types_remove.delete(skill_type_id) unless @sets_sealed_skill_types_remove.include?(skill_type_id))
  907.   end
  908.  
  909.   def sets_sealed_skills(skill_id)
  910.     @sets_sealed_skills[skill_id]
  911.   end
  912.  
  913.   def sets_sealed_skills_remove(skill_id)
  914.     @sets_sealed_skills_remove[skill_id]
  915.   end
  916.  
  917.   def add_sets_sealed_skills(skill_id, value)
  918.     value > 0 ? (@sets_sealed_skills.push(skill_id) unless @sets_sealed_skills.include?(skill_id)) : (@sets_attack_elements_remove.delete(skill_id) unless @sets_sealed_skills_remove.include?(skill_id))
  919.   end
  920.  
  921.   def sets_additional_wtypes
  922.     @sets_wtypes
  923.   end
  924.  
  925.   def sets_additional_atypes
  926.     @sets_atypes
  927.   end
  928.  
  929.   def sets_removed_wtypes
  930.     @sets_removed_wtypes
  931.   end
  932.  
  933.   def sets_removed_atypes
  934.     @sets_removed_atypes
  935.   end
  936.  
  937.   def change_sets_additional_wtypes(wtype_id, positive_change = true)
  938.     positive_change ? @sets_wtypes.push(wtype_id) : @sets_removed_wtypes.push(wtype_id)
  939.   end
  940.  
  941.   def change_sets_additional_atypes(atype_id, positive_change = true)
  942.     positive_change ? @sets_atypes.push(atype_id) : @sets_removed_atypes.push(atype_id)
  943.   end
  944.  
  945.   def sets_fixed_equip_types(equip_type_id)
  946.     @sets_fixed_equip_types[equip_type_id]
  947.   end
  948.  
  949.   def sets_fixed_equip_types_remove(equip_type_id)
  950.     @sets_fixed_equip_types_remove[equip_type_id]
  951.   end
  952.  
  953.   def add_fixed_equip_types(equip_type_id, value)
  954.     value >= 0 ? @sets_fixed_equip_types.push(equip_type_id) : @sets_fixed_equip_types_remove.delete(sequip_type_id)
  955.   end
  956.  
  957.   def sets_sealed_equip_types(equip_type_id)
  958.     @sets_sealed_equip_types[equip_type_id]
  959.   end
  960.  
  961.   def sets_sealed_equip_types_remove(equip_type_id)
  962.     @sets_sealed_equip_types_remove[equip_type_id]
  963.   end
  964.  
  965.   def add_sealed_equip_types(equip_type_id, value)
  966.     value > 0 ? (@sets_sealed_equip_types.push(equip_type_id) unless @sets_sealed_equip_types.include?(equip_type_id)) : (@sets_sealed_equip_types_remove.delete(equip_type_id) unless @sets_sealed_equip_types_remove.include?(equip_type_id))
  967.   end
  968.  
  969.   def change_special_flags(flag_id, negative = false)
  970.     !negative ? @ees_added_special_flags.push(flag_id) : @ees_removed_special_flags.push(flag_id)
  971.   end
  972.  
  973.   def change_party_abilities(ability_id, negative = false)
  974.     !negative ? @ees_added_party_abilities.push(ability_id) : @ees_removed_party_abilities.push(ability_id)
  975.   end
  976.  
  977.   def set_bonus_max_tp(value)
  978.     @ees_bonus_max_tp += value
  979.   end
  980.  
  981.   def set_atk_skill(skill_id)
  982.     @new_atk_skill = skill_id
  983.   end
  984.  
  985.   def set_grd_skill(skill_id)
  986.     @new_grd_skill = skill_id
  987.   end
  988.  
  989. #-------------------------------------------#
  990. # 'NOTHER LABEL FOR AUTHOR                  #
  991. # Don't mind this ;)                        #
  992. #-------------------------------------------#
  993.  
  994.   def param(param_id)
  995.     value = param_base(param_id) + param_plus(param_id) + sets_param_plus(param_id) #+ [sets_per_param_plus(param_id), 0].max
  996.     value *= param_rate(param_id) * param_buff_rate(param_id)
  997.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  998.   end
  999.  
  1000.   alias eme_ebs_xparam xparam
  1001.   def xparam(xparam_id)
  1002.     value = eme_ebs_xparam(xparam_id) + sets_xparam_plus(xparam_id) / 100
  1003.     return value
  1004.   end
  1005.  
  1006.   alias eme_ebs_sparam sparam
  1007.   def sparam(sparam_id)
  1008.     value = eme_ebs_sparam(sparam_id) + sets_sparam_plus(sparam_id) / 100
  1009.     return value
  1010.   end
  1011.  
  1012.   alias eme_ebs_element_rate element_rate
  1013.   def element_rate(element_id)
  1014.     value = eme_ebs_element_rate(element_id) + sets_element_rate(element_id) / 100
  1015.     return value
  1016.   end
  1017.  
  1018.   alias eme_ebs_debuff_rate debuff_rate
  1019.   def debuff_rate(param_id)
  1020.     value = eme_ebs_debuff_rate(param_id) + sets_debuff_rate(param_id) / 100
  1021.     return value
  1022.   end
  1023.  
  1024.   alias eme_ebs_state_rate state_rate
  1025.   def state_rate(state_id)
  1026.     value = eme_ebs_state_rate(state_id) + sets_state_rate(state_id) / 100
  1027.     return value
  1028.   end
  1029.  
  1030.   alias eme_ebs_state_resist_set state_resist_set
  1031.   def state_resist_set
  1032.     value = eme_ebs_state_resist_set
  1033.     @sets_state_resist.each{|state| value.push(state) unless value.include?(element)}
  1034.     @sets_state_resist_remove.each{|state| value.delete(state)}
  1035.     return value
  1036.   end
  1037.  
  1038.   alias eme_ebs_atk_elements atk_elements
  1039.   def atk_elements
  1040.     value = eme_ebs_atk_elements
  1041.     @sets_atk_elements.each{|element| value.push(element) unless value.include?(element)}
  1042.     @sets_atk_elements_remove.each{|element| value.delete(element)}
  1043.     return value
  1044.   end
  1045.  
  1046.   alias eme_ebs_atk_states atk_states
  1047.   def atk_states
  1048.     value = eme_ebs_atk_states
  1049.     @sets_atk_states.each{|state| value.push(@sets_atk_states[i]) }
  1050.     return value
  1051.   end
  1052.  
  1053.   alias eme_ebs_atk_states_rate atk_states_rate
  1054.   def atk_states_rate(state_id)
  1055.     value = eme_ebs_atk_states_rate(state_id) + sets_atk_states_rate(state_id) / 100
  1056.     return value
  1057.   end
  1058.  
  1059.   alias eme_ebs_atk_speed atk_speed
  1060.   def atk_speed
  1061.     value = eme_ebs_atk_speed + sets_atk_speed_plus / 100
  1062.     return value
  1063.   end
  1064.  
  1065.   alias eme_ebs_atk_times atk_times_add
  1066.   def atk_times_add
  1067.     value = [eme_ebs_atk_times + sets_atk_times_plus / 100, 0].max
  1068.     return value
  1069.   end
  1070.  
  1071.   alias eme_ebs_dual_wield? dual_wield?
  1072.   def dual_wield?
  1073.     return true if @eme_ebs_two_swords_style
  1074.     eme_ebs_dual_wield?
  1075.   end
  1076.  
  1077.   alias eme_ebs_added_skill_types added_skill_types
  1078.   def added_skill_types
  1079.     value = eme_ebs_added_skill_types
  1080.     @sets_skill_types.each{|sk_type| value.push(sk_type)}
  1081.     @sets_skill_types_remove.each{|sk_type| value.delete(sk_type)}
  1082.     return value
  1083.   end
  1084.  
  1085.   def skill_type_sealed?(stype_id)
  1086.     value = features_set(FEATURE_STYPE_SEAL)
  1087.     @sets_sealed_skill_types.each{|sk_type| value.push(sk_type)}
  1088.     @sets_sealed_skill_types_remove.each{|sk_type| value.delete(sk_type)}
  1089.     return true if value.include?(stype_id)
  1090.   end
  1091.  
  1092.   def skill_sealed?(skill_id)
  1093.     value = features_set(FEATURE_SKILL_SEAL)
  1094.     @sets_sealed_skills.each{|skill| value.push(skill)}
  1095.     @sets_sealed_skills_remove.each{|skill| value.delete(skill)}
  1096.     return true if value.include?(skill_id)
  1097.   end
  1098.  
  1099.   def equip_wtype_ok?(wtype_id)
  1100.     value = features_set(FEATURE_EQUIP_WTYPE)
  1101.     @sets_wtypes.each{|w_type| value.push(w_type)}
  1102.     @sets_removed_wtypes.each{|w_type| value.delete(w_type)}
  1103.     return true if value.include?(wtype_id)
  1104.   end
  1105.  
  1106.   def equip_atype_ok?(atype_id)
  1107.     value = features_set(FEATURE_EQUIP_ATYPE)
  1108.     @sets_atypes.each{|a_type| value.push(a_type)}
  1109.     @sets_removed_atypes.each{|a_type| value.delete(a_type)}
  1110.     return true if value.include?(atype_id)
  1111.   end
  1112.  
  1113.   def equip_type_fixed?(etype_id)
  1114.     value = features_set(FEATURE_EQUIP_FIX)
  1115.     @sets_fixed_equip_types.each{|e_type| value.push(e_type)}
  1116.     @sets_fixed_equip_types_remove.each{|e_type| value.delete(e_type)}
  1117.     return true if value.include?(etype_id)
  1118.   end
  1119.  
  1120.   def equip_type_sealed?(etype_id)
  1121.     value = features_set(FEATURE_EQUIP_SEAL)
  1122.     @sets_sealed_equip_types.each{|e_type| value.push(e_type)}
  1123.     @sets_sealed_equip_types_remove.each{|e_type| value.delete(e_type)}
  1124.     return true if value.include?(etype_id)
  1125.   end
  1126.  
  1127.   alias eme_ees_special_flag special_flag
  1128.   def special_flag(flag_id)
  1129.     return false if @ees_removed_special_flags.include?(flag_id)
  1130.     return @ees_added_special_flags.include?(flag_id) ? true : eme_ees_special_flag(flag_id)
  1131.   end
  1132.  
  1133.   alias eme_ees_party_ability party_ability
  1134.   def party_ability(ability_id)
  1135.     return false if @ees_removed_party_abilities.include?(ability_id)
  1136.     return @ees_added_party_abilities.include?(ability_id) ? true : eme_ees_party_ability(ability_id)
  1137.   end
  1138.  
  1139.   alias eme_ees_max_tp max_tp
  1140.   def max_tp
  1141.     return eme_ees_max_tp + @ees_bonus_max_tp
  1142.   end
  1143.  
  1144.   alias eme_ees_attack_skill attack_skill_id
  1145.   def attack_skill_id
  1146.     return @new_atk_skill unless @new_atk_skill == nil
  1147.     return eme_ees_attack_skill
  1148.   end
  1149.  
  1150.   alias eme_ees_guard_skill guard_skill_id
  1151.   def guard_skill_id
  1152.     return @new_grd_skill unless @new_grd_skill == nil
  1153.     return eme_ees_guard_skill
  1154.   end
  1155.  
  1156. end



Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2015-8-8 18:00:53 | 只看该作者
8成是因为套装属性还没来得及加
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

3
发表于 2015-8-8 19:13:35 | 只看该作者
  1. class Game_Battler#Game_Actor
  2.   def equiprepeat
  3.     @equiprepeat=Hash.new(0)#hash表的默认值设定为零就行了,你那一个1999次循环无法直视。。天啊。。
  4.     equips.each do |e|  # Game_Actors#equips 方法,返回当前装备实例的数组,详见默认173,比@equips省心多了
  5.       if e.is_a?(RPG::Weapon)
  6.         @equiprepeat[-e.id] += 1
  7.       elsif e.is_a?(RPG::Armor)
  8.         @equiprepeat[e.id] += 1
  9.       end
  10.     end
  11.     @equiprepeat #最后一行返回可以省下return少打几个字母
  12.   end
  13. end
复制代码
  1. module Chd114 end
  2. module Chd114::Equip#(武器ID为-1~-999,防具ID为1~999)
  3.   Suit={#套装类型={装备ID=>装备数量}
  4.   1=>{64=>1,65=>1,66=>1},
  5.   2=>{63=>1,64=>1},
  6.   }
  7.   SuitEffect={#套装类型={部件数=>{属性ID=>属性效果}}
  8.   1=>{2=>{0=>2.0},3=>{1=>50}},
  9.   2=>{2=>{0=>505}},
  10.   }
  11. end
  12. (0..999).each{|i|Chd114::Equip::Suit[i]||={};Chd114::Equip::SuitEffect[i]||={}}
复制代码
  1. =begin
  2. mhp 0 最大HP          Maximum Hit Point    mmp 1 最大MP   Maximum Magic Point
  3. atk 2 物理攻击        ATtacK power         def 3 物理防御  DEFense power
  4. mat 4 魔法攻击        Magic ATtack power   mdf 5 魔法防御  Magic DeFense power
  5. agi 6 敏 捷 值        AGIlity      luk 7 幸 运 值        LUcK
  6. =end
  7. class Game_Actor
  8.   alias_method :c4_suit, :param_plus
  9.   def param_plus(id)
  10.     old = c4_suit(id)
  11.     basic = old
  12.     tt=0
  13.     Chd114::Equip::Suit.each{|k,v|
  14.     v.each{|k,v|tt+=equiprepeat[k]}
  15.     Chd114::Equip::SuitEffect[k].each{|k,v|
  16.     v.each{|k,v|old += v*((v.is_a?(Float)) ? param_base(k) : 1) if id==k} if tt>=k
  17.     }
  18.     }
  19.     old
  20.   end
  21. end
复制代码
用这个试试看?
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
87 小时
注册时间
2013-1-13
帖子
66
4
 楼主| 发表于 2015-8-11 21:22:52 | 只看该作者
本帖最后由 zxc123a4s5d6 于 2015-8-11 21:25 编辑
chd114 发表于 2015-8-8 19:13
用这个试试看?
  1. class Game_Battler#Game_Actor

  2.   def equiprepeat

  3.     @equiprepeat=Hash.new(0)#hash表的默认值设定为零就行了,你那一个1999次循环无法直视。。天啊。。

  4.     equips.each do |e|  # Game_Actors#equips 方法,返回当前装备实例的数组,详见默认173,比@equips省心多了

  5.       if e.is_a?(RPG::Weapon)

  6.         @equiprepeat[-e.id] += 1

  7.       elsif e.is_a?(RPG::Armor)

  8.         @equiprepeat[e.id] += 1

  9.       end

  10.     end

  11.     @equiprepeat #最后一行返回可以省下return少打几个字母

  12.   end

  13. end

  14. module Chd114 end

  15. module Chd114::Equip#(武器ID为-1~-999,防具ID为1~999)

  16.   Suit={#套装类型={装备ID=>装备数量}

  17.   1=>{64=>1,65=>1,66=>1},

  18.   2=>{63=>1,64=>1},

  19.   }

  20.   SuitEffect={#套装类型={部件数=>{属性ID=>属性效果}}

  21.   1=>{2=>{0=>2.0},3=>{1=>50}},

  22.   2=>{2=>{0=>505}},

  23.   }

  24. end

  25. (0..999).each{|i|Chd114::Equip::Suit[i]||={};Chd114::Equip::SuitEffect[i]||={}}



  26. =begin

  27. mhp 0 最大HP          Maximum Hit Point    mmp 1 最大MP   Maximum Magic Point

  28. atk 2 物理攻击        ATtacK power         def 3 物理防御  DEFense power

  29. mat 4 魔法攻击        Magic ATtack power   mdf 5 魔法防御  Magic DeFense power

  30. agi 6 敏 捷 值        AGIlity      luk 7 幸 运 值        LUcK

  31. =end

  32. class Game_Actor

  33.   alias_method :c4_suit, :param_plus

  34.   def param_plus(id)

  35.     old = c4_suit(id)

  36.     basic = old

  37.     tt=0

  38.     Chd114::Equip::Suit.each{|k,v|

  39.     v.each{|k,v|tt+=equiprepeat[k]}

  40.     Chd114::Equip::SuitEffect[k].each{|k,v|

  41.     v.each{|k,v|old += v*((v.is_a?(Float)) ? param_base(k) : 1) if id==k} if tt>=k

  42.     }

  43.     }

  44.     old

  45.   end

  46. end
复制代码
是像这样然后自己加属性吗?也就是说武器ID前面要加一个-?话说怎么还有装备数量?可以一次装备许多个吗。。。

但这样攻击附加属性啊,属性抗性这些都不能添加了啊。。。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

5
发表于 2015-8-21 23:36:52 | 只看该作者
zxc123a4s5d6 发表于 2015-8-11 04:22
是像这样然后自己加属性吗?也就是说武器ID前面要加一个-?话说怎么还有装备数量?可以一次装备许多个吗。 ...

装备数量的判定是因为你可以用来配合我的另一个脚本···

点评

直接加···又不是dota的魔抗非线性叠加···  发表于 2015-9-4 16:13
加法计算是么。  发表于 2015-9-4 15:41
当然还有···  发表于 2015-8-30 18:58
另外还有个问题。比如套装总共3件,穿两件就有的属性附加到第三件穿上去以后还有么?  发表于 2015-8-30 18:45
怪不得。总觉得计算不太对。不过坑爹的是图书馆的破限脚本做的设置分辨是基础属性。。 然后就呵呵了,发现了一个套装穿上后56万血的简直。。  发表于 2015-8-30 18:43
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 17:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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