Advertisement
Dekita

hidden skills v1.0

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