Advertisement
Dekita

$D13x Hidden skills v1.2

May 30th, 2013
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.51 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Hidden Skills
  5. # -- Author : Dekita
  6. # -- Version : 1.2
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Hidden_Skills]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 17/o5/2o13 - Small Update,
  21. # 23/o3/2o13 - Bugfix, (actor always over-riding class)
  22. # 15/o3/2o13 - Started, Finished,
  23. #
  24. #===============================================================================
  25. # ☆ Introduction
  26. #-------------------------------------------------------------------------------
  27. # This script simply hides a skill type from the actors usable skill list when
  28. # in battle. usefull for creating "passive" skills that can be seen from the
  29. # skill menu, but are not visible/usable in battle.
  30. #
  31. #===============================================================================
  32. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  33. #===============================================================================
  34. # 1. You MUST give credit to "Dekita" !!
  35. # 2. You are NOT allowed to repost this script.(or modified versions)
  36. # 3. You are NOT allowed to convert this script.
  37. # 4. You are NOT allowed to use this script for Commercial games.
  38. # 5. ENJOY!
  39. #
  40. # "FINE PRINT"
  41. # By using this script you hereby agree to the above terms and conditions,
  42. # if any violation of the above terms occurs "legal action" may be taken.
  43. # Not understanding the above terms and conditions does NOT mean that
  44. # they do not apply to you.
  45. # If you wish to discuss the terms and conditions in further detail you can
  46. # contact me at http://dekitarpg.wordpress.com/
  47. #
  48. #===============================================================================
  49. # ☆ Instructions
  50. #-------------------------------------------------------------------------------
  51. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  52. #
  53. #===============================================================================
  54. # ☆ Notetags ( default )
  55. # For use with Class / Actor noteboxes !
  56. #-------------------------------------------------------------------------------
  57. # These notetags will hide a whole skill type.
  58. # <HIDDEN TYPES: id, id, id>...
  59. # <NO TYPE: id, id, id>...
  60. #
  61. # These notetags will hide an individual skill.
  62. # <HIDDEN SKILLS: id, id, id>..
  63. # <NO SKILL: id, id, id>..
  64. #
  65. # repalce id with the ids of the skill types you do not wish to be visible
  66. # in battle.
  67. #
  68. # Actor takes priority over class.
  69. #===============================================================================
  70. module Unusable_Skill
  71. #===============================================================================
  72.  
  73. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  74. # ☆ Disabled Skill Default Settings
  75. #--------------------------------------------------------------------------
  76. # This is an array that hides all skill type id's within,
  77. # e.g [2, 3, 4] would hide skill type id 2, 3 and 4.
  78. Stype_id = [2]
  79. # This array hides specific skills id,
  80. # eg. [1, 2, 3] hides skills id 1, 2 and 3.
  81. Skill_id = [44,45,46]
  82. # Settings for notetags, incase they need changed.
  83. Notetag = {
  84. :types => /<(?:NO TYPE|HIDDEN TYPES):[ ](\d+(?:\s*,\s*\d+)*)>/i ,
  85. :skills => /<(?:no skill|hidden skills):[ ](\d+(?:\s*,\s*\d+)*)>/i ,
  86. }# << Keep #####################
  87. # CUSTOMISATION END #
  88. end #####################
  89. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  90. # #
  91. # http://dekitarpg.wordpress.com/ #
  92. # #
  93. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  94. #===============================================================================
  95. module DataManager
  96. #===============================================================================
  97. #--------------------------------------------------------------------------
  98. # Alias List
  99. #--------------------------------------------------------------------------
  100. class << self
  101. alias :load_database_hide :load_database
  102. end
  103. #--------------------------------------------------------------------------
  104. # Load Database
  105. #--------------------------------------------------------------------------
  106. def self.load_database
  107. load_database_hide
  108. load_notetags_hide
  109. end
  110. #--------------------------------------------------------------------------
  111. # Load Notetags
  112. #--------------------------------------------------------------------------
  113. def self.load_notetags_hide
  114. for obj in $data_classes
  115. next if obj.nil?
  116. obj.load_skill_hide
  117. end
  118. for obj in $data_actors
  119. next if obj.nil?
  120. obj.load_skill_hide
  121. end
  122. end
  123.  
  124. end # DataManager
  125.  
  126. #===============================================================================
  127. class RPG::Class < RPG::BaseItem
  128. #===============================================================================
  129. #---------------------------------------------------------------------------
  130. # Pi Variables
  131. #---------------------------------------------------------------------------
  132. attr_accessor :hidden_skill_types
  133. attr_accessor :hidden_skills
  134. #--------------------------------------------------------------------------
  135. # Load All Hidden Skills
  136. #--------------------------------------------------------------------------
  137. def load_skill_hide
  138. @hidden_skill_types = []
  139. @hidden_skills = []
  140. Unusable_Skill::Stype_id.each do |this|
  141. @hidden_skill_types << this
  142. end
  143. Unusable_Skill::Skill_id.each do |this|
  144. @hidden_skills << this
  145. end
  146. self.note.split(/[\r\n]+/).each do |line|
  147. case line
  148. when Unusable_Skill::Notetag[:types]
  149. @hidden_skill_types = []
  150. $1.scan(/\d+/).each { |num|
  151. @hidden_skill_types << num.to_i if num.to_i > 0 }
  152. when Unusable_Skill::Notetag[:skills]
  153. @hidden_skills = []
  154. $1.scan(/\d+/).each { |num|
  155. @hidden_skills << num.to_i if num.to_i > 0 }
  156. end
  157. end
  158. end
  159.  
  160. end # RPG::Class
  161.  
  162. #===============================================================================
  163. class RPG::Actor < RPG::BaseItem
  164. #===============================================================================
  165. #---------------------------------------------------------------------------
  166. # Pi Variables
  167. #---------------------------------------------------------------------------
  168. attr_accessor :hidden_skill_types
  169. attr_accessor :hidden_skills
  170. #--------------------------------------------------------------------------
  171. # Load All Hidden Skills
  172. #--------------------------------------------------------------------------
  173. def load_skill_hide
  174. @hidden_skill_types = []
  175. @hidden_skills = []
  176. Unusable_Skill::Stype_id.each do |this|
  177. @hidden_skill_types << this
  178. end
  179. Unusable_Skill::Skill_id.each do |this|
  180. @hidden_skills << this
  181. end
  182. self.note.split(/[\r\n]+/).each do |line|
  183. case line
  184. when Unusable_Skill::Notetag[:types]
  185. @hidden_skill_types = []
  186. $1.scan(/\d+/).each { |num|
  187. @hidden_skill_types << num.to_i if num.to_i > 0 }
  188. when Unusable_Skill::Notetag[:skills]
  189. @hidden_skills = []
  190. $1.scan(/\d+/).each { |num|
  191. @hidden_skills << num.to_i if num.to_i > 0 }
  192. end
  193. end
  194. end
  195.  
  196. end # RPG::Actor
  197.  
  198. #===============================================================================
  199. class Game_Actor < Game_Battler
  200. #===============================================================================
  201. #---------------------------------------------------------------------------
  202. # Get hidden_skill_types
  203. #---------------------------------------------------------------------------
  204. def hidden_skill_types
  205. set = self.class.hidden_skill_types
  206. seB = actor.hidden_skill_types
  207. set = seB if set != seB && seB != Unusable_Skill::Stype_id
  208. set
  209. end
  210. #---------------------------------------------------------------------------
  211. # Get hidden_skills
  212. #---------------------------------------------------------------------------
  213. def hidden_skills
  214. set = self.class.hidden_skills
  215. seB = actor.hidden_skills
  216. set = seB if set != seB && seB != Unusable_Skill::Skill_id
  217. set
  218. end
  219.  
  220. end
  221.  
  222. #===============================================================================
  223. class Window_ActorCommand < Window_Command
  224. #===============================================================================
  225. #--------------------------------------------------------------------------
  226. # Add Skill Command to List
  227. #--------------------------------------------------------------------------
  228. def add_skill_commands
  229. @actor.added_skill_types.sort.each do |stype_id|
  230. next if @actor.hidden_skill_types.include?(stype_id)
  231. name = $data_system.skill_types[stype_id]
  232. add_command(name, :skill, true, stype_id)
  233. end
  234. end
  235.  
  236. end
  237.  
  238. #===============================================================================
  239. class Window_BattleSkill < Window_SkillList
  240. #===============================================================================
  241. #--------------------------------------------------------------------------
  242. # Include in Skill List?
  243. #--------------------------------------------------------------------------
  244. def include?(item)
  245. super && !@actor.hidden_skills.include?(item.id)
  246. end
  247.  
  248. end
  249.  
  250. #==============================================================================#
  251. # http://dekitarpg.wordpress.com/ #
  252. #==============================================================================#
  253. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement