Advertisement
Dekita

learn skill reqs 2.0

Mar 29th, 2014
1,113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.05 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Learn Skill Requirements
  5. # -- Author : Dekita
  6. # -- Version : 2.0
  7. # -- Level : Easy / Normal
  8. # -- Requires : $D13x - Statistic Control
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Skill_Reqs]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 22/o2/2o14 - Compatibility, ($D13x Skill Upgrade)
  21. # 22/o5/2o13 - Small Temp Bugfix, (constant reducing exp)
  22. # 21/o5/2o13 - Compatability, ($D13x ISPDS)
  23. # 2o/o5/2o13 - Compatability, ($D13x Atk & Def Lvs)
  24. # 19/o5/2o13 - Small Re-write, (v1.6 details below)
  25. # 17/o5/2o13 - Small Update,
  26. # 14/o5/2o13 - Update, (Skill/Skill Level Requirements)
  27. # - Bugfix, (eval notetag)
  28. # 26/o3/2o13 - Compatibility, (Elements Control)
  29. # 23/o3/2o13 - Bugfix, (forgetting skills when negative HRG/MRG/TRG)
  30. # 21/o3/2o13 - Fixed typo in notetag info section,
  31. # 13/o3/2o13 - Finished,
  32. # 1o/o3/2o13 - Started
  33. #
  34. #===============================================================================
  35. # ☆ Introduction
  36. #-------------------------------------------------------------------------------
  37. # This script enables additional requirements for learning skills.
  38. # other than the default level requirement, you are now allowed
  39. # requirements based on almost all other statistics,
  40. # Such as param / x-param / s-param / atk element rate / def element rate :p
  41. # simply use notetags in the CLASS Skill Learn Notebox !!
  42. #
  43. # You can also allow for skills to be forgotten if the requirements
  44. # are no longer met.
  45. # eg. removed equipment / leveled down ...
  46. #
  47. # Note : all param requirements must be an integer value, eg. 1, 2, 3, 4
  48. # all x/sparam requirements must be a float value, eg. 0.1, 0.5, 1.6
  49. #
  50. # v1.6+ completely changes the frequency of which skills are learned,
  51. # instead of skills being learned/forgot upon level up/down,
  52. # they are now refreshed constantly (every few seconds)
  53. # This is to enable skills being learned as soon as their requirements are met,
  54. # and forgotten as soon as they are not.
  55. # Also added a FPS fix for this feature, as constantly checking params/xparams
  56. # sparams/atk ele/def ele causes SEVERE FPS drop (60 > 52(ish) every few seconds)
  57. #
  58. #===============================================================================
  59. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  60. #===============================================================================
  61. # 1. You MUST give credit to "Dekita" !!
  62. # 2. You are NOT allowed to repost this script.(or modified versions)
  63. # 3. You are NOT allowed to convert this script.
  64. # 4. You are NOT allowed to use this script for Commercial games.
  65. # 5. ENJOY!
  66. #
  67. # "FINE PRINT"
  68. # By using this script you hereby agree to the above terms and conditions,
  69. # if any violation of the above terms occurs "legal action" may be taken.
  70. # Not understanding the above terms and conditions does NOT mean that
  71. # they do not apply to you.
  72. # If you wish to discuss the terms and conditions in further detail you can
  73. # contact me at http://dekitarpg.wordpress.com/
  74. #
  75. #===============================================================================
  76. # ☆ Instructions
  77. #-------------------------------------------------------------------------------
  78. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  79. # Place Under My $D13x - Staistic Control Script.
  80. #
  81. #===============================================================================
  82. # ☆ Notetags ( default )
  83. # For use with Class Skill Learn noteboxes only !
  84. #-------------------------------------------------------------------------------
  85. # <stat req: value>
  86. # stat req = mhp, mmp, agi, luk, cri ect...
  87. # value = the value for that skill, for that class
  88. # e.g
  89. # <agi req: 4> would make the skill unlearnable until the actor has 4 agi
  90. # <cri req: 0.04> unlearnable until 4% crit rate
  91. #
  92. # you can also use switches, variables and even define your own code for
  93. # requisites using the eval method.
  94. #
  95. # v1.2 introduces the ability to have elemental attack and defence requirements
  96. # IF used with my $D13x Elements Control script.
  97. # The notetags for these requirements are :
  98. # <atk ele req: id, value>
  99. # <def ele req: id, value>
  100. #
  101. # v1.3 introduces the ability to have skill / skill level requirements.
  102. # eg.. need skill 5 before learning skill 6
  103. # or need skill 6 @ level 10 before learning skill 7 ect..
  104. # This could of course be done by using the <eval: X> notetag like this...
  105. # <eval req: skills_lv(6) < 10 > (TESTED and works 100%)
  106. #
  107. # NOTE:
  108. # eval notetag return FALSE if eval condition is TRUE,
  109. # eg.. the above notetag would return false if the skill 6's level is < 10
  110. #
  111. # you could also do things like equip requirements or actor name requirements
  112. # or playtime requirements or whatever by using the eval notetag,
  113. # this, of course, requires basic scripting knowledge.
  114. #
  115. #-------------------------------------------------------------------------------
  116. # :: NOTICE ::
  117. #-------------------------------------------------------------------------------
  118. # From v2.0 the above notetags are also able to be used in skill noteboxes.
  119. # This is only used for the $D13x Skill Upgrade script system.
  120. # you use the notetags within the skill notebox, then when you attempt to
  121. # upgrade the skill, it checks if you meet the requirements before allowing
  122. # you to proceed. you can also use a notetag to change the level requirement.
  123. # the notetag is below:
  124. #
  125. # <lv req: X>
  126. # X = level actor must be to learn the skill.
  127. #
  128. #===============================================================================
  129. # ☆ HELP
  130. #-------------------------------------------------------------------------------
  131. # PARAMS :
  132. # mhp, mmp, atk, def, mat, mdf, agi, luk
  133. # XPARAMS
  134. # hit, eva, cri, cev, mev, mrf, cnt, hrg, mrg, trg
  135. # SPARAMS
  136. # tgr, grd, rec, pha, mcr, tcr, pdr, mdr, fdr, exr
  137. #
  138. #-------------------------------------------------------------------------------
  139. # Remember :
  140. # All Params work with integer values, eg. 1, 5, 123, 653, 198123 .
  141. # All x/s-Params work with float values, eg. 1.0, 0.5, 0.1, 0.05, 0.01 .
  142. # All Elemental Values work with float values, eg. 1.0, 0.5, 0.1, 0.05, 0.01 .
  143. # 1.0 = 100%, 0.01 = 1%,
  144. #
  145. # ALSO:
  146. # If you want to have multiple requirements for learning skills,
  147. # simply seperate the notetags with \n
  148. # this will trigger a new note to be read :)
  149. #===============================================================================
  150. module Skill_Reqz
  151. #===============================================================================
  152.  
  153. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  154. # ☆ General Settings
  155. #--------------------------------------------------------------------------
  156. # Remove skills if requirement are no longer met.
  157. Remove_Skills = false
  158.  
  159. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  160. # ☆ Notetag Settings
  161. #--------------------------------------------------------------------------
  162. Notes={}
  163. Notes[:mhp] = /<mhp req:(.*)>/i
  164. Notes[:mmp] = /<mmp req:(.*)>/i
  165. Notes[:atk] = /<atk req:(.*)>/i
  166. Notes[:def] = /<def req:(.*)>/i
  167. Notes[:mat] = /<mat req:(.*)>/i
  168. Notes[:mdf] = /<mdf req:(.*)>/i
  169. Notes[:agi] = /<agi req:(.*)>/i
  170. Notes[:luk] = /<luk req:(.*)>/i
  171. Notes[:hit] = /<hit req:(.*)>/i
  172. Notes[:eva] = /<eva req:(.*)>/i
  173. Notes[:cri] = /<cri req:(.*)>/i
  174. Notes[:cev] = /<cev req:(.*)>/i
  175. Notes[:mev] = /<mev req:(.*)>/i
  176. Notes[:mrf] = /<mrf req:(.*)>/i
  177. Notes[:cnt] = /<cnt req:(.*)>/i
  178. Notes[:hrg] = /<hrg req:(.*)>/i
  179. Notes[:mrg] = /<mrg req:(.*)>/i
  180. Notes[:trg] = /<trg req:(.*)>/i
  181. Notes[:tgr] = /<tgr req:(.*)>/i
  182. Notes[:grd] = /<grd req:(.*)>/i
  183. Notes[:rec] = /<rec req:(.*)>/i
  184. Notes[:pha] = /<pha req:(.*)>/i
  185. Notes[:mcr] = /<mcr req:(.*)>/i
  186. Notes[:tcr] = /<tcr req:(.*)>/i
  187. Notes[:pdr] = /<pdr req:(.*)>/i
  188. Notes[:mdr] = /<mdr req:(.*)>/i
  189. Notes[:fdr] = /<fdr req:(.*)>/i
  190. Notes[:exr] = /<exr req:(.*)>/i
  191. Notes[:swi] = /<switch req:(.*)>/i # <switch req: switch_id>
  192. Notes[:var] = /<variable req:(.*),(.*)>/i # <variable req: vari_id, value>
  193. Notes[:eval]= /<eval req:(.*)>/i # <eval req: 'string of code to be evaluated'>
  194. Notes[:atk_ele]= /<atk ele req:(.*),(.*)>/
  195. Notes[:def_ele]= /<def ele req:(.*),(.*)>/
  196. Notes[:atk_lvl]= /<atk lvl req:(.*)>/
  197. Notes[:def_lvl]= /<def lvl req:(.*)>/
  198. Notes[:skills] = [/<skill req:(.*),(.*)>/i,/<skill req:(.*)>/i]
  199. Notes[:spds_stat] = /<spds stat req:(.*),(.*)>/i # <spds stat req: stat id, val>
  200.  
  201. #####################
  202. # CUSTOMISATION END #
  203. end #####################
  204. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  205. # #
  206. # http://dekitarpg.wordpress.com/ #
  207. # #
  208. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  209. # The following code is protected under the 2013 Dekita Data Protection Act. #
  210. # Ie. The “Do Not Fucking Look” Law. #
  211. # Breaking This One And Only Rule WILL Result in SEVERE BRAIN FREEZE. #
  212. # That is all ! #
  213. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  214. #===============================================================================
  215. module DataManager
  216. #===============================================================================
  217. #--------------------------------------------------------------------------
  218. # Alias List
  219. #--------------------------------------------------------------------------
  220. class << self
  221. alias :load_database_skillreqz :load_database
  222. end
  223. #--------------------------------------------------------------------------
  224. # Load Database
  225. #--------------------------------------------------------------------------
  226. def self.load_database
  227. load_database_skillreqz
  228. load_notetags_skillreqz
  229. end
  230. #--------------------------------------------------------------------------
  231. # Load Notetags
  232. #--------------------------------------------------------------------------
  233. def self.load_notetags_skillreqz
  234. for obj in $data_classes
  235. next if obj.nil?
  236. obj.load_skill_requirements
  237. end
  238. for obj in $data_skills
  239. next if obj.nil?
  240. obj.load_skill_requirements
  241. end
  242. end
  243.  
  244. end # DataManager
  245.  
  246. #===============================================================================
  247. class RPG::Class < RPG::BaseItem
  248. #===============================================================================
  249. #--------------------------------------------------------------------------
  250. # Load All Learnable Skills Requirements
  251. #--------------------------------------------------------------------------
  252. def load_skill_requirements
  253. @learnings.each { |l| l.load_skill_requirements }
  254. end
  255.  
  256. end # RPG::Class
  257.  
  258. #===============================================================================
  259. class RPG::Class::Learning
  260. #===============================================================================
  261. #--------------------------------------------------------------------------
  262. # Pi Variables
  263. #--------------------------------------------------------------------------
  264. attr_accessor :param_req
  265. attr_accessor :xpars_req
  266. attr_accessor :spars_req
  267. attr_accessor :swtch_req
  268. attr_accessor :varis_req
  269. attr_accessor :evals_req
  270. attr_accessor :atk_ele_req
  271. attr_accessor :def_ele_req
  272. attr_accessor :atl_dfl_req
  273. attr_accessor :skill_req
  274. attr_accessor :spds_stats_req
  275. #--------------------------------------------------------------------------
  276. # Load All Skill Requirements
  277. #--------------------------------------------------------------------------
  278. def load_skill_requirements
  279. @param_req = [0] * 8
  280. @xpars_req = [0] * 10
  281. @spars_req = [0] * 10
  282. @swtch_req = []
  283. @varis_req = []
  284. @evals_req = []
  285. @skill_req = []
  286. @atk_ele_req = [-2.0] * $data_system.elements.size
  287. @def_ele_req = [-2.0] * $data_system.elements.size
  288. @atl_dfl_req = [0] * 2
  289. @spds_stats_req = [0] * SPDS::Commands.size if $D13x[:ISPDS]
  290. 3.times {|i| @xpars_req[i+7] = -1.0 }
  291. self.note.split(/\\n/i).each do |line|
  292. case line
  293. when Skill_Reqz::Notes[:mhp] then @param_req[0] = $1.to_i
  294. when Skill_Reqz::Notes[:mmp] then @param_req[1] = $1.to_i
  295. when Skill_Reqz::Notes[:atk] then @param_req[2] = $1.to_i
  296. when Skill_Reqz::Notes[:def] then @param_req[3] = $1.to_i
  297. when Skill_Reqz::Notes[:mat] then @param_req[4] = $1.to_i
  298. when Skill_Reqz::Notes[:mdf] then @param_req[5] = $1.to_i
  299. when Skill_Reqz::Notes[:agi] then @param_req[6] = $1.to_i
  300. when Skill_Reqz::Notes[:luk] then @param_req[7] = $1.to_i
  301. when Skill_Reqz::Notes[:hit] then @xpars_req[0] = $1.to_f
  302. when Skill_Reqz::Notes[:eva] then @xpars_req[1] = $1.to_f
  303. when Skill_Reqz::Notes[:cri] then @xpars_req[2] = $1.to_f
  304. when Skill_Reqz::Notes[:cev] then @xpars_req[3] = $1.to_f
  305. when Skill_Reqz::Notes[:mev] then @xpars_req[4] = $1.to_f
  306. when Skill_Reqz::Notes[:mrf] then @xpars_req[5] = $1.to_f
  307. when Skill_Reqz::Notes[:cnt] then @xpars_req[6] = $1.to_f
  308. when Skill_Reqz::Notes[:hrg] then @xpars_req[7] = $1.to_f
  309. when Skill_Reqz::Notes[:mrg] then @xpars_req[8] = $1.to_f
  310. when Skill_Reqz::Notes[:trg] then @xpars_req[9] = $1.to_f
  311. when Skill_Reqz::Notes[:tgr] then @spars_req[0] = $1.to_f
  312. when Skill_Reqz::Notes[:grd] then @spars_req[1] = $1.to_f
  313. when Skill_Reqz::Notes[:rec] then @spars_req[2] = $1.to_f
  314. when Skill_Reqz::Notes[:pha] then @spars_req[3] = $1.to_f
  315. when Skill_Reqz::Notes[:mcr] then @spars_req[4] = $1.to_f
  316. when Skill_Reqz::Notes[:tcr] then @spars_req[5] = $1.to_f
  317. when Skill_Reqz::Notes[:pdr] then @spars_req[6] = $1.to_f
  318. when Skill_Reqz::Notes[:mdr] then @spars_req[7] = $1.to_f
  319. when Skill_Reqz::Notes[:fdr] then @spars_req[8] = $1.to_f
  320. when Skill_Reqz::Notes[:exr] then @spars_req[9] = $1.to_f
  321. when Skill_Reqz::Notes[:swi] then @swtch_req << $1.to_i
  322. when Skill_Reqz::Notes[:var] then @varis_req << [$1.to_i,$2.to_i]
  323. when Skill_Reqz::Notes[:eval] then @evals_req << $1.to_s
  324. when Skill_Reqz::Notes[:atk_ele] then @atk_ele_req[$1.to_i] = $2.to_f
  325. when Skill_Reqz::Notes[:def_ele] then @def_ele_req[$1.to_i] = $2.to_f
  326. when Skill_Reqz::Notes[:atk_lvl] then @atl_dfl_req[0] = $1.to_f
  327. when Skill_Reqz::Notes[:def_lvl] then @atl_dfl_req[1] = $1.to_f
  328. when Skill_Reqz::Notes[:skills][0] then @skill_req << [$1.to_i, $2.to_i]
  329. when Skill_Reqz::Notes[:skills][1] then @skill_req << [$1.to_i, 1]
  330. when Skill_Reqz::Notes[:spds_stat] then @spds_stats_req[$1.to_i] = $2.to_i
  331. end
  332. end
  333. end
  334.  
  335. end # RPG::Class::Learning
  336.  
  337. #===============================================================================
  338. class RPG::Skill < RPG::UsableItem
  339. #===============================================================================
  340. #--------------------------------------------------------------------------
  341. # Pi Variables
  342. #--------------------------------------------------------------------------
  343. attr_accessor :param_req
  344. attr_accessor :xpars_req
  345. attr_accessor :spars_req
  346. attr_accessor :swtch_req
  347. attr_accessor :varis_req
  348. attr_accessor :evals_req
  349. attr_accessor :atk_ele_req
  350. attr_accessor :def_ele_req
  351. attr_accessor :atl_dfl_req
  352. attr_accessor :skill_req
  353. attr_accessor :spds_stats_req
  354. attr_accessor :level_req
  355. #--------------------------------------------------------------------------
  356. # Load All Skill Requirements
  357. #--------------------------------------------------------------------------
  358. def load_skill_requirements
  359. @param_req = [0] * 8
  360. @xpars_req = [0] * 10
  361. @spars_req = [0] * 10
  362. @swtch_req = []
  363. @varis_req = []
  364. @evals_req = []
  365. @skill_req = []
  366. @atk_ele_req = [-2.0] * $data_system.elements.size
  367. @def_ele_req = [-2.0] * $data_system.elements.size
  368. @atl_dfl_req = [0] * 2
  369. @spds_stats_req = [0] * SPDS::Commands.size if $D13x[:ISPDS]
  370. 3.times {|i| @xpars_req[i+7] = -1.0 }
  371. @level_req = 1
  372. self.note.split(/[\r\n]+/).each do |line|
  373. case line
  374. when Skill_Reqz::Notes[:mhp] then @param_req[0] = $1.to_i
  375. when Skill_Reqz::Notes[:mmp] then @param_req[1] = $1.to_i
  376. when Skill_Reqz::Notes[:atk] then @param_req[2] = $1.to_i
  377. when Skill_Reqz::Notes[:def] then @param_req[3] = $1.to_i
  378. when Skill_Reqz::Notes[:mat] then @param_req[4] = $1.to_i
  379. when Skill_Reqz::Notes[:mdf] then @param_req[5] = $1.to_i
  380. when Skill_Reqz::Notes[:agi] then @param_req[6] = $1.to_i
  381. when Skill_Reqz::Notes[:luk] then @param_req[7] = $1.to_i
  382. when Skill_Reqz::Notes[:hit] then @xpars_req[0] = $1.to_f
  383. when Skill_Reqz::Notes[:eva] then @xpars_req[1] = $1.to_f
  384. when Skill_Reqz::Notes[:cri] then @xpars_req[2] = $1.to_f
  385. when Skill_Reqz::Notes[:cev] then @xpars_req[3] = $1.to_f
  386. when Skill_Reqz::Notes[:mev] then @xpars_req[4] = $1.to_f
  387. when Skill_Reqz::Notes[:mrf] then @xpars_req[5] = $1.to_f
  388. when Skill_Reqz::Notes[:cnt] then @xpars_req[6] = $1.to_f
  389. when Skill_Reqz::Notes[:hrg] then @xpars_req[7] = $1.to_f
  390. when Skill_Reqz::Notes[:mrg] then @xpars_req[8] = $1.to_f
  391. when Skill_Reqz::Notes[:trg] then @xpars_req[9] = $1.to_f
  392. when Skill_Reqz::Notes[:tgr] then @spars_req[0] = $1.to_f
  393. when Skill_Reqz::Notes[:grd] then @spars_req[1] = $1.to_f
  394. when Skill_Reqz::Notes[:rec] then @spars_req[2] = $1.to_f
  395. when Skill_Reqz::Notes[:pha] then @spars_req[3] = $1.to_f
  396. when Skill_Reqz::Notes[:mcr] then @spars_req[4] = $1.to_f
  397. when Skill_Reqz::Notes[:tcr] then @spars_req[5] = $1.to_f
  398. when Skill_Reqz::Notes[:pdr] then @spars_req[6] = $1.to_f
  399. when Skill_Reqz::Notes[:mdr] then @spars_req[7] = $1.to_f
  400. when Skill_Reqz::Notes[:fdr] then @spars_req[8] = $1.to_f
  401. when Skill_Reqz::Notes[:exr] then @spars_req[9] = $1.to_f
  402. when Skill_Reqz::Notes[:swi] then @swtch_req << $1.to_i
  403. when Skill_Reqz::Notes[:var] then @varis_req << [$1.to_i,$2.to_i]
  404. when Skill_Reqz::Notes[:eval] then @evals_req << $1.to_s
  405. when Skill_Reqz::Notes[:atk_ele] then @atk_ele_req[$1.to_i] = $2.to_f
  406. when Skill_Reqz::Notes[:def_ele] then @def_ele_req[$1.to_i] = $2.to_f
  407. when Skill_Reqz::Notes[:atk_lvl] then @atl_dfl_req[0] = $1.to_f
  408. when Skill_Reqz::Notes[:def_lvl] then @atl_dfl_req[1] = $1.to_f
  409. when Skill_Reqz::Notes[:skills][0] then @skill_req << [$1.to_i, $2.to_i]
  410. when Skill_Reqz::Notes[:skills][1] then @skill_req << [$1.to_i, 1]
  411. when Skill_Reqz::Notes[:spds_stat] then @spds_stats_req[$1.to_i] = $2.to_i
  412. when /<lv req:(.*)>/i then @level_req = $1.to_i
  413. end
  414. end
  415. end
  416.  
  417. end # RPG::Skill
  418.  
  419. #===============================================================================
  420. class Game_BattlerBase
  421. #===============================================================================
  422. #--------------------------------------------------------------------------
  423. # Alias List
  424. #--------------------------------------------------------------------------
  425. alias :sd13x_FPS_fixx_II :initialize
  426. alias :param_FPS_fix_II :param
  427. alias :xparam_FPS_fix_II :xparam if $D13x[:Stats_Control]
  428. alias :sparam_FPS_fix_II :sparam if $D13x[:Stats_Control]
  429. alias :atk_ele_FPS_fix_II :atk_element_rate if $D13x[:Elems_Control]
  430. alias :def_ele_FPS_fix_II :element_rate if $D13x[:Elems_Control]
  431. #--------------------------------------------------------------------------
  432. # Initialize Data
  433. #--------------------------------------------------------------------------
  434. def initialize
  435. @param_fix_II = [0] * 8
  436. @xparam_fix_II = [0] * 10
  437. @sparam_fix_II = [0] * 10
  438. @def_ele_fix_II = [0] * $data_system.elements.size
  439. @atk_ele_fix_II = [0] * $data_system.elements.size
  440. sd13x_FPS_fixx_II
  441. end
  442. #--------------------------------------------------------------------------
  443. # Get Parameter
  444. #--------------------------------------------------------------------------
  445. def param(param_id)
  446. @param_fix_II[param_id] = param_FPS_fix_II(param_id)
  447. @param_fix_II[param_id]
  448. end
  449. if $D13x[:Stats_Control]
  450. #--------------------------------------------------------------------------
  451. # Get Ex-Parameter
  452. #--------------------------------------------------------------------------
  453. def xparam(xparam_id)
  454. @xparam_fix_II[xparam_id] = xparam_FPS_fix_II(xparam_id)
  455. @xparam_fix_II[xparam_id]
  456. end
  457. #--------------------------------------------------------------------------
  458. # Get Sp-Parameter
  459. #--------------------------------------------------------------------------
  460. def sparam(sparam_id)
  461. @sparam_fix_II[sparam_id] = sparam_FPS_fix_II(sparam_id)
  462. @sparam_fix_II[sparam_id]
  463. end
  464. end
  465. if $D13x[:Elems_Control]
  466. #--------------------------------------------------------------------------
  467. # Get Def Element Rate
  468. #--------------------------------------------------------------------------
  469. def element_rate(element_id)
  470. @def_ele_fix_II[element_id] = def_ele_FPS_fix_II(element_id)
  471. @def_ele_fix_II[element_id]
  472. end
  473. #--------------------------------------------------------------------------
  474. # Get Atk Element Rate
  475. #--------------------------------------------------------------------------
  476. def atk_element_rate(element_id)
  477. @atk_ele_fix_II[element_id] = atk_ele_FPS_fix_II(element_id)
  478. @atk_ele_fix_II[element_id]
  479. end
  480. end
  481.  
  482. end # class Game_BattlerBase
  483.  
  484. #===============================================================================
  485. class Game_Actor < Game_Battler
  486. #===============================================================================
  487. #--------------------------------------------------------------------------
  488. # Alias List
  489. #--------------------------------------------------------------------------
  490. alias :refresh_SKILL_DATA :refresh
  491. alias :lv_dwn_xtra_reqzz__sD13x :lv_down_extra
  492. alias :ls_reqzz__sD13x :learn_skill_conditions_met?
  493. #--------------------------------------------------------------------------
  494. # Refresh
  495. #--------------------------------------------------------------------------
  496. def refresh
  497. refresh_SKILL_DATA
  498. check_skill_data
  499. end
  500. #--------------------------------------------------------------------------
  501. # Check Skills Data
  502. #--------------------------------------------------------------------------
  503. def check_skill_data
  504. skill = skills.clone
  505. self.class.learnings.each do |lning|
  506. can_learn = learn_skill_conditions_met?(lning)
  507. if Skill_Reqz::Remove_Skills && (can_learn == false)
  508. forget_skill(lning.skill_id)
  509. end
  510. learn_skill( lning.skill_id) if can_learn
  511. end
  512. if skill != skills
  513. new_skills = (skills - skill)
  514. new_skills.each do |skll|
  515. $game_message.add(sprintf(Vocab::ObtainSkill, skll.name))
  516. end
  517. old_skills = (skill - skills)
  518. old_skills.each do |skll|
  519. $game_message.add(sprintf(Vocab::ForgetSkill, skll.name))
  520. end
  521. end
  522. end
  523. #--------------------------------------------------------------------------
  524. # Get Learning Skill Conditions
  525. #--------------------------------------------------------------------------
  526. def learn_skill_conditions_met?(learning, mult = 1.0 )
  527. 8.times do |i|
  528. return false if @param_fix_II[i] < (learning.param_req[i] * mult).to_i
  529. end
  530. if $D13x[:Stats_Control]
  531. 10.times do |i|
  532. return false if @xparam_fix_II[i] < (learning.xpars_req[i] * mult).to_f
  533. return false if @sparam_fix_II[i] < (learning.spars_req[i] * mult).to_f
  534. end
  535. end
  536. learning.swtch_req.each do |switch|
  537. return false if !$game_switches[ switch ]
  538. end
  539. learning.varis_req.each do |vari|
  540. return false if $game_variables[ vari[0] ] < (vari[1] * mult).to_i
  541. end
  542. learning.evals_req.each do |evl|
  543. return false if eval( evl.to_s )
  544. end
  545. if $D13x[:Elems_Control]
  546. $data_system.elements.size.times do |i|
  547. return false if @def_ele_fix_II[i] < learning.def_ele_req[i]
  548. return false if @atk_ele_fix_II[i] < learning.atk_ele_req[i]
  549. end
  550. end
  551. if $D13x[:Atk_Def_Lvs]
  552. 2.times do |i|
  553. return false if @atl_dfl_prefix[i] < learning.atl_dfl_req[i]
  554. end
  555. end
  556. if $D13x[:ISPDS]
  557. SPDS::Commands.each do |i|
  558. return false if parent_stat(i) < learning.spds_stats_req[i]
  559. end
  560. end
  561. learning.skill_req.each do |skil|
  562. return false if !skills.include?($data_skills[skil[0]])
  563. return false if skills_lv(skil[0]) < skil[1] if $D13x[:Skill_Lv]
  564. end
  565. return ls_reqzz__sD13x(learning, mult)
  566. end
  567.  
  568. end # Game_Actor
  569.  
  570. #==============================================================================#
  571. # http://dekitarpg.wordpress.com/ #
  572. #==============================================================================#
  573. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement