Advertisement
Guest User

Scene_Ability (complete script)

a guest
Sep 21st, 2015
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 49.15 KB | None | 0 0
  1. # Ability Menu by Arttroy (advised and corrected by Estheone)
  2. # Contact on http://www.rpg-maker.fr/index.php?page=membre&id=22277
  3. #
  4. # Instructions :
  5. #
  6. # * Modification of skills obtained and their level :
  7. #
  8. # Line 90 :
  9. # @ability_new_skills_id = [[3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
  10. #
  11. # The id of skills matches that of the database, modify it as you want
  12. #
  13. # Modification of the level when skill will be obtained
  14. #
  15. # Line 91 :
  16. # @ability_new_skills_level = [[3, 6, 10], [3, 10, 30], [3, 10, 30], [3, 10, 30]]
  17. #
  18. # You can modify the level of category when skill will be obtained.
  19. #
  20. # These two lines are matching together, if you want to add a skill you must also modify the line for the level
  21. #
  22. # * Modification of the actor parameters :
  23. #
  24. # Line 92 :
  25. # @augmentation = [0, 0, 0, 0, 0, 0, 0, 0]
  26. #
  27. # Read this like :
  28. # @augmentation = [HP, MP, Atk, Def, Mgi, M.def, Agi, Luk]
  29. # You will have to modify the values of the method addedstats_calculation (Line 123)
  30. #
  31. # @augmentation[2] = Random.new.rand(3..8)
  32. #
  33. # You can modify the values of random. At the same time modify the display values
  34. # from the line 677 (def refresh of the Scene_Ability).
  35. #
  36. #
  37. # If you want to modify the parameter growth
  38. # you will have to change the display of contents for the adds. I advise not to do this if you
  39. # don't know how to do this.
  40. #
  41. #
  42. # Do not forget to insert images in the folder Pictures
  43.  
  44. #==============================================================================
  45. # ** Game_Temp
  46. #------------------------------------------------------------------------------
  47. # This class handles temporary data that is not included with save data.
  48. # The instance of this class is referenced by $game_temp.
  49. #==============================================================================
  50.  
  51. class Game_Temp
  52.  
  53. #--------------------------------------------------------------------------
  54. # * Public Instance Variables
  55. #--------------------------------------------------------------------------
  56. attr_accessor :ability_index # Index for ability menu
  57.  
  58. #--------------------------------------------------------------------------
  59. # * Aliasing method initialize
  60. #--------------------------------------------------------------------------
  61. alias ability_initialize initialize
  62. def initialize
  63. @ability_index = 0
  64. ability_initialize
  65. end
  66. end
  67.  
  68. #==============================================================================
  69. # ** Game_Actor
  70. #------------------------------------------------------------------------------
  71. # This class handles actors. It is used within the Game_Actors class
  72. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  73. #==============================================================================
  74.  
  75. class Game_Actor < Game_Battler
  76.  
  77. attr_reader :ability_level # for ability level
  78. attr_reader :ability_points # for new skill by levelling ability
  79. attr_reader :ability_new_skills_id # for new skill by levelling ability
  80. attr_reader :ability_new_skills_level # required level for new skills
  81. attr_reader :augmentation # for added stats by levelling ability
  82.  
  83. #--------------------------------------------------------------------------
  84. # * Aliasing method setup(actor_id)
  85. #--------------------------------------------------------------------------
  86. alias ability_setup setup
  87. def setup(actor_id)
  88. @ability_level = [0, 0, 0, 0]
  89. @ability_points = 0
  90. @ability_new_skills_id = [[3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
  91. @ability_new_skills_level = [[3, 6, 10], [3, 10, 30], [3, 10, 30], [3, 10, 30]]
  92. @augmentation = [0, 0, 0, 0, 0, 0, 0, 0]
  93. ability_setup(actor_id)
  94. end
  95.  
  96. #--------------------------------------------------------------------------
  97. # * Check if ability_level is equal to skill_level - 1
  98. #--------------------------------------------------------------------------
  99. def check_ability_skills_learning(n)
  100. level = @ability_level[n]
  101. for i in 0...@ability_new_skills_id[n].size
  102. required_level = @ability_new_skills_level[n][i]
  103. learn_skill(@ability_new_skills_id[n][i]) if level >= required_level
  104. end
  105. end
  106.  
  107. #--------------------------------------------------------------------------
  108. # * Ability Maximum Level
  109. #--------------------------------------------------------------------------
  110. def ability_max_level
  111. return 60
  112. end
  113. #--------------------------------------------------------------------------
  114. # * Determine Maximum Level
  115. #--------------------------------------------------------------------------
  116. def ability_max_level?
  117. @ability_level >= ability_max_level
  118. end
  119.  
  120. #--------------------------------------------------------------------------
  121. # * Calculate Stats Augmentation
  122. #--------------------------------------------------------------------------
  123. def addedstats_calculation
  124. case $game_temp.ability_index
  125. when 0
  126. if @ability_level[0].between?(0, 30)
  127. @augmentation[2] = Random.new.rand(3..8)
  128. @augmentation[3] = Random.new.rand(3..8)
  129. @augmentation[0] = Random.new.rand(50..100)
  130. elsif @ability_level[0].between?(31, 60)
  131. @augmentation[2] = Random.new.rand(15..20)
  132. @augmentation[3] = Random.new.rand(15..20)
  133. @augmentation[0] = Random.new.rand(150..250)
  134. end
  135. when 1
  136. if @ability_level[1].between?(0, 30)
  137. @augmentation[4] = Random.new.rand(3..8)
  138. @augmentation[0] = Random.new.rand(25..50)
  139. @augmentation[1] = Random.new.rand(25..75)
  140. elsif @ability_level[1].between?(31, 60)
  141. @augmentation[4] = Random.new.rand(15..20)
  142. @augmentation[0] = Random.new.rand(75..100)
  143. @augmentation[1] = Random.new.rand(100..150)
  144. end
  145. when 2
  146. if @ability_level[2].between?(0, 30)
  147. @augmentation[4] = Random.new.rand(3..8)
  148. @augmentation[5] = Random.new.rand(3..8)
  149. @augmentation[1] = Random.new.rand(50..100)
  150. elsif @ability_level[2].between?(31, 60)
  151. @augmentation[4] = Random.new.rand(15..20)
  152. @augmentation[5] = Random.new.rand(15..20)
  153. @augmentation[1] = Random.new.rand(100..150)
  154. end
  155. when 3
  156. if @ability_level[3].between?(0, 30)
  157. @augmentation[4] = Random.new.rand(3..8)
  158. @augmentation[5] = Random.new.rand(3..8)
  159. @augmentation[1] = Random.new.rand(25..50)
  160. elsif @ability_level[3].between?(31, 60)
  161. @augmentation[4] = Random.new.rand(15..20)
  162. @augmentation[5] = Random.new.rand(15..20)
  163. @augmentation[1] = Random.new.rand(75..125)
  164. end
  165. end
  166. end
  167. #--------------------------------------------------------------------------
  168. # * Add Stats Augmentation
  169. #--------------------------------------------------------------------------
  170. def stats_augmentation
  171. case $game_temp.ability_index
  172. when 0
  173. add_param(2, @augmentation[2])
  174. add_param(3, @augmentation[3])
  175. add_param(0, @augmentation[0])
  176. when 1
  177. add_param(4, @augmentation[4])
  178. add_param(0, @augmentation[0])
  179. add_param(1, @augmentation[1])
  180. when 2
  181. add_param(4, @augmentation[4])
  182. add_param(5, @augmentation[5])
  183. add_param(1, @augmentation[1])
  184. when 3
  185. add_param(4, @augmentation[4])
  186. add_param(5, @augmentation[5])
  187. add_param(1, @augmentation[1])
  188. end
  189. end
  190.  
  191. #--------------------------------------------------------------------------
  192. # * Ability Points Down
  193. #--------------------------------------------------------------------------
  194. def abilitypoints_down
  195. @ability_points -= 1
  196. end
  197.  
  198. #--------------------------------------------------------------------------
  199. # * Aliasing method Level Up
  200. #--------------------------------------------------------------------------
  201. alias ability_level_up level_up
  202. def level_up
  203. @ability_points += 1
  204. ability_level_up
  205. end
  206. end
  207.  
  208. #==============================================================================
  209. # ** Window_MenuCommand
  210. #------------------------------------------------------------------------------
  211. # This command window appears on the menu screen.
  212. #==============================================================================
  213.  
  214. class Window_MenuCommand < Window_Command
  215. #--------------------------------------------------------------------------
  216. # * Overwrite method Adding Original Commands
  217. #--------------------------------------------------------------------------
  218. def add_original_commands
  219. add_command("Ability", :ability, main_commands_enabled)
  220. end
  221. end
  222.  
  223. #==============================================================================
  224. # ** Scene_Menu
  225. #------------------------------------------------------------------------------
  226. # This class performs the menu screen processing.
  227. #==============================================================================
  228.  
  229. class Scene_Menu < Scene_MenuBase
  230. #--------------------------------------------------------------------------
  231. # * Overwrite method Create Command Window
  232. #--------------------------------------------------------------------------
  233. def create_command_window
  234. @command_window = Window_MenuCommand.new
  235. @command_window.set_handler(:item, method(:command_item))
  236. @command_window.set_handler(:skill, method(:command_personal))
  237. @command_window.set_handler(:equip, method(:command_personal))
  238. @command_window.set_handler(:status, method(:command_personal))
  239. @command_window.set_handler(:ability, method(:command_ability))
  240. @command_window.set_handler(:formation, method(:command_formation))
  241. @command_window.set_handler(:save, method(:command_save))
  242. @command_window.set_handler(:game_end, method(:command_game_end))
  243. @command_window.set_handler(:cancel, method(:return_scene))
  244. end
  245.  
  246. #--------------------------------------------------------------------------
  247. # * [Ability] Command
  248. #--------------------------------------------------------------------------
  249. def command_ability
  250. @status_window.select_last
  251. @status_window.activate
  252. @status_window.set_handler(:ok, method(:on_ability_ok))
  253. @status_window.set_handler(:cancel, method(:on_ability_cancel))
  254. end
  255.  
  256. #--------------------------------------------------------------------------
  257. # * Ability [OK]
  258. #--------------------------------------------------------------------------
  259. def on_ability_ok
  260. if @status_window.pending_index >= 0
  261. @status_window.pending_index = @status_window.index
  262. end
  263. @status_window.activate
  264. SceneManager.call(Scene_Ability)
  265. end
  266. #--------------------------------------------------------------------------
  267. # * Ability [Cancel]
  268. #--------------------------------------------------------------------------
  269. def on_ability_cancel
  270. if @status_window.pending_index >= 0
  271. @status_window.pending_index = -1
  272. @status_window.activate
  273. else
  274. @status_window.unselect
  275. @command_window.activate
  276. end
  277. end
  278. end
  279.  
  280. #===============================================================================
  281. # ** Scene_Ability
  282. #-------------------------------------------------------------------------------
  283. # This class perform the Ability system
  284. #===============================================================================
  285.  
  286. class Scene_Ability < Scene_MenuBase
  287.  
  288. #--------------------------------------------------------------------------
  289. # * Start Processing
  290. #--------------------------------------------------------------------------
  291. def start
  292. super
  293. $game_temp.ability_index = 0
  294. create_abilitystatus_window
  295. create_category_windows
  296. create_adds_windows
  297. create_command_window
  298. create_choices_windows
  299. create_addedstats_window
  300. create_showskill_window
  301. create_images
  302. @abilitymessage_window.visible = false
  303. @addedstats_window.visible = false
  304. refresh
  305. end
  306.  
  307. #--------------------------------------------------------------------------
  308. # * Termination Processing
  309. #--------------------------------------------------------------------------
  310. def terminate
  311. super
  312. @crystal_sprites.each(&:dispose)
  313. end
  314.  
  315. #--------------------------------------------------------------------------
  316. # * Frame Update
  317. #--------------------------------------------------------------------------
  318. def update
  319. super
  320. if @command_window.active
  321. if Input.trigger?(:LEFT)
  322. Sound.play_cursor
  323. $game_temp.ability_index = ($game_temp.ability_index-1)%4
  324. case $game_temp.ability_index
  325. when 0
  326. if @showskill_mgib_window.height = 120
  327. @showskill_mgib_window.height = 20
  328. @showskill_mgib_window.y = 384
  329. @showskill_mgib_window.opacity = 0
  330. @showskill_mgib_window.back_opacity = 0
  331. @mgib_adds_window.visible = true
  332. end
  333. when 1
  334. if @showskill_mgin_window.height = 120
  335. @showskill_mgin_window.height = 20
  336. @showskill_mgin_window.y = 384
  337. @showskill_mgin_window.opacity = 0
  338. @showskill_mgin_window.back_opacity = 0
  339. @mgin_adds_window.visible = true
  340. end
  341. when 2
  342. if @showskill_mgic_window.height = 120
  343. @showskill_mgic_window.height = 20
  344. @showskill_mgic_window.y = 384
  345. @showskill_mgic_window.opacity = 0
  346. @showskill_mgic_window.back_opacity = 0
  347. @mgic_adds_window.visible = true
  348. end
  349. when 3
  350. if @showskill_atk_window.height = 120
  351. @showskill_atk_window.height = 20
  352. @showskill_atk_window.y = 384
  353. @showskill_atk_window.opacity = 0
  354. @showskill_atk_window.back_opacity = 0
  355. @atk_adds_window.visible = true
  356. end
  357. end
  358. elsif Input.trigger?(:RIGHT)
  359. Sound.play_cursor
  360. $game_temp.ability_index = ($game_temp.ability_index+1)%4
  361. case $game_temp.ability_index
  362. when 0
  363. if @showskill_mgic_window.height = 120
  364. @showskill_mgic_window.height = 20
  365. @showskill_mgic_window.y = 384
  366. @showskill_mgic_window.opacity = 0
  367. @showskill_mgic_window.back_opacity = 0
  368. @mgic_adds_window.visible = true
  369. end
  370. when 1
  371. if @showskill_atk_window.height = 120
  372. @showskill_atk_window.height = 20
  373. @showskill_atk_window.y = 384
  374. @showskill_atk_window.opacity = 0
  375. @showskill_atk_window.back_opacity = 0
  376. @atk_adds_window.visible = true
  377. end
  378. when 2
  379. if @showskill_mgib_window.height = 120
  380. @showskill_mgib_window.height = 20
  381. @showskill_mgib_window.y = 384
  382. @showskill_mgib_window.opacity = 0
  383. @showskill_mgib_window.back_opacity = 0
  384. @mgib_adds_window.visible = true
  385. end
  386. when 3
  387. if @showskill_mgin_window.height = 120
  388. @showskill_mgin_window.height = 20
  389. @showskill_mgin_window.y = 384
  390. @showskill_mgin_window.opacity = 0
  391. @showskill_mgin_window.back_opacity = 0
  392. @mgin_adds_window.visible = true
  393. end
  394. end
  395. elsif Input.trigger?(:DOWN)
  396. case $game_temp.ability_index
  397. when 0
  398. @showskill_atk_window.refresh
  399. @showskill_atk_window.height = 120
  400. @showskill_atk_window.y = 290
  401. @showskill_atk_window.opacity = 255
  402. @showskill_atk_window.back_opacity = 190
  403. @atk_adds_window.visible = false
  404. when 1
  405. @showskill_mgib_window.refresh
  406. @showskill_mgib_window.height = 120
  407. @showskill_mgib_window.y = 290
  408. @showskill_mgib_window.opacity = 255
  409. @showskill_mgib_window.back_opacity = 190
  410. @mgib_adds_window.visible = false
  411. when 2
  412. @showskill_mgin_window.refresh
  413. @showskill_mgin_window.height = 120
  414. @showskill_mgin_window.y = 290
  415. @showskill_mgin_window.opacity = 255
  416. @showskill_mgin_window.back_opacity = 190
  417. @mgin_adds_window.visible = false
  418. when 3
  419. @showskill_mgic_window.refresh
  420. @showskill_mgic_window.height = 120
  421. @showskill_mgic_window.y = 290
  422. @showskill_mgic_window.opacity = 255
  423. @showskill_mgic_window.back_opacity = 190
  424. @mgic_adds_window.visible = false
  425. end
  426. elsif Input.trigger?(:UP)
  427. case $game_temp.ability_index
  428. when 0
  429. if @showskill_atk_window.height = 120
  430. @showskill_atk_window.height = 20
  431. @showskill_atk_window.y = 384
  432. @showskill_atk_window.opacity = 0
  433. @showskill_atk_window.back_opacity = 0
  434. @atk_adds_window.visible = true
  435. end
  436. when 1
  437. if @showskill_mgib_window.height = 120
  438. @showskill_mgib_window.height = 20
  439. @showskill_mgib_window.y = 384
  440. @showskill_mgib_window.opacity = 0
  441. @showskill_mgib_window.back_opacity = 0
  442. @mgib_adds_window.visible = true
  443. end
  444. when 2
  445. if @showskill_mgin_window.height = 120
  446. @showskill_mgin_window.height = 20
  447. @showskill_mgin_window.y = 384
  448. @showskill_mgin_window.opacity = 0
  449. @showskill_mgin_window.back_opacity = 0
  450. @mgin_adds_window.visible = true
  451. end
  452. when 3
  453. if @showskill_mgic_window.height = 120
  454. @showskill_mgic_window.height = 20
  455. @showskill_mgic_window.y = 384
  456. @showskill_mgic_window.opacity = 0
  457. @showskill_mgic_window.back_opacity = 0
  458. @mgic_adds_window.visible = true
  459. end
  460. end
  461. elsif Input.trigger?(:C)
  462. if @actor.ability_points != 0
  463. @abilitymessage_window.visible = true
  464. @actor.addedstats_calculation
  465. @addedstats_window.refresh
  466. @addedstats_window.visible = true
  467. @command_window.active = false
  468. @abilitychoices_window.start
  469. else
  470. Sound.play_buzzer
  471. end
  472. end
  473. end
  474. 4.times do |i|
  475. j = $game_temp.ability_index == i ? 1 : 0
  476. bitmap_name = @actor.ability_level[i] == 0 ? @crystal_pictures[j] : @crystal_pictures[i*2+2+j]
  477. @crystal_sprites[i].bitmap = Cache.picture(bitmap_name)
  478. end
  479. pattern = (Graphics.frame_count/5)%6
  480. sprite = @crystal_sprites[$game_temp.ability_index]
  481. w, h = sprite.bitmap.width/6, sprite.bitmap.height
  482. sprite.src_rect.set(w*pattern, 0, w, h)
  483. end
  484.  
  485. #--------------------------------------------------------------------------
  486. # * Ability Status Window creation
  487. #--------------------------------------------------------------------------
  488. def create_abilitystatus_window
  489. @abilitystatus_window = Window_AbilityStatus.new
  490. @abilitystatus_window.actor = @actor
  491. end
  492.  
  493. #--------------------------------------------------------------------------
  494. # * Ability Category Window creation
  495. #--------------------------------------------------------------------------
  496. def create_category_windows
  497. @atk_category_window = Window_AbilityCategory.new
  498. @atk_category_window.x = 60
  499. @atk_category_window.contents.draw_text(4, 0, 60, 20, "ATK")
  500. @mgib_category_window = Window_AbilityCategory.new
  501. @mgib_category_window.x = 180
  502. @mgib_category_window.contents.draw_text(2, 0, 60, 20, "MGIB")
  503. @mgin_category_window = Window_AbilityCategory.new
  504. @mgin_category_window.x = 300
  505. @mgin_category_window.contents.draw_text(2, 0, 60, 20, "MGIN")
  506. @mgic_category_window = Window_AbilityCategory.new
  507. @mgic_category_window.x = 420
  508. @mgic_category_window.contents.draw_text(2, 0, 60, 20, "MGIC")
  509. end
  510.  
  511. #--------------------------------------------------------------------------
  512. # * Ability Status Window creation
  513. #--------------------------------------------------------------------------
  514. def create_adds_windows
  515. @atk_adds_window = Window_AbilityAdds.new(40, 290)
  516. @atk_adds_window.actor = @actor
  517. @atk_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[0].to_s, 1)
  518. @mgib_adds_window = Window_AbilityAdds.new(160, 290)
  519. @mgib_adds_window.actor = @actor
  520. @mgib_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[1].to_s, 1)
  521. @mgin_adds_window = Window_AbilityAdds.new(280, 290)
  522. @mgin_adds_window.actor = @actor
  523. @mgin_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[2].to_s, 1)
  524. @mgic_adds_window = Window_AbilityAdds.new(400, 290)
  525. @mgic_adds_window.actor = @actor
  526. @mgic_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[3].to_s, 1)
  527. end
  528.  
  529. #--------------------------------------------------------------------------
  530. # * Ability Command Window creation
  531. #--------------------------------------------------------------------------
  532. def create_command_window
  533. @command_window = Window_Ability_Command.new
  534. @command_window.set_handler(:cancel, method(:return_scene))
  535. @command_window.set_handler(:pagedown, method(:next_actor))
  536. @command_window.set_handler(:pageup, method(:prev_actor))
  537. end
  538.  
  539. #--------------------------------------------------------------------------
  540. # * Ability Choices Windows creation
  541. #--------------------------------------------------------------------------
  542. def create_choices_windows
  543. @abilitymessage_window = Window_Ability_Confirmation.new
  544. @abilitychoices_window = Window_Ability_ChoiceList.new
  545. @abilitychoices_window.set_handler(:oui, method(:add_ability_points))
  546. @abilitychoices_window.set_handler(:non, method(:return_category))
  547. @abilitychoices_window.set_handler(:cancel, method(:return_category))
  548. end
  549.  
  550. def create_addedstats_window
  551. @addedstats_window = Window_Ability_AddedStats.new
  552. @addedstats_window.actor = @actor
  553. end
  554.  
  555. def create_showskill_window
  556. @showskill_atk_window = Window_AbilitySkillList.new(40, 384, 0)
  557. @showskill_atk_window.actor = @actor
  558. @showskill_atk_window.opacity = 0
  559. @showskill_atk_window.back_opacity = 0
  560. @showskill_mgib_window = Window_AbilitySkillList.new(160, 384, 1)
  561. @showskill_mgib_window.actor = @actor
  562. @showskill_mgib_window.opacity = 0
  563. @showskill_mgib_window.back_opacity = 0
  564. @showskill_mgin_window = Window_AbilitySkillList.new(280, 384, 2)
  565. @showskill_mgin_window.actor = @actor
  566. @showskill_mgin_window.opacity = 0
  567. @showskill_mgin_window.back_opacity = 0
  568. @showskill_mgic_window = Window_AbilitySkillList.new(400, 384, 3)
  569. @showskill_mgic_window.actor = @actor
  570. @showskill_mgic_window.opacity = 0
  571. @showskill_mgic_window.back_opacity = 0
  572. end
  573.  
  574. #--------------------------------------------------------------------------
  575. # * Change Actors
  576. #--------------------------------------------------------------------------
  577. def on_actor_change
  578. @abilitystatus_window.actor = @actor
  579. @addedstats_window.actor = @actor
  580. @atk_adds_window.actor = @actor
  581. @mgib_adds_window.actor = @actor
  582. @mgin_adds_window.actor = @actor
  583. @mgic_adds_window.actor = @actor
  584. @showskill_atk_window.actor = @actor
  585. @showskill_mgib_window.actor = @actor
  586. @showskill_mgin_window.actor = @actor
  587. @showskill_mgic_window.actor = @actor
  588. @command_window.activate
  589. refresh
  590. end
  591.  
  592. #--------------------------------------------------------------------------
  593. # * Add Ability Points
  594. #--------------------------------------------------------------------------
  595. def add_ability_points
  596. if @actor.ability_points == 0
  597. Sound.play_buzzer
  598. else
  599. case $game_temp.ability_index
  600. when 0
  601. @actor.ability_level[0] += 1
  602. @actor.abilitypoints_down
  603. @actor.stats_augmentation
  604. @actor.check_ability_skills_learning(0)
  605. @atk_adds_window.refresh
  606. when 1
  607. @actor.ability_level[1] += 1
  608. @actor.abilitypoints_down
  609. @actor.stats_augmentation
  610. @actor.check_ability_skills_learning(1)
  611. @mgib_adds_window.refresh
  612. when 2
  613. @actor.ability_level[2] += 1
  614. @actor.abilitypoints_down
  615. @actor.stats_augmentation
  616. @actor.check_ability_skills_learning(2)
  617. @mgin_adds_window.refresh
  618.  
  619. when 3
  620. @actor.ability_level[3] += 1
  621. @actor.abilitypoints_down
  622. @actor.stats_augmentation
  623. @actor.check_ability_skills_learning(3)
  624. @mgic_adds_window.refresh
  625. end
  626. Sound.play_cursor
  627. end
  628. refresh
  629. @abilitystatus_window.refresh
  630. @abilitymessage_window.visible = false
  631. @addedstats_window.visible = false
  632. @addedstats_window.refresh
  633. @abilitychoices_window.deactivate
  634. @abilitychoices_window.openness = 0
  635. @command_window.activate
  636. end
  637.  
  638. #--------------------------------------------------------------------------
  639. # * Return to category choice
  640. #--------------------------------------------------------------------------
  641. def return_category
  642. Sound.play_cancel
  643. @abilitymessage_window.visible = false
  644. @addedstats_window.visible = false
  645. @addedstats_window.refresh
  646. @abilitychoices_window.openness = 0
  647. @abilitychoices_window.deactivate
  648. @command_window.activate
  649. end
  650.  
  651. #--------------------------------------------------------------------------
  652. # * Images creation
  653. #--------------------------------------------------------------------------
  654. def create_images
  655. @crystal_sprites = []
  656. 4.times do |i|
  657. @crystal_sprites[i] = Sprite.new
  658. @crystal_sprites[i].x = 60+120*i
  659. @crystal_sprites[i].y = 130
  660. end
  661. @crystal_pictures = ["Crystal", "Glowing_Crystal", "Red_Crystal", "Glowing_Red_Crystal", "White_Crystal", "Glowing_White_Crystal",
  662. "Blue_Crystal", "Glowing_Blue_Crystal", "Green_Crystal", "Glowing_Green_Crystal"]
  663. update
  664. end
  665.  
  666. #--------------------------------------------------------------------------
  667. # * Refresh
  668. #--------------------------------------------------------------------------
  669. def refresh
  670. @command_window.index = 0
  671. @command_window.refresh
  672. @atk_adds_window.refresh
  673. @mgib_adds_window.refresh
  674. @mgin_adds_window.refresh
  675. @mgic_adds_window.refresh
  676. @atk_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[0].to_s, 1)
  677. @atk_adds_window.contents.draw_text(0, 30, 40, 14, "ATK")
  678. @atk_adds_window.contents.draw_text(0, 42, 40, 14, "DEF")
  679. @atk_adds_window.contents.draw_text(0, 54, 40, 14, "HP")
  680. if @actor.ability_level[0].between?(0, 30)
  681. @atk_adds_window.contents.draw_text(2, 30, 60, 14, "+ 3/8", 2)
  682. @atk_adds_window.contents.draw_text(2, 42, 60, 14, "+ 3/8", 2)
  683. @atk_adds_window.contents.draw_text(10, 54, 60, 14, "+ 50/100", 2)
  684. elsif @actor.ability_level[0].between?(31, 60)
  685. @atk_adds_window.contents.draw_text(2, 30, 60, 14, "+ 15/20", 2)
  686. @atk_adds_window.contents.draw_text(2, 42, 60, 14, "+ 15/20", 2)
  687. @atk_adds_window.contents.draw_text(10, 54, 60, 14, "+ 150/250", 2)
  688. end
  689. @mgib_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[1].to_s, 1)
  690. @mgib_adds_window.contents.draw_text(0, 30, 40, 14, "MAG")
  691. @mgib_adds_window.contents.draw_text(0, 42, 40, 14, "HP")
  692. @mgib_adds_window.contents.draw_text(0, 54, 40, 14, "MP")
  693. if @actor.ability_level[1].between?(0, 30)
  694. @mgib_adds_window.contents.draw_text(2, 30, 60, 14, "+ 3/8", 2)
  695. @mgib_adds_window.contents.draw_text(10, 42, 60, 14, "+ 25/50", 2)
  696. @mgib_adds_window.contents.draw_text(10, 54, 60, 14, "+ 50/75", 2)
  697. elsif @actor.ability_level[1].between?(31, 60)
  698. @mgib_adds_window.contents.draw_text(2, 30, 60, 14, "+ 15/20", 2)
  699. @mgib_adds_window.contents.draw_text(10, 42, 60, 14, "+ 75/100", 2)
  700. @mgib_adds_window.contents.draw_text(10, 54, 60, 14, "+ 100/150", 2)
  701. end
  702. @mgin_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[2].to_s, 1)
  703. @mgin_adds_window.contents.draw_text(0, 30, 40, 14, "MGI")
  704. @mgin_adds_window.contents.draw_text(0, 42, 40, 14, "MDF")
  705. @mgin_adds_window.contents.draw_text(0, 54, 40, 14, "MP")
  706. if @actor.ability_level[2].between?(0, 30)
  707. @mgin_adds_window.contents.draw_text(2, 30, 60, 14, "+ 3/8", 2)
  708. @mgin_adds_window.contents.draw_text(2, 42, 60, 14, "+ 3/8", 2)
  709. @mgin_adds_window.contents.draw_text(10, 54, 60, 14, "+ 50/100", 2)
  710. elsif @actor.ability_level[2].between?(31, 60)
  711. @mgin_adds_window.contents.draw_text(2, 30, 60, 14, "+ 15/20", 2)
  712. @mgin_adds_window.contents.draw_text(2, 42, 60, 14, "+ 15/20", 2)
  713. @mgin_adds_window.contents.draw_text(10, 54, 60, 14, "+ 150/250", 2)
  714. end
  715. @mgic_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[3].to_s, 1)
  716. @mgic_adds_window.contents.draw_text(0, 30, 40, 14, "MGI")
  717. @mgic_adds_window.contents.draw_text(0, 42, 40, 14, "MDF")
  718. @mgic_adds_window.contents.draw_text(0, 54, 40, 14, "MP")
  719. if @actor.ability_level[3].between?(0, 30)
  720. @mgic_adds_window.contents.draw_text(2, 30, 60, 14, "+ 3/8", 2)
  721. @mgic_adds_window.contents.draw_text(2, 42, 60, 14, "+ 3/8", 2)
  722. @mgic_adds_window.contents.draw_text(10, 54, 60, 14, "+ 50/100", 2)
  723. elsif @actor.ability_level[3].between?(31, 60)
  724. @mgic_adds_window.contents.draw_text(2, 30, 60, 14, "+ 15/20", 2)
  725. @mgic_adds_window.contents.draw_text(2, 42, 60, 14, "+ 15/20", 2)
  726. @mgic_adds_window.contents.draw_text(10, 54, 60, 14, "+ 150/250", 2)
  727. end
  728. end
  729. end
  730.  
  731. #===============================================================================
  732. # ** Window_AbilityStatus
  733. #-------------------------------------------------------------------------------
  734. # This class perform the status window for the Ability system
  735. #===============================================================================
  736.  
  737. class Window_AbilityStatus < Window_Base
  738. #--------------------------------------------------------------------------
  739. # * Object Initialization
  740. #--------------------------------------------------------------------------
  741. def initialize
  742. super(22, 6, 500, 120)
  743. self.contents.font.size = 16
  744. @actor = nil
  745. @temp_actor = nil
  746. refresh
  747. end
  748.  
  749. #--------------------------------------------------------------------------
  750. # * Get Number of Lines to Show
  751. #--------------------------------------------------------------------------
  752. def visible_line_number
  753. return 4
  754. end
  755.  
  756. #--------------------------------------------------------------------------
  757. # * Set Actor
  758. #--------------------------------------------------------------------------
  759. def actor=(actor)
  760. return if @actor == actor
  761. @actor = actor
  762. refresh
  763. end
  764.  
  765. #--------------------------------------------------------------------------
  766. # * Refresh
  767. #--------------------------------------------------------------------------
  768. def refresh
  769. contents.clear
  770. draw_actor_face(@actor, 0, 0) if @actor
  771. draw_actor_name(@actor, 104, 0) if @actor
  772. draw_actor_hp(@actor, 104, 20, width = 60) if @actor
  773. draw_actor_mp(@actor, 212, 20, width = 60) if @actor
  774. draw_item(100, 38, 0)
  775. draw_ability_points(@actor, 0, 0) if @actor
  776. draw_actor_accessory(@actor, 0, 0) if @actor
  777. end
  778.  
  779. #--------------------------------------------------------------------------
  780. # * Set Temporary Actor After Equipment Change
  781. #--------------------------------------------------------------------------
  782. def set_temp_actor(temp_actor)
  783. return if @temp_actor == temp_actor
  784. @temp_actor = temp_actor
  785. refresh
  786. end
  787.  
  788. #--------------------------------------------------------------------------
  789. # * Draw Max Value in Fractional Format
  790. # max : Maximum value
  791. # color1 : Color of maximum value
  792. #--------------------------------------------------------------------------
  793. def draw_max_values(x, y, width, max, color1)
  794. xr = x + width
  795. if width < 96
  796. draw_text(xr - 40, y, 42, line_height, max, 2)
  797. else
  798. draw_text(xr - 42, y, 42, line_height, max, 2)
  799. end
  800. end
  801.  
  802. #--------------------------------------------------------------------------
  803. # * Draw HP
  804. #--------------------------------------------------------------------------
  805. def draw_actor_hp(actor, x, y, width = 124)
  806. contents.font.size = 17
  807. draw_text(x, y, 30, line_height, Vocab::hp_a)
  808. draw_max_values(x + 12, y, width, actor.mhp, normal_color)
  809. end
  810. #--------------------------------------------------------------------------
  811. # * Draw MP
  812. #--------------------------------------------------------------------------
  813. def draw_actor_mp(actor, x, y, width = 124)
  814. contents.font.size = 17
  815. draw_text(x, y, 30, line_height, Vocab::mp_a)
  816. draw_max_values(x + 22, y, width, actor.mmp, normal_color)
  817. end
  818.  
  819. #--------------------------------------------------------------------------
  820. # * Draw Item
  821. #--------------------------------------------------------------------------
  822. def draw_item(x, y, param_id)
  823. draw_param_name(x + 4, y, 2)
  824. draw_current_param(x + 46, y, 2) if @actor
  825. draw_param_name(x + 4, y + 18, 3)
  826. draw_current_param(x + 46, y + 18, 3) if @actor
  827. draw_param_name(x + 4, y + 36, 6)
  828. draw_current_param(x + 46, y + 36, 6) if @actor
  829. draw_param_name(x + 112, y, 4)
  830. draw_current_param(x + 164, y, 4) if @actor
  831. draw_param_name(x + 112, y + 18, 5)
  832. draw_current_param(x + 164, y + 18, 5) if @actor
  833. draw_param_name(x + 112, y + 36, 7)
  834. draw_current_param(x + 164, y + 36, 7) if @actor
  835. end
  836.  
  837. #--------------------------------------------------------------------------
  838. # * Draw Parameter Name
  839. #--------------------------------------------------------------------------
  840. def draw_param_name(x, y, param_id)
  841. contents.font.size = 17
  842. change_color(normal_color)
  843. draw_text(x, y, 80, line_height, Vocab::param(param_id))
  844. end
  845. #--------------------------------------------------------------------------
  846. # * Draw Current Parameter
  847. #--------------------------------------------------------------------------
  848. def draw_current_param(x, y, param_id)
  849. contents.font.size = 17
  850. change_color(normal_color)
  851. draw_text(x, y, 32, line_height, @actor.param(param_id), 2)
  852. end
  853.  
  854. #--------------------------------------------------------------------------
  855. # * Draw actor ability points
  856. #--------------------------------------------------------------------------
  857. def draw_ability_points(actor, x, y)
  858. contents.font.size = 20
  859. draw_text(356, 4, 100, 20, " Ability Points :")
  860. draw_text(374, 24, 40, 20, actor.ability_points.to_s, 1)
  861. end
  862.  
  863. #--------------------------------------------------------------------------
  864. # * Draw actor accessory
  865. #--------------------------------------------------------------------------
  866. def draw_actor_accessory(actor, x, y)
  867. contents.font.size = 20
  868. draw_text(346, 50, 120, line_height, " Equipped Accessory : ")
  869. draw_item_name(actor.equips[4], 322, 72)
  870. end
  871.  
  872. #--------------------------------------------------------------------------
  873. # * Draw Item Name
  874. # enabled : Enabled flag. When false, draw semi-transparently.
  875. #--------------------------------------------------------------------------
  876. def draw_item_name(item, x, y, enabled = true, width = 172)
  877. return unless item
  878. contents.font.size = 17
  879. change_color(normal_color, enabled)
  880. draw_text(x, y, width, line_height, item.name)
  881. end
  882. end
  883.  
  884. #===============================================================================
  885. # ** Window_AbilityCategory
  886. #-------------------------------------------------------------------------------
  887. # This class handle the category_name for the Ability system
  888. #===============================================================================
  889.  
  890. class Window_AbilityCategory < Window_Base
  891. #--------------------------------------------------------------------------
  892. # * Object Initialization
  893. #--------------------------------------------------------------------------
  894. def initialize
  895. super(0, 240, 60, 40)
  896. self.contents.font.size = 19
  897. end
  898. end
  899.  
  900. #===============================================================================
  901. # ** Window_AbilityAdds
  902. #-------------------------------------------------------------------------------
  903. # This class handle the lvl, stats & skill added by the Ability system
  904. #===============================================================================
  905.  
  906. class Window_AbilityAdds < Window_Base
  907. #--------------------------------------------------------------------------
  908. # * Object Initialization
  909. #--------------------------------------------------------------------------
  910. def initialize(x, y)
  911. super(x, y, 100, 120)
  912. self.contents.font.size = 17
  913. @actor = nil
  914. @temp_actor = nil
  915. refresh
  916. end
  917.  
  918. #--------------------------------------------------------------------------
  919. # * Set Actor
  920. #--------------------------------------------------------------------------
  921. def actor=(actor)
  922. return if @actor == actor
  923. @actor = actor
  924. refresh
  925. end
  926.  
  927. #--------------------------------------------------------------------------
  928. # * Refresh
  929. #--------------------------------------------------------------------------
  930. def refresh
  931. self.contents.clear
  932. self.contents.draw_text(22, 0, 100, 20, "Nv.")
  933. self.contents.draw_text(4, 14, 100, 20, "Nv suivant:")
  934. self.contents.draw_text(14, 66, 100, 20, "Skills:")
  935. end
  936.  
  937. #--------------------------------------------------------------------------
  938. # * Set Temporary Actor After Equipment Change
  939. #--------------------------------------------------------------------------
  940. def set_temp_actor(temp_actor)
  941. return if @temp_actor == temp_actor
  942. @temp_actor = temp_actor
  943. refresh
  944. end
  945. end
  946.  
  947. #==============================================================================
  948. # ** Window_Ability_Command
  949. #------------------------------------------------------------------------------
  950. # This class perform the Command Window for the Ability System
  951. #==============================================================================
  952.  
  953. class Window_Ability_Command < Window_Command
  954. #--------------------------------------------------------------------------
  955. # * Object Initialization
  956. #--------------------------------------------------------------------------
  957. def initialize
  958. super(115, 295)
  959. self.contents.font.size = 20
  960. self.opacity = 0
  961. self.back_opacity = 0
  962. cursor_rect.empty
  963. refresh
  964. end
  965.  
  966. #--------------------------------------------------------------------------
  967. # * Get Window Width
  968. #--------------------------------------------------------------------------
  969. def window_width
  970. return 150
  971. end
  972.  
  973. #--------------------------------------------------------------------------
  974. # * Processing When OK Button Is Pressed
  975. #--------------------------------------------------------------------------
  976. def process_ok
  977. end
  978.  
  979. #--------------------------------------------------------------------------
  980. # * Processing When Cancel Button Is Pressed
  981. #--------------------------------------------------------------------------
  982. def process_cancel
  983. Sound.play_cancel
  984. Input.update
  985. deactivate
  986. call_cancel_handler
  987. cursor_rect.empty
  988. end
  989.  
  990. #--------------------------------------------------------------------------
  991. # * Refresh
  992. #--------------------------------------------------------------------------
  993. def refresh
  994. clear_command_list
  995. make_command_list
  996. cursor_rect.empty
  997. self.arrows_visible = false
  998. super
  999. end
  1000. end
  1001.  
  1002. #==============================================================================
  1003. # ** Window_Ability_Confirmation
  1004. #------------------------------------------------------------------------------
  1005. # This class perform the Confirmation Window for the Ability System
  1006. #==============================================================================
  1007.  
  1008. class Window_Ability_Confirmation < Window_Base
  1009.  
  1010. #--------------------------------------------------------------------------
  1011. # * Object Initialization
  1012. #--------------------------------------------------------------------------
  1013. def initialize
  1014. super(118,126,300,120)
  1015. self.contents.font.size = 23
  1016. self.z = 500
  1017. refresh
  1018. end
  1019.  
  1020. #--------------------------------------------------------------------------
  1021. # * Refresh
  1022. #--------------------------------------------------------------------------
  1023. def refresh
  1024. draw_text(28, 28, 230, 24, " Ajouter un point à cette catégorie ?")
  1025. end
  1026. end
  1027.  
  1028. #==============================================================================
  1029. # ** Window_Ability_ChoiceList
  1030. #------------------------------------------------------------------------------
  1031. # This window is used for showing choices on Ability Confirmation Window
  1032. #==============================================================================
  1033.  
  1034. class Window_Ability_ChoiceList < Window_Command
  1035. #--------------------------------------------------------------------------
  1036. # * Object Initialization
  1037. #--------------------------------------------------------------------------
  1038. def initialize
  1039. super(196, 190)
  1040. self.opacity = 0
  1041. self.back_opacity = 0
  1042. self.z = 501
  1043. self.openness = 0
  1044. deactivate
  1045. end
  1046. #--------------------------------------------------------------------------
  1047. # * Start Input Processing
  1048. #--------------------------------------------------------------------------
  1049. def start
  1050. update_placement
  1051. refresh
  1052. select(0)
  1053. open
  1054. activate
  1055. end
  1056.  
  1057. #--------------------------------------------------------------------------
  1058. # * Get Digit Count
  1059. #--------------------------------------------------------------------------
  1060. def col_max
  1061. return 2
  1062. end
  1063. #--------------------------------------------------------------------------
  1064. # * Update Window Position
  1065. #--------------------------------------------------------------------------
  1066. def update_placement
  1067. self.width = 160
  1068. self.height = 80
  1069. end
  1070.  
  1071. #--------------------------------------------------------------------------
  1072. # * Get Maximum Width of Choices
  1073. #--------------------------------------------------------------------------
  1074. def max_choice_width
  1075. $game_message.choices.collect {|s| text_size(s).width }.max
  1076. end
  1077.  
  1078. #--------------------------------------------------------------------------
  1079. # * Create Command List
  1080. #--------------------------------------------------------------------------
  1081. def make_command_list
  1082. add_command("Oui", :oui)
  1083. add_command("Non", :non)
  1084. end
  1085.  
  1086. #--------------------------------------------------------------------------
  1087. # * Processing When OK Button Is Pressed
  1088. #--------------------------------------------------------------------------
  1089. def process_ok
  1090. if current_item_enabled?
  1091. Input.update
  1092. deactivate
  1093. call_ok_handler
  1094. else
  1095. Sound.play_buzzer
  1096. end
  1097. end
  1098. end
  1099.  
  1100. #===============================================================================
  1101. # ** Window_AbilityAddedStats
  1102. #-------------------------------------------------------------------------------
  1103. # This class perform the window for the Added Stats of the Ability system
  1104. #===============================================================================
  1105.  
  1106. class Window_Ability_AddedStats < Window_Base
  1107. #--------------------------------------------------------------------------
  1108. # * Object Initialization
  1109. #--------------------------------------------------------------------------
  1110. def initialize
  1111. super(22, 6, 500, 120)
  1112. self.contents.font.size = 17
  1113. self.opacity = 0
  1114. self.back_opacity = 0
  1115. @actor = nil
  1116. @temp_actor = nil
  1117. refresh
  1118. end
  1119.  
  1120. #--------------------------------------------------------------------------
  1121. # * Get Number of Lines to Show
  1122. #--------------------------------------------------------------------------
  1123. def visible_line_number
  1124. return 4
  1125. end
  1126.  
  1127. #--------------------------------------------------------------------------
  1128. # * Set Actor
  1129. #--------------------------------------------------------------------------
  1130. def actor=(actor)
  1131. return if @actor == actor
  1132. @actor = actor
  1133. refresh
  1134. end
  1135.  
  1136. #--------------------------------------------------------------------------
  1137. # * Refresh
  1138. #--------------------------------------------------------------------------
  1139. def refresh
  1140. contents.clear
  1141. draw_added_stats(@actor, 180, 20) if @actor
  1142. end
  1143.  
  1144. #--------------------------------------------------------------------------
  1145. # * Set Temporary Actor After Equipment Change
  1146. #--------------------------------------------------------------------------
  1147. def set_temp_actor(temp_actor)
  1148. return if @temp_actor == temp_actor
  1149. @temp_actor = temp_actor
  1150. refresh
  1151. end
  1152.  
  1153. #--------------------------------------------------------------------------
  1154. # * Draw Plus
  1155. #--------------------------------------------------------------------------
  1156. def draw_plus(x, y)
  1157. draw_text(x, y, 22, line_height, "+", 1)
  1158. end
  1159.  
  1160. #--------------------------------------------------------------------------
  1161. # * Draw Added Stats
  1162. #--------------------------------------------------------------------------
  1163. def draw_added_stats(actor, x, y)
  1164. case $game_temp.ability_index
  1165. when 0
  1166. change_color(hp_gauge_color1)
  1167. 3.times do |i|
  1168. draw_plus(172, 20 + 18 * i)
  1169. end
  1170. draw_text(x, y, 30, line_height, actor.augmentation[0].to_s, 1)
  1171. draw_text(x, y + 18, 30, line_height, actor.augmentation[2].to_s, 1)
  1172. draw_text(x, y + 36, 30, line_height, actor.augmentation[3].to_s, 1)
  1173. when 1
  1174. change_color(normal_color)
  1175. 2.times do |i|
  1176. draw_plus(290, 20 + 18 * i)
  1177. end
  1178. draw_plus(172, 20)
  1179. draw_text(x + 118, y + 18, 30, line_height, actor.augmentation[4].to_s, 1)
  1180. draw_text(x, y, 30, line_height, actor.augmentation[0].to_s, 1)
  1181. draw_text(x + 118, y, 30, line_height, actor.augmentation[1].to_s, 1)
  1182. when 2
  1183. change_color(mp_cost_color)
  1184. 3.times do |i|
  1185. draw_plus(290, 20 + 18 * i)
  1186. end
  1187. draw_text(x + 118, y + 18, 30, line_height, actor.augmentation[4].to_s, 1)
  1188. draw_text(x + 118, y + 36, 30, line_height, actor.augmentation[5].to_s, 1)
  1189. draw_text(x + 118, y, 30, line_height, actor.augmentation[1].to_s, 1)
  1190. when 3
  1191. change_color(power_up_color)
  1192. 3.times do |i|
  1193. draw_plus(290, 20 + 18 * i)
  1194. end
  1195. draw_text(x + 118, y + 18, 30, line_height, actor.augmentation[4].to_s, 1)
  1196. draw_text(x + 118, y + 36, 30, line_height, actor.augmentation[5].to_s, 1)
  1197. draw_text(x + 118, y, 30, line_height, actor.augmentation[1].to_s, 1)
  1198. end
  1199. end
  1200. end
  1201.  
  1202. #==============================================================================
  1203. # ** Window_AbilitySkillList
  1204. #------------------------------------------------------------------------------
  1205. # This window is for displaying a list of available skills on the skill window.
  1206. #==============================================================================
  1207.  
  1208. class Window_AbilitySkillList < Window_Selectable
  1209. #--------------------------------------------------------------------------
  1210. # * Object Initialization
  1211. #--------------------------------------------------------------------------
  1212. def initialize(x, y, index)
  1213. super(x, y, 100, 20)
  1214. self.contents.font.size = 12
  1215. @actor = nil
  1216. @temp_actor = nil
  1217. @index = index
  1218. refresh
  1219. end
  1220.  
  1221. #--------------------------------------------------------------------------
  1222. # * Get Number of Lines to Show
  1223. #--------------------------------------------------------------------------
  1224. def visible_line_number
  1225. return 3
  1226. end
  1227.  
  1228. #--------------------------------------------------------------------------
  1229. # * Set Actor
  1230. #--------------------------------------------------------------------------
  1231. def actor=(actor)
  1232. return if @actor == actor
  1233. @actor = actor
  1234. refresh
  1235. end
  1236.  
  1237. #--------------------------------------------------------------------------
  1238. # * Refresh
  1239. #--------------------------------------------------------------------------
  1240. def refresh
  1241. self.contents.clear
  1242. return unless @actor
  1243. for i in 0...@actor.ability_new_skills_id[@index].size
  1244. if @actor.ability_level[@index] == @actor.ability_new_skills_level[@index][i]-1
  1245. text = $data_skills[@actor.ability_new_skills_id[@index][i]].name
  1246. self.contents.draw_text(2, 0, 92, 20, text)
  1247. end
  1248. end
  1249. end
  1250. #--------------------------------------------------------------------------
  1251. # * Set Temporary Actor After Equipment Change
  1252. #--------------------------------------------------------------------------
  1253. def set_temp_actor(temp_actor)
  1254. return if @temp_actor == temp_actor
  1255. @temp_actor = temp_actor
  1256. refresh
  1257. end
  1258. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement