Advertisement
Dekita

Untitled

Apr 19th, 2014
724
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.56 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Natures (personalities)
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  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[:Natures]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # o3/o4/2o14 - Started && Finished,
  21. #
  22. #===============================================================================
  23. # ☆ Introduction
  24. #-------------------------------------------------------------------------------
  25. # This script is to recreate the 'natures' feature from pokemon.
  26. #
  27. # The nature can change the stats your actors dramatically, by a percentage
  28. # rate. Natures are randomly chosen when an actor first joins the party.
  29. #
  30. # Obviously, I have included the ability for natures to control any other
  31. # stat you could have, including all stats created by my other scripts.
  32. #
  33. # Additionally, you can change the actors nature using simple script calls. :)
  34. #
  35. # Please be aware, this modified param_plus rather than param_base.
  36. # Therefore, my Stat control / element control etc.. scripts are required.
  37. #
  38. # This script was made to fully compliment all other stat modification scripts I
  39. # have written for the $D13x Engine.
  40. #
  41. #===============================================================================
  42. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  43. #===============================================================================
  44. # 1. You MUST give credit to "Dekita" !!
  45. # 2. You are NOT allowed to repost this script.(or modified versions)
  46. # 3. You are NOT allowed to convert this script.
  47. # 4. You are NOT allowed to use this script for Commercial games.
  48. # 5. ENJOY!
  49. #
  50. # "FINE PRINT"
  51. # By using this script you hereby agree to the above terms and conditions,
  52. # if any violation of the above terms occurs "legal action" may be taken.
  53. # Not understanding the above terms and conditions does NOT mean that
  54. # they do not apply to you.
  55. # If you wish to discuss the terms and conditions in further detail you can
  56. # contact me at http://dekitarpg.wordpress.com/
  57. #
  58. #===============================================================================
  59. # ☆ Instructions
  60. #-------------------------------------------------------------------------------
  61. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  62. #
  63. #===============================================================================
  64. # ☆ Script Calls
  65. #-------------------------------------------------------------------------------
  66. # ACTOR.reset_all_nature_data
  67. # ACTOR.change_nature(nature_id)
  68. # ACTOR.nature[:name]
  69. # ACTOR.nature[:mods]
  70. #
  71. # ACTOR = $game_actors[ACTOR_ID] OR $game_party.members[ID]
  72. # reset_all_nature_data :
  73. # Resets nature data and randomly determines new nature from possible list.
  74. #
  75. # change_nature(nature_id) :
  76. # Changes the actors nature to Type[id], providing Type[id] exists.
  77. #
  78. # nature[:name] :
  79. # Returns the name of this actors nature.
  80. #
  81. # nature[:mods] :
  82. # Returns the array of this actors nature modifications.
  83. # This would require some scripting knowledge to fully use.
  84. #
  85. # EXAMPLES::
  86. # $game_actors[1].change_nature(5)
  87. # would change actor 1's nature to nature Type[ 5 ]
  88. #
  89. # $game_party.leader.nature[:name]
  90. # would return the name of the party leaders nature.
  91. #
  92. #===============================================================================
  93. # ☆ HELP
  94. #-------------------------------------------------------------------------------
  95. # ALL rate's are 1.0 by default. Meaning that the stat will be multiplied
  96. # by 1.0.
  97. #
  98. #===============================================================================
  99. module Natures ; Type=[]# << DO NOT DELETE
  100. #===============================================================================
  101. #-----------------------------------------------------------------------------
  102. # Vocab
  103. #-----------------------------------------------------------------------------
  104. Vocab = 'Personality:'
  105. #-----------------------------------------------------------------------------
  106. # Vocab Text Color
  107. #-----------------------------------------------------------------------------
  108. Textc = Text_Color::White
  109. #-----------------------------------------------------------------------------
  110. # Icon = [icon index, icon hue]
  111. #-----------------------------------------------------------------------------
  112. Icon = [63,0]
  113. #-----------------------------------------------------------------------------
  114. # [:param , id, rate],
  115. # [:x_param , id, rate],
  116. # [:s_param , id, rate],
  117. # [:atk_ele , id, rate],
  118. # [:def_ele , id, rate],
  119. # [:spds_stat , id, rate]
  120. # [:atk_lvl , rate],
  121. # [:def_lvl , rate],
  122. # [:max_tp , rate],
  123. #-----------------------------------------------------------------------------
  124. # Adamant
  125. #-----------------------------------------------------------------------------
  126. Type[0] = {
  127. :name => 'Adamant',
  128. :mods => [
  129. [:param , 2, 1.1],
  130. [:param , 4, 0.9],
  131. ],# << :mods
  132. }# << Type[id]
  133. #-----------------------------------------------------------------------------
  134. # Bashfull
  135. #-----------------------------------------------------------------------------
  136. Type[1] = {
  137. :name => 'Bashfull',
  138. :mods => [
  139. ],# << :mods
  140. }# << Type[id]
  141. #-----------------------------------------------------------------------------
  142. # Bold
  143. #-----------------------------------------------------------------------------
  144. Type[2] = {
  145. :name => 'Bold',
  146. :mods => [
  147. [:param , 2, 0.9],
  148. [:param , 3, 1.1],
  149. ],# << :mods
  150. }# << Type[id]
  151. #-----------------------------------------------------------------------------
  152. # Brave
  153. #-----------------------------------------------------------------------------
  154. Type[3] = {
  155. :name => 'Brave',
  156. :mods => [
  157. [:param , 2, 1.1],
  158. [:param , 6, 0.9],
  159. ],# << :mods
  160. }# << Type[id]
  161. #-----------------------------------------------------------------------------
  162. # Calm
  163. #-----------------------------------------------------------------------------
  164. Type[4] = {
  165. :name => 'Calm',
  166. :mods => [
  167. [:param , 2, 0.9],
  168. [:param , 5, 1.1],
  169. ],# << :mods
  170. }# << Type[id]
  171. #-----------------------------------------------------------------------------
  172. # Careful
  173. #-----------------------------------------------------------------------------
  174. Type[5] = {
  175. :name => 'Careful',
  176. :mods => [
  177. [:param , 4, 0.9],
  178. [:param , 5, 1.1],
  179. ],# << :mods
  180. }# << Type[id]
  181. #-----------------------------------------------------------------------------
  182. # Docile
  183. #-----------------------------------------------------------------------------
  184. Type[6] = {
  185. :name => 'Docile',
  186. :mods => [
  187. ],# << :mods
  188. }# << Type[id]
  189. #-----------------------------------------------------------------------------
  190. # Gentle
  191. #-----------------------------------------------------------------------------
  192. Type[7] = {
  193. :name => 'Gentle',
  194. :mods => [
  195. [:param , 2, 0.9],
  196. [:param , 5, 1.1],
  197. ],# << :mods
  198. }# << Type[id]
  199. #-----------------------------------------------------------------------------
  200. # Hardy
  201. #-----------------------------------------------------------------------------
  202. Type[8] = {
  203. :name => 'Hardy',
  204. :mods => [
  205. ],# << :mods
  206. }# << Type[id]
  207. #-----------------------------------------------------------------------------
  208. # Hasty
  209. #-----------------------------------------------------------------------------
  210. Type[9] = {
  211. :name => 'Hasty',
  212. :mods => [
  213. [:param , 3, 0.9],
  214. [:param , 6, 1.1],
  215. ],# << :mods
  216. }# << Type[id]
  217. #-----------------------------------------------------------------------------
  218. # Impish
  219. #-----------------------------------------------------------------------------
  220. Type[10]= {
  221. :name => 'Impish',
  222. :mods => [
  223. [:param , 3, 1.1],
  224. [:param , 4, 0.9],
  225. ],# << :mods
  226. }# << Type[id]
  227. #-----------------------------------------------------------------------------
  228. # Jolly
  229. #-----------------------------------------------------------------------------
  230. Type[11]= {
  231. :name => 'Jolly',
  232. :mods => [
  233. [:param , 4, 0.9],
  234. [:param , 6, 1.1],
  235. ],# << :mods
  236. }# << Type[id]
  237. #-----------------------------------------------------------------------------
  238. # Lax
  239. #-----------------------------------------------------------------------------
  240. Type[12]= {
  241. :name => 'Lax',
  242. :mods => [
  243. [:param , 3, 1.1],
  244. [:param , 5, 0.9],
  245. ],# << :mods
  246. }# << Type[id]
  247. #-----------------------------------------------------------------------------
  248. # Lonely
  249. #-----------------------------------------------------------------------------
  250. Type[13] = {
  251. :name => 'Lonely',
  252. :mods => [
  253. [:param , 2, 1.1],
  254. [:param , 3, 0.9],
  255. ],# << :mods
  256. }# << Type[id]
  257. #-----------------------------------------------------------------------------
  258. # Mild
  259. #-----------------------------------------------------------------------------
  260. Type[14] = {
  261. :name => 'Mild',
  262. :mods => [
  263. [:param , 3, 0.9],
  264. [:param , 4, 1.1],
  265. ],# << :mods
  266. }# << Type[id]
  267. #-----------------------------------------------------------------------------
  268. # Modest
  269. #-----------------------------------------------------------------------------
  270. Type[15] = {
  271. :name => 'Modest',
  272. :mods => [
  273. [:param , 2, 0.9],
  274. [:param , 4, 1.1],
  275. ],# << :mods
  276. }# << Type[id]
  277. #-----------------------------------------------------------------------------
  278. # Naive
  279. #-----------------------------------------------------------------------------
  280. Type[16] = {
  281. :name => 'Naive',
  282. :mods => [
  283. [:param , 5, 0.9],
  284. [:param , 6, 1.1],
  285. ],# << :mods
  286. }# << Type[id]
  287. #-----------------------------------------------------------------------------
  288. # Naughty
  289. #-----------------------------------------------------------------------------
  290. Type[17] = {
  291. :name => 'Naughty',
  292. :mods => [
  293. [:param , 2, 1.1],
  294. [:param , 5, 0.9],
  295. ],# << :mods
  296. }# << Type[id]
  297. #-----------------------------------------------------------------------------
  298. # Quiet
  299. #-----------------------------------------------------------------------------
  300. Type[18] = {
  301. :name => 'Quiet',
  302. :mods => [
  303. [:param , 4, 1.1],
  304. [:param , 6, 0.9],
  305. ],# << :mods
  306. }# << Type[id]
  307. #-----------------------------------------------------------------------------
  308. # Quirky
  309. #-----------------------------------------------------------------------------
  310. Type[19] = {
  311. :name => 'Quirky',
  312. :mods => [
  313. ],# << :mods
  314. }# << Type[id]
  315. #-----------------------------------------------------------------------------
  316. # Rash
  317. #-----------------------------------------------------------------------------
  318. Type[20]= {
  319. :name => 'Rash',
  320. :mods => [
  321. [:param , 4, 1.1],
  322. [:param , 5, 0.9],
  323. ],# << :mods
  324. }# << Type[id]
  325. #-----------------------------------------------------------------------------
  326. # Relaxed
  327. #-----------------------------------------------------------------------------
  328. Type[21] = {
  329. :name => 'Relaxed',
  330. :mods => [
  331. [:param , 3, 1.1],
  332. [:param , 6, 0.9],
  333. ],# << :mods
  334. }# << Type[id]
  335. #-----------------------------------------------------------------------------
  336. # Sassy
  337. #-----------------------------------------------------------------------------
  338. Type[22]= {
  339. :name => 'Sassy',
  340. :mods => [
  341. [:param , 5, 1.1],
  342. [:param , 6, 0.9],
  343. ],# << :mods
  344. }# << Type[id]
  345. #-----------------------------------------------------------------------------
  346. # Serious
  347. #-----------------------------------------------------------------------------
  348. Type[23]= {
  349. :name => 'Serious',
  350. :mods => [
  351. ],# << :mods
  352. }# << Type[id]
  353. #-----------------------------------------------------------------------------
  354. # Timid
  355. #-----------------------------------------------------------------------------
  356. Type[24] = {
  357. :name => 'Timid',
  358. :mods => [
  359. [:param , 2, 0.9],
  360. [:param , 6, 1.1],
  361. ],# << :mods
  362. }# << Type[id]
  363.  
  364. #####################
  365. # CUSTOMISATION END #
  366. end #####################
  367. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  368. # #
  369. # http://dekitarpg.wordpress.com/ #
  370. # #
  371. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  372. #===============================================================================#
  373. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  374. # YES?\.\. #
  375. # OMG, REALLY? \| #
  376. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  377. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  378. #===============================================================================#
  379. module Vocanicon
  380. #===============================================================================
  381. #-----------------------------------------------------------------------------
  382. # Format = ["Name:" , Text_Color::White, icon, hue]
  383. #-----------------------------------------------------------------------------
  384. Nature = [Natures::Vocab,Natures::Textc,Natures::Icon[0],Natures::Icon[1]]
  385. end
  386. #===============================================================================
  387. class Game_Actor < Game_Battler
  388. #===============================================================================
  389. #-----------------------------------------------------------------------------
  390. #
  391. #-----------------------------------------------------------------------------
  392. alias :setup_natures :setup
  393. alias :parp_natures :param_plus
  394. alias :xpar_natures :xparam_plus if $D13x[:Stats_Control]
  395. alias :spar_natures :sparam_plus if $D13x[:Stats_Control]
  396. alias :atke_natures :atk_ele_plus if $D13x[:Elems_Control]
  397. alias :defe_natures :def_ele_plus if $D13x[:Elems_Control]
  398. alias :atdf_natures :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
  399. alias :spds_natures :spds_plus if $D13x[:ISPDS]
  400. alias :max_tp_plusn :max_tp_plus if $D13x[:TP_Control]
  401. #-----------------------------------------------------------------------------
  402. #
  403. #-----------------------------------------------------------------------------
  404. attr_accessor :nature
  405. #-----------------------------------------------------------------------------
  406. #
  407. #-----------------------------------------------------------------------------
  408. def setup(actor_id)
  409. reset_all_nature_data
  410. setup_natures(actor_id)
  411. end
  412. #-----------------------------------------------------------------------------
  413. #
  414. #-----------------------------------------------------------------------------
  415. def reset_all_nature_data
  416. setup_nature_data
  417. setup_nature_stat_mods
  418. set_nature_bonuses
  419. end
  420. #-----------------------------------------------------------------------------
  421. #
  422. #-----------------------------------------------------------------------------
  423. def setup_nature_data
  424. @nature = setup_random_nature
  425. end
  426. #-----------------------------------------------------------------------------
  427. #
  428. #-----------------------------------------------------------------------------
  429. def setup_random_nature
  430. modu = Natures::Type
  431. modu[rand modu.size]
  432. end
  433. #-----------------------------------------------------------------------------
  434. #
  435. #-----------------------------------------------------------------------------
  436. def setup_nature_stat_mods
  437. @nature_atl_dfl = [1.0] * 2
  438. @nature_param = [1.0] * 8
  439. @nature_xparam = [1.0] * 10
  440. @nature_sparam = [1.0] * 10
  441. @nature_atk_ele = [1.0] * $data_system.elements.size
  442. @nature_def_ele = [1.0] * $data_system.elements.size
  443. @nature_spds_stats = [1.0] * 8
  444. @nature_spds_stats = [1.0] * SPDS::Commands.size if $D13x[:ISPDS]
  445. @nature_max_tp = 1.0
  446. end
  447. #-----------------------------------------------------------------------------
  448. #
  449. #-----------------------------------------------------------------------------
  450. def change_nature(id)
  451. modu = Natures::Type[id]
  452. return unless modu
  453. @nature = modu
  454. setup_nature_stat_mods
  455. set_nature_bonuses
  456. end
  457. #-----------------------------------------------------------------------------
  458. # Get Added Value of Parameter
  459. #-----------------------------------------------------------------------------
  460. def param_plus(param_id)
  461. parp_natures(param_id) * @nature_param[param_id]
  462. end
  463. if $D13x[:Stats_Control]
  464. #---------------------------------------------------------------------------
  465. # Get Added Value of x-Parameter
  466. #---------------------------------------------------------------------------
  467. def xparam_plus(xparam_id)
  468. xpar_natures(xparam_id) * @nature_xparam[xparam_id]
  469. end
  470. #---------------------------------------------------------------------------
  471. # Get Added Value of s-Parameter
  472. #---------------------------------------------------------------------------
  473. def sparam_plus(sparam_id)
  474. spar_natures(sparam_id) * @nature_sparam[sparam_id]
  475. end
  476. end # if $D13x[:Stats_Control]
  477. if $D13x[:Elems_Control]
  478. #---------------------------------------------------------------------------
  479. # Get Added Value of def-Element
  480. #---------------------------------------------------------------------------
  481. def def_ele_plus(element_id)
  482. defe_natures(element_id) * @nature_def_ele[element_id]
  483. end
  484. #---------------------------------------------------------------------------
  485. # Get Added Value of atk-Element
  486. #---------------------------------------------------------------------------
  487. def atk_ele_plus(element_id)
  488. atke_natures(element_id) * @nature_atk_ele[element_id]
  489. end
  490. end # if $D13x[:Elems_Control]
  491. if $D13x[:Atk_Def_Lvs]
  492. #---------------------------------------------------------------------------
  493. # Atk Lv | Def Lv ++
  494. #---------------------------------------------------------------------------
  495. def atl_dfl_plus(id)
  496. atdf_natures(id) * @nature_atl_dfl[id]
  497. end
  498. end # if $D13x[:Atk_Def_Lvs]
  499. if $D13x[:ISPDS]
  500. #---------------------------------------------------------------------------
  501. # Get SPDS Stats Plus
  502. #---------------------------------------------------------------------------
  503. def spds_plus(id)
  504. spds_natures(id) * @nature_spds_stats[id]
  505. end
  506. end # if $D13x[:ISPDS]
  507. if $D13x[:TP_Control]
  508. #---------------------------------------------------------------------------
  509. # Atk Lv | Def Lv ++
  510. #---------------------------------------------------------------------------
  511. def max_tp_plus
  512. (max_tp_plusn * @nature_max_tp).to_i
  513. end
  514. end # if $D13x[:TP_Control]
  515. #-----------------------------------------------------------------------------
  516. # Set Nature Bonuses
  517. #-----------------------------------------------------------------------------
  518. def set_nature_bonuses
  519. @nature[:mods].each do |i|
  520. case i[0]
  521. when :param then @nature_param [i[1]] = i[2] if $D13x[:Stats_Control]
  522. when :x_param then @nature_xparam [i[1]] = i[2] if $D13x[:Stats_Control]
  523. when :s_param then @nature_sparam [i[1]] = i[2] if $D13x[:Stats_Control]
  524. when :atk_ele then @nature_atk_ele[i[1]] = i[2] if $D13x[:Elems_Control]
  525. when :def_ele then @nature_def_ele[i[1]] = i[2] if $D13x[:Elems_Control]
  526. when :atk_lvl then @nature_atl_dfl[0] = i[1] if $D13x[:Atk_Def_Lvs]
  527. when :def_lvl then @nature_atl_dfl[1] = i[1] if $D13x[:Atk_Def_Lvs]
  528. when :spds_stat then @nature_spds_stats[i[1]] = i[2] if $D13x[:ISPDS]
  529. when :max_tp then @nature_max_tp = i[1] if $D13x[:TP_Control]
  530. end
  531. end
  532. end
  533. end
  534. #==============================================================================#
  535. # http://dekitarpg.wordpress.com/ #
  536. #==============================================================================#
  537. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement