Advertisement
Dekita

hidden skills v1.1

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