roninator2

Tsukihime Dynamic Equip Slots addon

Dec 5th, 2024
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.48 KB | None | 0 0
  1. =begin
  2. #=====================================================================
  3. #   HIME's Dynamic Equip Slots - Add-on
  4. #   Version 1.0.01
  5. #   Author: Roninator2
  6. #   Date: 18 Aug 2019
  7. #   Latest: 18Aug 2019
  8. #=====================================================================#
  9. #   UPDATE LOG
  10. #---------------------------------------------------------------------#
  11. # 18 Aug 2019 - Created notetag to add slots by level
  12. #=====================================================================#
  13. #       NOTETAGS
  14. #=====================================================================#
  15.  
  16. Notetag actors as many times as you require with the following:
  17.  
  18.     * <add slot: Level, etype_id>
  19.     * e.g. <add slot: 5, 4>
  20.  Where `etype_id` is the equip type ID. By default, they are as follows:
  21.    0 - weapon
  22.    1 - shield
  23.    2 - headgear
  24.    3 - bodygear
  25.    4 - accessory
  26.  
  27. =end
  28.  
  29. module TH
  30.   module Dynamic_Equip_Slots
  31.     Regexlevel = /<add[-_ ]slot:[-_ ](\d+*)\,*.*?(\d+*)>/i
  32.   end
  33. end
  34.  
  35. module RPG
  36.   class Actor
  37.     attr_reader :level
  38.     def load_notetag_level_equip_slots
  39.       results = self.note.scan(TH::Dynamic_Equip_Slots::Regexlevel)
  40.       results.each do |res|
  41.         if $game_actors[@id].level == res[0].to_i
  42.           $game_actors[@id].add_equip_slot(res[1].to_i)
  43.         end
  44.       end
  45.     end
  46.   end
  47. end
  48.  
  49. class Game_Actor < Game_Battler
  50.   alias :r2_level_up_97bfu  :level_up
  51.   def level_up
  52.     r2_level_up_97bfu
  53.     actor.load_notetag_level_equip_slots
  54.   end
  55. end
  56.  
Add Comment
Please, Sign In to add comment