Advertisement
Raizen

Akea Animated Battle System(English)

Mar 8th, 2015
1,173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 70.70 KB | None | 0 0
  1. #=======================================================
  2. #        Akea Animated Battle System
  3. # Author: Raizen
  4. # Community: http://www.centrorpg.com/
  5. # Compatibility: RMVXAce
  6.  
  7. #=======================================================
  8.  
  9. # =========================Don't modify==============================
  10. $imported ||= Hash.new
  11. $imported[:lune_animated_battle] = true
  12. module Lune_Anime_Battle
  13. Battle_Poses = []
  14. Battle_Position = []
  15. Actions = []
  16. Actor = []
  17. Enemy = []
  18. Enemy_Poses = []
  19. Conditions = []
  20. Actor_Conditions = Array.new(load_data("Data/Actors.rvdata2").size)
  21. Enemy_Conditions = Array.new(load_data("Data/Enemies.rvdata2").size)
  22. for n in 0...load_data("Data/Actors.rvdata2").size
  23.   Actor_Conditions[n] = Array.new
  24. end
  25. for n in 0...load_data("Data/Enemies.rvdata2").size
  26.   Enemy_Conditions[n] = Array.new
  27. end
  28. # =========================Don't modify==============================
  29.  
  30. # Configuration starts here
  31.  
  32.  
  33.  
  34. #=======================================================
  35. #        INSTRUCTIONS
  36.  
  37. # Most of the configuration is made here and on Database notetags
  38.  
  39. # notetags -------
  40. #<castskill n>
  41.  
  42. # castskills makes a battle animation on the user,
  43. # useful for elemental skill,
  44. # change the n for the id of the battle animation
  45.  
  46. #<animation n>
  47.  
  48. # animation makes a battle animation on the target,
  49. # useful for a skill that has many battle animations on a same
  50. # target, or healing spells on the allies
  51. # change the n for the id of the battle animation
  52. # <playmovie name>
  53.  
  54. # movie animation, use it the way you use animation tag, put the movie name in the
  55. # place of the name.
  56.  
  57.  
  58. #<movement n>
  59.  
  60. # movement is the battler moving sprites, this is preconfigured below on the script
  61. # the n is the id of the Action.
  62.  
  63. #<move_hit n>
  64.  
  65. # same as above, but the movement will be on the target
  66.  
  67. #<wait_for n>
  68. # waits n frames before doing the next action
  69.  
  70. #<make_hit n>
  71.  
  72. # this function allows you to hit the enemy during the skill, replace n
  73. # with the % of damage of the skill, for examplo
  74. #<make_hit 10> will make 10% damage from the skill at the middle of the animation
  75.  
  76. #<scriptcall n>
  77. # this function allows script calls during the battle animations,
  78. # just add as many as you want and call them by their id on notepad
  79. # put inside '' the script call from the script you are adding
  80. Script_Call[0] = 'akea_camera(0)'
  81. Script_Call[1] = 'akea_camera(1)'
  82. Script_Call[2] = 'akea_camera(2)'
  83.  
  84. # Put if this damage will be shown on the message log, if using damage pop-ups
  85. # you can deactivate the show log function
  86. Show_On_Log = true
  87.  
  88. # All these notetags can be added either on the skills, or the items
  89.  
  90. #=======================================================
  91.  
  92.  
  93.  
  94. # Correction of the attack position of the character
  95.  
  96. Offset_X = 50 # Em X
  97. Offset_Y = 5 # Em Y
  98.  
  99. # Correction of the attack position of the enemy
  100. E_Offset_X = -50
  101. E_Offset_Y = 5
  102.  
  103.  
  104. # Spritesheets, use one for each character
  105. # If there are more, put them in the same image
  106. # The image must be in the folder Graphics/Battlers
  107. # Battle_Poses[n] = 'Image Name' # n is the actor id on database
  108. Battle_Poses[1] = 'Erik'
  109. Battle_Poses[2] = 'Luna'
  110. Battle_Poses[3] = 'Safira2'
  111. Battle_Poses[4] = 'Monk'
  112.  
  113.  
  114. # Spritesheets, use one for each enemy
  115. # Same as above, the id is the enemy id on database,
  116. # if the enemy is not listed here, it will be used its
  117. # default graphics
  118. Enemy_Poses[8] = 'scorpion2'
  119. Enemy_Poses[31] = 'ifrito'
  120. Enemy_Poses[32] = 'bafomet'
  121.  
  122. # Default configuration settings for the spritesheets
  123. # Actor[n] = {
  124. Actor[1] = {
  125. 'Frames' => 4, # Max Frames Quantity in the Spritesheet
  126. 'Positions' => 32, # Max Positions Quantity
  127. }
  128. Actor[2] = {
  129. 'Frames' => 4, # Max Frames Quantity in the Spritesheet
  130. 'Positions' => 32, # Max Positions Quantity
  131. }
  132. Actor[3] = {
  133. 'Frames' => 4, # Max Frames Quantity in the Spritesheet
  134. 'Positions' => 32, # Max Positions Quantity
  135. }
  136. Actor[4] = {
  137. 'Frames' => 4, # Max Frames Quantity in the Spritesheet
  138. 'Positions' => 32, # Max Positions Quantity
  139. }
  140. # With the enemies
  141. Enemy[8] = {
  142. 'Frames' => 4, # Max Frames Quantity in the Spritesheet
  143. 'Positions' => 14, # Max Positions Quantity
  144. }
  145. Enemy[31] = {
  146. 'Frames' => 4, # Max Frames Quantity in the Spritesheet
  147. 'Positions' => 14, # Max Positions Quantity
  148. }
  149. Enemy[32] = {
  150. 'Frames' => 4, # Max Frames Quantity in the Spritesheet
  151. 'Positions' => 32, # Max Positions Quantity
  152. }
  153.  
  154. # Character position in battle, if there are more then 4,
  155. # just add new lines below.
  156.  
  157. # Battle_Position[n] = [pos em x, pos em y]
  158. Battle_Position[0] = [400, 190]
  159. Battle_Position[1] = [440, 230]
  160. Battle_Position[2] = [400, 270]
  161. Battle_Position[3] = [440, 310]
  162.  
  163. # Offset from initial position, for entrance animation, in case oyu
  164. # do not want that initial animation in battle, just Start_off = [0, 0, 0]
  165. # Where Start_off = [offset in x, offset in y, Action id]
  166.  
  167. Start_off = [250, 0, 7]
  168.  
  169.  
  170. # Initial Animation, this animation can be addded on notetags in The actors
  171. # on database, these animation will be played in the beginning of the battle
  172. # for no animations, just leave the actors notetag in blank
  173. # true for all, false for one
  174. Start_all = false
  175.  
  176. # Default standing animation
  177. Standard = {
  178. # Use the condition settings below to configure this part
  179. 'Stand' => 1, # default, when actor/enemy is standing
  180. 'Damage' => 2, # When hit
  181. 'Weak' => 3, # When low on HP
  182. 'Dead' => 4, # When fallen
  183. 'Victory' => 5, # Winning
  184.  
  185. }
  186.  
  187. # HP necessary to enter "weak" position in %
  188. Hp = 30
  189. #==============================================================================
  190. #------------------------------------------------------------------------------
  191. # Conditions - Here is configured the characters conditions
  192. # can be added as many as you like.
  193. # All of then have the same pattern
  194. # [Spritesheet line, speed of animation, number of frames, loops?, mirror?, time, turns]
  195.  
  196. # speed of animation - the lowe the number the faster
  197. # number of frames - quantity of frames for this pose
  198. # loops? - if it loops the animation or finishes in the last frame(true or false)
  199. # mirror? - if it mirrors the sprite(true or false)
  200. # time - the time it will take to do the movement
  201. # tunrs - number of turns in this condition
  202.  
  203. # To add it in a skill use <condition n> on notetags
  204. #------------------------------------------------------------------------------
  205. #==============================================================================
  206. #==============================================================================
  207. # Conditions[1] => Stand Condition
  208. #==============================================================================
  209. Conditions[1] = [0, 10, 4, true, false]
  210.  
  211. #==============================================================================
  212. # Conditions[2] => Damage Condition
  213. #==============================================================================
  214. Conditions[2] = [3, 10, 4, false, false, 30]
  215.  
  216. #==============================================================================
  217. # Conditions[3] => Weak Condition
  218. #==============================================================================
  219. Conditions[3] = [2, 15, 4, true, false, 30]
  220.  
  221. #==============================================================================
  222. # Conditions[4] => Dead Condition
  223. #==============================================================================
  224. Conditions[4] = [12, 15, 4, false, false, 30]
  225.  
  226. #==============================================================================
  227. # Conditions[5] => Victory Condition
  228. #==============================================================================
  229. Conditions[5] = [7, 10, 4, true, false, 30]
  230.  
  231. #==============================================================================
  232. # Conditions[6] => Defense Condition
  233. #==============================================================================
  234. Conditions[6] = [1, 10, 4, false, false, 30, 2]
  235.  
  236.  
  237. # Specific conditions for party and enemies, for an actor configure as...
  238. # Actor_Conditions[actor_id][.....Same as Conditions
  239. # Or for enemies
  240. # Enemy_Conditions[enemy_id][....Same as conditions
  241. #==============================================================================
  242. # Conditions[1] => Stand Condition - Actor 1
  243. #==============================================================================
  244. Actor_Conditions[1][1] = [0, 10, 5, 2, false]
  245.  
  246. #==============================================================================
  247. # Conditions[1] => Stand Condition - Enemy 1
  248. #==============================================================================
  249. Enemy_Conditions[1][1] = [0, 10, 5, 2, false]
  250. #==============================================================================
  251. #------------------------------------------------------------------------------
  252. # Actions - Here is defined the action animation of characters
  253. # Can be added as many as you want.
  254. #------------------------------------------------------------------------------
  255. #==============================================================================
  256.  
  257. #==============================================================================
  258. #------------------------------------------------------------------------------
  259. # Movement Poses(1-20) - For organizing only
  260. #------------------------------------------------------------------------------
  261. #==============================================================================
  262.  
  263.  
  264. #==============================================================================
  265. # Actions[1] => go to target
  266. #==============================================================================
  267. Actions[1] = {
  268. 'Movement' => 'enemy', # 'enemy' or [x, y] go to position in x and y
  269. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  270. 'Time' => 25, # in frames
  271. 'Speed' => 2, # time taken to change the frame
  272. 'Frame' => 8, # position on the spritesheet
  273. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  274. 'Looping' => true, # if the animation loops
  275. 'Mirror' => false, # if mirrored
  276. }
  277. #==============================================================================
  278. # Actions[2] => return to position
  279. #==============================================================================
  280. Actions[2] = {
  281. 'Movement' => 'return', # 'enemy' or [x, y] go to position in x and y
  282. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  283. 'Time' => 15, # in frames
  284. 'Speed' => 2, # time taken to change the frame
  285. 'Frame' => 8, # position on the spritesheet
  286. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  287. 'Looping' => true, # if the animation loops
  288. 'Mirror' => true, # if mirrored
  289. }
  290. #==============================================================================
  291. # Actions[3] => movemento to the left
  292. #==============================================================================
  293. Actions[3] = {
  294. 'Movement' => [-100, 0], # 'enemy' or [x, y] go to position in x and y
  295. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  296. 'Time' => 5, # in frames
  297. 'Speed' => 10, # time taken to change the frame
  298. 'Frame' => 8, # position on the spritesheet
  299. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  300. 'Looping' => true, # if the animation loops
  301. 'Mirror' => false, # if mirrored
  302. }
  303.  
  304. #==============================================================================
  305. # Actions[4] => movemento to the left(lower)
  306. #==============================================================================
  307. Actions[4] = {
  308. 'Movement' => [-30, 0], # 'enemy' or [x, y] go to position in x and y
  309. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  310. 'Time' => 10, # in frames
  311. 'Speed' => 5, # time taken to change the frame
  312. 'Frame' => 9, # position on the spritesheet
  313. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  314. 'Looping' => false, # if the animation loops
  315. 'Mirror' => false, # if mirrored
  316. }
  317. #==============================================================================
  318. # Actions[5] => movemento to the right
  319. #==============================================================================
  320. Actions[5] = {
  321. 'Movement' => [100, 0], # 'enemy' or [x, y] go to position in x and y
  322. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  323. 'Time' => 5, # in frames
  324. 'Speed' => 10, # time taken to change the frame
  325. 'Frame' => 8, # position on the spritesheet
  326. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  327. 'Looping' => true, # if the animation loops
  328. 'Mirror' => true, # if mirrored
  329. }
  330. #==============================================================================
  331. # Actions[6] => movemento to the right(lower)
  332. #==============================================================================
  333. Actions[6] = {
  334. 'Movement' => [30, 0], # 'enemy' or [x, y] go to position in x and y
  335. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  336. 'Time' => 10, # in frames
  337. 'Speed' => 5, # time taken to change the frame
  338. 'Frame' => 8, # position on the spritesheet
  339. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  340. 'Looping' => true, # if the animation loops
  341. 'Mirror' => false, # if mirrored
  342. }
  343.  
  344. #==============================================================================
  345. # Actions[7] => go to initial position
  346. #==============================================================================
  347. Actions[7] = {
  348. 'Movement' => 'return', # 'enemy' or [x, y] go to position in x and y
  349. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  350. 'Time' => 40, # in frames
  351. 'Speed' => 2, # time taken to change the frame
  352. 'Frame' => 9, # position on the spritesheet
  353. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  354. 'Looping' => false, # if the animation loops
  355. 'Mirror' => false, # if mirrored
  356. }
  357. #==============================================================================
  358. # Actions[8] => return to initial position(no mirror)
  359. #==============================================================================
  360. Actions[8] = {
  361. 'Movement' => 'return', # 'enemy' or [x, y] go to position in x and y
  362. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  363. 'Time' => 15, # in frames
  364. 'Speed' => 2, # time taken to change the frame
  365. 'Frame' => 8, # position on the spritesheet
  366. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  367. 'Looping' => true, # if the animation loops
  368. 'Mirror' => false, # if mirrored
  369. }
  370. #==============================================================================
  371. # Actions[9] => movemento to the right(taking damage)
  372. #==============================================================================
  373. Actions[9] = {
  374. 'Movement' => [20, 0], # 'enemy' or [x, y] go to position in x and y
  375. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  376. 'Time' => 10, # in frames
  377. 'Speed' => 5, # time taken to change the frame
  378. 'Frame' => 3, # position on the spritesheet
  379. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  380. 'Looping' => true, # if the animation loops
  381. 'Mirror' => false, # if mirrored
  382. }
  383. #==============================================================================
  384. # Actions[10] => return to initial position (slower)
  385. #==============================================================================
  386. Actions[10] = {
  387. 'Movement' => 'return', # 'enemy' or [x, y] go to position in x and y
  388. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  389. 'Time' => 16, # in frames
  390. 'Speed' => 8, # time taken to change the frame
  391. 'Frame' => 8, # position on the spritesheet
  392. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  393. 'Looping' => true, # if the animation loops
  394. 'Mirror' => true, # if mirrored
  395. }
  396.  
  397. #==============================================================================
  398. # Actions[11] => movement to the direction: up(taking damage)
  399. #==============================================================================
  400. Actions[11] = {
  401. 'Movement' => [0, -100], # 'enemy' or [x, y] go to position in x and y
  402. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  403. 'Time' => 10, # in frames
  404. 'Speed' => 5, # time taken to change the frame
  405. 'Frame' => 3, # position on the spritesheet
  406. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  407. 'Looping' => true, # if the animation loops
  408. 'Mirror' => false, # if mirrored
  409. }
  410.  
  411. #==============================================================================
  412. # Actions[12] => movement to the direction: up(jumping)
  413. #==============================================================================
  414. Actions[12] = {
  415. 'Movement' => [0, -60], # 'enemy' or [x, y] go to position in x and y
  416. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  417. 'Time' => 10, # in frames
  418. 'Speed' => 5, # time taken to change the frame
  419. 'Frame' => 9, # position on the spritesheet
  420. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  421. 'Looping' => true, # if the animation loops
  422. 'Mirror' => false, # if mirrored
  423. }
  424. #==============================================================================
  425. # Actions[13] => movement to the direction: down(jumping)
  426. #==============================================================================
  427. Actions[13] = {
  428. 'Movement' => [0, 60], # 'enemy' or [x, y] go to position in x and y
  429. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  430. 'Time' => 10, # in frames
  431. 'Speed' => 5, # time taken to change the frame
  432. 'Frame' => 9, # position on the spritesheet
  433. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  434. 'Looping' => true, # if the animation loops
  435. 'Mirror' => false, # if mirrored
  436. }
  437. #==============================================================================
  438. # Actions[14] => movement to the direction: right(jumping)
  439. #==============================================================================
  440. Actions[14] = {
  441. 'Movement' => [30, 0], # 'enemy' or [x, y] go to position in x and y
  442. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  443. 'Time' => 10, # in frames
  444. 'Speed' => 5, # time taken to change the frame
  445. 'Frame' => 9, # position on the spritesheet
  446. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  447. 'Looping' => true, # if the animation loops
  448. 'Mirror' => false, # if mirrored
  449. }
  450. #==============================================================================
  451. # Actions[15] => movement to the direction: down(taking damage)
  452. #==============================================================================
  453. Actions[15] = {
  454. 'Movement' => [0, 30], # 'enemy' or [x, y] go to position in x and y
  455. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  456. 'Time' => 10, # in frames
  457. 'Speed' => 5, # time taken to change the frame
  458. 'Frame' => 3, # position on the spritesheet
  459. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  460. 'Looping' => true, # if the animation loops
  461. 'Mirror' => false, # if mirrored
  462. }
  463. #==============================================================================
  464. #------------------------------------------------------------------------------
  465. # Static Poses(21-40) - For organization
  466. #------------------------------------------------------------------------------
  467. #==============================================================================
  468.  
  469. #==============================================================================
  470. # Actions[21] => initial battle animation
  471. #==============================================================================
  472. Actions[21] = {
  473. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  474. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  475. 'Time' => 40, # in frames
  476. 'Speed' => 10, # time taken to change the frame
  477. 'Frame' => 7, # position on the spritesheet
  478. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  479. 'Looping' => false, # if the animation loops
  480. 'Mirror' => false, # if mirrored
  481. }
  482. #==============================================================================
  483. # Actions[22] => spell cast
  484. #==============================================================================
  485. Actions[22] = {
  486. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  487. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  488. 'Time' => 15, # in frames
  489. 'Speed' => 5, # time taken to change the frame
  490. 'Frame' => 10, # position on the spritesheet
  491. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  492. 'Looping' => false, # if the animation loops
  493. 'Mirror' => false, # if mirrored
  494. }
  495. #==============================================================================
  496. # Actions[23] => defense movement
  497. #==============================================================================
  498. Actions[23] = {
  499. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  500. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  501. 'Time' => 30, # in frames
  502. 'Speed' => 10, # time taken to change the frame
  503. 'Frame' => 1, # position on the spritesheet
  504. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  505. 'Looping' => false, # if the animation loops
  506. 'Mirror' => false, # if mirrored
  507. }
  508. #==============================================================================
  509. # Actions[24] => taking damage
  510. #==============================================================================
  511. Actions[24] = {
  512. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  513. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  514. 'Time' => 40, # in frames
  515. 'Speed' => 10, # time taken to change the frame
  516. 'Frame' => 3, # position on the spritesheet
  517. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  518. 'Looping' => false, # if the animation loops
  519. 'Mirror' => false, # if mirrored
  520. }
  521. #==============================================================================
  522. # Actions[25] => initial battle pose
  523. #==============================================================================
  524. Actions[25] = {
  525. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  526. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  527. 'Time' => 40, # in frames
  528. 'Speed' => 10, # time taken to change the frame
  529. 'Frame' => 0, # position on the spritesheet
  530. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  531. 'Looping' => false, # if the animation loops
  532. 'Mirror' => false, # if mirrored
  533. }
  534. #==============================================================================
  535. #------------------------------------------------------------------------------
  536. # Attack poses (41-and on)
  537. #------------------------------------------------------------------------------
  538. #==============================================================================
  539.  
  540. #==============================================================================
  541. # Actions[41] => attack movement 1
  542. #==============================================================================
  543. Actions[41] = {
  544. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  545. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  546. 'Time' => 22, # in frames
  547. 'Speed' => 3, # time taken to change the frame
  548. 'Frame' => 4, # position on the spritesheet
  549. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  550. 'Looping' => false, # if the animation loops
  551. 'Mirror' => false, # if mirrored
  552. }
  553. #==============================================================================
  554. # Actions[42] => attack movement 1 (mirrored)
  555. #==============================================================================
  556. Actions[42] = {
  557. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  558. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  559. 'Time' => 12, # in frames
  560. 'Speed' => 3, # time taken to change the frame
  561. 'Frame' => 4, # position on the spritesheet
  562. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  563. 'Looping' => false, # if the animation loops
  564. 'Mirror' => true, # if mirrored
  565. }
  566.  
  567. #==============================================================================
  568. # Actions[43] => attack movement 2
  569. #==============================================================================
  570. Actions[43] = {
  571. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  572. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  573. 'Time' => 12, # in frames
  574. 'Speed' => 3, # time taken to change the frame
  575. 'Frame' => 5, # position on the spritesheet
  576. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  577. 'Looping' => false, # if the animation loops
  578. 'Mirror' => false, # if mirrored
  579. }
  580. #==============================================================================
  581. # Actions[44] => attack movement 2 (mirrored)
  582. #==============================================================================
  583. Actions[44] = {
  584. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  585. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  586. 'Time' => 12, # in frames
  587. 'Speed' => 3, # time taken to change the frame
  588. 'Frame' => 5, # position on the spritesheet
  589. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  590. 'Looping' => false, # if the animation loops
  591. 'Mirror' => true, # if mirrored
  592. }
  593. #==============================================================================
  594. # Actions[45] => attack movement 3
  595. #==============================================================================
  596. Actions[45] = {
  597. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  598. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  599. 'Time' => 12, # in frames
  600. 'Speed' => 3, # time taken to change the frame
  601. 'Frame' => 6, # position on the spritesheet
  602. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  603. 'Looping' => false, # if the animation loops
  604. 'Mirror' => false, # if mirrored
  605. }
  606. #==============================================================================
  607. # Actions[46] => attack movement 3 (mirrored)
  608. #==============================================================================
  609. Actions[46] = {
  610. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  611. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  612. 'Time' => 12, # in frames
  613. 'Speed' => 3, # time taken to change the frame
  614. 'Frame' => 6, # position on the spritesheet
  615. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  616. 'Looping' => false, # if the animation loops
  617. 'Mirror' => true, # if mirrored
  618. }
  619. #==============================================================================
  620. # Actions[47] => attack movement 4
  621. #==============================================================================
  622. Actions[47] = {
  623. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  624. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  625. 'Time' => 12, # in frames
  626. 'Speed' => 3, # time taken to change the frame
  627. 'Frame' => 13, # position on the spritesheet
  628. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  629. 'Looping' => false, # if the animation loops
  630. 'Mirror' => false, # if mirrored
  631. }
  632. #==============================================================================
  633. # Actions[48] => attack movement 5(on ar)
  634. #==============================================================================
  635. Actions[48] = {
  636. 'Movement' => [0, 0], # 'enemy' or [x, y] go to position in x and y
  637. 'Jump_Height' => 30, # Max Jump Height(0 for no jump)
  638. 'Time' => 12, # in frames
  639. 'Speed' => 3, # time taken to change the frame
  640. 'Frame' => 16, # position on the spritesheet
  641. 'Frames' => 4, #Max Frame quantity of this action on the spritesheet
  642. 'Looping' => false, # if the animation loops
  643. 'Mirror' => false, # if mirrored
  644. }
  645. #==============================================================================
  646. # HERE STARTS THE SCRIPT
  647. #==============================================================================
  648.  
  649. end
  650. #==============================================================================
  651. # ** Scene_Battle
  652. #------------------------------------------------------------------------------
  653. #  Esta classe executa o processamento da tela de batalha.
  654. #==============================================================================
  655.  
  656. class Scene_Battle < Scene_Base
  657. alias :lune_anime_update :update
  658. alias :lune_anime_start :start
  659. alias :lune_anime_process_action :process_action
  660. alias :lune_anime_execute_action :execute_action
  661. alias :lune_anime_turn_end :turn_end
  662.   #--------------------------------------------------------------------------
  663.   # * Fase inicial
  664.   #--------------------------------------------------------------------------
  665.   def start(*args, &block)
  666.     @start_battler_positions = Array.new
  667.     $akea_hit_porcentage = 0
  668.     for n in 0...$game_party.battle_members.size
  669.       $game_party.battle_members[n].update_current_condition(0)
  670.       $game_party.battle_members[n].screen_y = Lune_Anime_Battle::Battle_Position[n][1]
  671.       $game_party.battle_members[n].screen_x = Lune_Anime_Battle::Battle_Position[n][0]
  672.       @start_battler_positions << [all_battle_members[n].screen_x, all_battle_members[n].screen_y]
  673.       $game_party.battle_members[n].screen_y += Lune_Anime_Battle::Start_off[1]
  674.       $game_party.battle_members[n].screen_x += Lune_Anime_Battle::Start_off[0]
  675.     end
  676.     for n in 0...$game_troop.members.size
  677.     $game_troop.members[n].update_current_condition(0)
  678.         @start_battler_positions << [$game_troop.members[n].screen_x, $game_troop.members[n].screen_y]
  679.     if Lune_Anime_Battle::Enemy[$game_troop.members[n].enemy_id]
  680.       $game_troop.members[n].screen_x -= Lune_Anime_Battle::Start_off[0]
  681.       $game_troop.members[n].screen_y -= Lune_Anime_Battle::Start_off[1]
  682.     end
  683.     end
  684.     all_battle_members.each{|member| member.insert_actions}
  685.     lune_anime_start(*args, &block)
  686.     move_initial_battlers
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # * Processamento pós-inicio
  690.   #--------------------------------------------------------------------------
  691.   def post_start
  692.     super
  693.     battle_start if @poss_start
  694.   end
  695.   #--------------------------------------------------------------------------
  696.   # * Movimento inicial dos battlers
  697.   #--------------------------------------------------------------------------
  698.   def move_initial_battlers
  699.     return if Lune_Anime_Battle::Start_off[2] == 0
  700.     for n in 0...$game_party.battle_members.size
  701.       insert_battle_commands(Lune_Anime_Battle::Start_off[2], $game_party.battle_members[n])
  702.     end
  703.     for n in 0...$game_troop.members.size
  704.       if Lune_Anime_Battle::Enemy[$game_troop.members[n].enemy_id]
  705.         insert_battle_commands(Lune_Anime_Battle::Start_off[2], $game_troop.members[n])
  706.       end
  707.     end
  708.     @poss_start = false
  709.     post_start
  710.     @poss_start = true
  711.     looping_basic_animations
  712.     if Lune_Anime_Battle::Start_all
  713.       for n in 0...$game_party.battle_members.size
  714.         insert_start_commands_anime($game_party.battle_members[n])
  715.         looping_basic_animations
  716.       end
  717.     else
  718.       @random_anim = rand($game_party.battle_members.size)
  719.       insert_start_commands_anime($game_party.battle_members[@random_anim])
  720.       looping_basic_animations
  721.     end
  722.   end
  723.   #--------------------------------------------------------------------------
  724.   # * Animações iniciais dos battlers
  725.   #--------------------------------------------------------------------------
  726.   def looping_basic_animations
  727.     loop do
  728.       move_battlers_start
  729.       Graphics.update
  730.       @spriteset.update
  731.       break if all_battle_members.count{|battler| battler.battle_actions.empty?} == all_battle_members.size
  732.     end
  733.   end
  734.   #--------------------------------------------------------------------------
  735.   # * Movimento inicial dos battlers
  736.   #--------------------------------------------------------------------------
  737.   def move_battlers_start
  738.     move_battlers
  739.     go_to_next_command = false
  740.     for n in 0...all_battle_members.size
  741.       unless all_battle_members[n].battle_actions.empty?
  742.         all_battle_members[n].decrease_timer
  743.         go_to_next_command = true
  744.         if all_battle_members[n].battle_actions.first.size == 7
  745.           show_normal_animation(all_battle_members[n].battle_actions.first[0], all_battle_members[n].battle_actions.first[1])
  746.           all_battle_members[n].remove_actions
  747.           return
  748.         end
  749.         if all_battle_members[n].battle_actions.first[2] <= 0
  750.           if all_battle_members[n].battle_actions[1] == nil
  751.             change_character_animation(all_battle_members[n].battle_actions.first[0], get_condition(n, all_battle_members[all_battle_members[n].battle_actions.first[0]].current_condition))
  752.           end
  753.           if all_battle_members[n].battle_actions[1] && all_battle_members[n].battle_actions[1].size == 13
  754.             change_character_animation(all_battle_members[n].battle_actions[1][0], [all_battle_members[n].battle_actions[1][1],all_battle_members[n].battle_actions[1][10],all_battle_members[n].battle_actions[1][3],all_battle_members[n].battle_actions[1][4], all_battle_members[n].battle_actions[1][11]])
  755.             all_battle_members[n].battle_actions[1][7] = (all_battle_members[n].battle_actions[1][5] -  all_battle_members[n].screen_x) / all_battle_members[n].battle_actions[1][9]
  756.             all_battle_members[n].battle_actions[1][8] = (all_battle_members[n].battle_actions[1][6] -  all_battle_members[n].screen_y) / all_battle_members[n].battle_actions[1][9]
  757.           end
  758.           all_battle_members[n].remove_actions
  759.         end
  760.       end
  761.     end
  762.     if go_to_next_command
  763.       return
  764.     end
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # * Execução da ação de inicio
  768.   #--------------------------------------------------------------------------
  769.   def insert_start_commands_anime(subject)
  770.     @subject = subject
  771.     battle_notes = @subject.actor.note
  772.     for n in 0...battle_notes.size - 11
  773.       if battle_notes[n..n+9] == "<movement "
  774.         y = 0
  775.         y += 1 until battle_notes[n+10+y] == '>'
  776.         insert_battle_commands(battle_notes[n+10..n+9+y].to_i, @subject)
  777.       elsif battle_notes[n..n+10] == "<animation "
  778.         y = 0
  779.         y += 1 until battle_notes[n+11+y] == '>'
  780.         insert_battle_animations(battle_notes[n+11..n+11+y].to_i, @subject)
  781.       elsif battle_notes[n..n+10] == "<castskill "
  782.         y = 0
  783.         y += 1 until battle_notes[n+11+y] == '>'
  784.         insert_self_battle_animations(battle_notes[n+11..n+11+y].to_i, @subject)
  785.       end
  786.     end
  787.   end
  788.   #--------------------------------------------------------------------------
  789.   # * Movimento dos battlers
  790.   #--------------------------------------------------------------------------
  791.   def move_battlers
  792.     for n in 0...all_battle_members.size
  793.       next if all_battle_members[n].battle_actions.empty? || all_battle_members[n].battle_actions.first.size <= 7
  794.       all_battle_members[n].execute_actions if all_battle_members.count {|battler| battler.battle_actions.size <= 1 } == all_battle_members.size || all_battle_members[n].battle_actions.size >= 2
  795.     end
  796.   end
  797.   #--------------------------------------------------------------------------
  798.   # * Obter Condição Atual
  799.   #--------------------------------------------------------------------------
  800.   def get_condition(n, condition)
  801.     if all_battle_members[n].actor?
  802.         if Lune_Anime_Battle::Actor_Conditions[all_battle_members[n].id][condition]
  803.             return Lune_Anime_Battle::Actor_Conditions[all_battle_members[n].id][condition]
  804.         else
  805.             return Lune_Anime_Battle::Conditions[condition]
  806.         end
  807.     else
  808.         if Lune_Anime_Battle::Enemy_Conditions[all_battle_members[n].enemy_id][condition]
  809.             return Lune_Anime_Battle::Enemy_Conditions[all_battle_members[n].enemy_id][condition]
  810.         else
  811.             return Lune_Anime_Battle::Conditions[condition]
  812.         end
  813.     end
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # * Atualização de batalha
  817.   #--------------------------------------------------------------------------
  818.   def update(*args, &block)
  819.     if $game_troop.all_dead?
  820.       for n in 0...all_battle_members.size
  821.         change_character_animation(n, Lune_Anime_Battle::Standard['Victory']) if all_battle_members[n].alive?
  822.       end
  823.       @adp_pics.each{|pic| pic.opacity = 0} if $imported[:akea_battledamage]
  824.       BattleManager.process_victory
  825.     end
  826.     move_battlers
  827.     go_to_next_command = false
  828.     for n in 0...all_battle_members.size
  829.       unless all_battle_members[n].battle_actions.empty?
  830.         if all_battle_members[n].battle_actions.first[0] == "Wait_For" && all_battle_members[n].battle_actions.first[2] >= 1
  831.           all_battle_members[n].decrease_timer
  832.           p all_battle_members[n].battle_actions.first[2]
  833.           next
  834.         elsif all_battle_members[n].battle_actions.first[0] == "Script_Call" && all_battle_members[n].battle_actions.first[2] == 1
  835.           all_battle_members[n].decrease_timer
  836.           conf = Lune_Anime_Battle::Script_Call[all_battle_members[n].battle_actions.first[1]]
  837.           eval(conf)
  838.           if all_battle_members[n].battle_actions.first.size == 13 && all_battle_members[n].battle_actions.size > 1
  839.             change_character_animation(all_battle_members[n].battle_actions[0][0], [all_battle_members[n].battle_actions[0][1],all_battle_members[n].battle_actions[0][10],all_battle_members[n].battle_actions[0][3],all_battle_members[n].battle_actions[0][4], all_battle_members[n].battle_actions[0][11]])
  840.           end
  841.           next
  842.         elsif all_battle_members[n].battle_actions.first[0] == "Make_Hit"
  843.           $akea_hit_porcentage = all_battle_members[n].battle_actions.first[1]
  844.           use_item
  845.           $akea_hit_porcentage = 0
  846.           all_battle_members[n].remove_actions
  847.           next
  848.         elsif all_battle_members[n].battle_actions.first[0] == "Movie" && all_battle_members[n].battle_actions.first[2] == 1
  849.           all_battle_members[n].decrease_timer
  850.           Graphics.play_movie('Movies/' + all_battle_members[n].battle_actions.first[3])
  851.           all_battle_members[n].remove_actions
  852.           next
  853.         end
  854.         if all_battle_members[n].battle_actions.first[0].is_a?(Integer) && all_battle_members[n].battle_actions.first[0] != n
  855.           all_battle_members[all_battle_members[n].battle_actions[0][0]].insert_actions(all_battle_members[n].battle_actions.first)
  856.           all_battle_members[n].remove_actions
  857.           return
  858.         end
  859.         all_battle_members[n].decrease_timer if all_battle_members.count {|battler| battler.battle_actions.size <= 1 } == all_battle_members.size || all_battle_members[n].battle_actions.size >= 2
  860.         go_to_next_command = true
  861.         if all_battle_members[n].battle_actions.first.size == 7 && all_battle_members[n].battle_actions.first[2] == $data_animations[all_battle_members[n].battle_actions.first[1]].frame_max - 1
  862.           show_normal_animation(all_battle_members[n].battle_actions.first[0], all_battle_members[n].battle_actions.first[1])
  863.           next
  864.         elsif all_battle_members[n].battle_actions.first.size == 7 && all_battle_members[n].battle_actions.first[2] == 0
  865.           all_battle_members[n].remove_actions
  866.           if all_battle_members[n].battle_actions.first.size == 13
  867.             change_character_animation(all_battle_members[n].battle_actions[0][0], [all_battle_members[n].battle_actions[0][1],all_battle_members[n].battle_actions[0][10],all_battle_members[n].battle_actions[0][3],all_battle_members[n].battle_actions[0][4], all_battle_members[n].battle_actions[0][11]])
  868.           end
  869.         end
  870.         if all_battle_members[n].battle_actions.first[2] <= 0
  871.           if all_battle_members[n].battle_actions[1] == nil
  872.             change_character_animation(all_battle_members[n].battle_actions.first[0], get_condition(n, all_battle_members[all_battle_members[n].battle_actions.first[0]].current_condition))
  873.           else
  874.             if all_battle_members.count {|battler| battler.battle_actions.size <= 2 } == all_battle_members.size
  875.               unless @akea_on_battle_moves
  876.                 all_battle_members[n].remove_actions if  all_battle_members[n].battle_actions.size <= 2
  877.                 next
  878.               end
  879.               process_event
  880.               lune_anime_process_action  
  881.               @akea_on_battle_moves = false
  882.               all_battle_members.each{|m| change_character_animation(m.battle_actions[0][0], [m.battle_actions[0][1],m.battle_actions[0][10],m.battle_actions[0][3],m.battle_actions[0][4], m.battle_actions[0][11]]) unless m.battle_actions.empty?}
  883.             end
  884.           end
  885.           if all_battle_members[n].battle_actions[1] && all_battle_members[n].battle_actions[1].size == 13
  886.             if @akea_on_battle_moves && all_battle_members[n].battle_actions.size <= 2
  887.               all_battle_members[n].remove_actions
  888.               next
  889.             end
  890.             change_character_animation(all_battle_members[n].battle_actions[1][0], [all_battle_members[n].battle_actions[1][1],all_battle_members[n].battle_actions[1][10],all_battle_members[n].battle_actions[1][3],all_battle_members[n].battle_actions[1][4], all_battle_members[n].battle_actions[1][11]])
  891.             all_battle_members[n].battle_actions[1][7] = (all_battle_members[n].battle_actions[1][5] -  all_battle_members[n].screen_x) / all_battle_members[n].battle_actions[1][9]
  892.             all_battle_members[n].battle_actions[1][8] = (all_battle_members[n].battle_actions[1][6] -  all_battle_members[n].screen_y) / all_battle_members[n].battle_actions[1][9]
  893.           end
  894.           all_battle_members[n].remove_actions
  895.         end
  896.       end
  897.     end
  898.     if go_to_next_command
  899.       super
  900.       return
  901.     end
  902.     lune_anime_update(*args, &block) if all_battle_members.count {|battler| battler.battle_actions.size <= 1 } == all_battle_members.size
  903.   end
  904.   #--------------------------------------------------------------------------
  905.   # * Processamento de ações
  906.   #--------------------------------------------------------------------------
  907.   def process_action
  908.     if !@subject || !@subject.current_action
  909.       @atbs_actions = []
  910.       @subject = BattleManager.next_subject
  911.       @reuse_targets = @subject.current_action.make_targets.compact if @subject && @subject.current_action
  912.       if @subject && (@subject.actor? || Lune_Anime_Battle::Enemy[@subject.enemy_id]) && @subject.current_action
  913.         battle_notes = @subject.current_action.item.note
  914.         if @subject.current_action.item.id == 1 && @subject.actor? && @subject.equips[0] && @subject.current_action.item.is_a?(RPG::Skill)
  915.           battle_notes = @subject.equips[0].note
  916.         end
  917.         @akea_on_battle_moves = true
  918.         if battle_notes.include?('<teamskill') && $imported[:akea_team_battle]
  919.           atbs_team_skill(battle_notes)
  920.           return
  921.         end
  922.         for n in 0...battle_notes.size - 11
  923.           if battle_notes[n..n+9] == "<movement "
  924.             y = 0
  925.             y += 1 until battle_notes[n+10+y] == '>'
  926.             insert_battle_commands(battle_notes[n+10..n+9+y].to_i)
  927.           elsif battle_notes[n..n+9] == "<wait_for "
  928.             y = 0
  929.             y += 1 until battle_notes[n+10+y] == '>'
  930.             insert_battle_wait(battle_notes[n+10..n+9+y].to_i)
  931.           elsif battle_notes[n..n+9] == "<wait_tar "
  932.             y = 0
  933.             y += 1 until battle_notes[n+10+y] == '>'
  934.             for z in 0...@reuse_targets.size
  935.               old_subject = @subject
  936.               insert_battle_wait(battle_notes[n+10..n+9+y].to_i,@reuse_targets[z])
  937.               @subject = old_subject
  938.             end
  939.           elsif battle_notes[n..n+9] == "<move_hit "
  940.             y = 0
  941.             y += 1 until battle_notes[n+10+y] == '>'
  942.             for z in 0...@reuse_targets.size
  943.               old_subject = @subject
  944.               insert_battle_commands(battle_notes[n+10..n+9+y].to_i, @reuse_targets[z], @subject)
  945.               @subject = old_subject
  946.             end
  947.           elsif battle_notes[n..n+11] == "<scriptcall "
  948.             y = 0
  949.             y += 1 until battle_notes[n+12+y] == '>'
  950.             insert_battle_script(battle_notes[n+12..n+11+y].to_i)
  951.           elsif battle_notes[n..n+9] == "<make_hit "
  952.             y = 0
  953.             y += 1 until battle_notes[n+10+y] == '>'
  954.             insert_battle_damage(battle_notes[n+10..n+9+y].to_i)
  955.           elsif battle_notes[n..n+10] == "<a_special "
  956.             msgbox("Requires Akea Special Skill!!") unless $imported[:akea_special_skill]
  957.             y = 0
  958.             y += 1 until battle_notes[n+11+y] == '>'
  959.             insert_akea_special(battle_notes[n+11..n+11+y].to_i)
  960.             targets = @subject.current_action.make_targets.compact
  961.             $game_troop.members.each {|troop| @spriteset.enemy_opacity($game_troop.members.index(troop), 0) unless targets.include?(troop)}
  962.             $game_party.members.each {|actor| @spriteset.actor_opacity($game_party.members.index(actor), 0) unless @subject == actor}
  963.           elsif battle_notes[n..n+10] == "<animation "
  964.             y = 0
  965.             y += 1 until battle_notes[n+11+y] == '>'
  966.             insert_battle_animations(battle_notes[n+11..n+11+y].to_i)
  967.           elsif battle_notes[n..n+10] == "<playmovie "
  968.             y = 0
  969.             y += 1 until battle_notes[n+11+y] == '>'
  970.             insert_battle_animations(battle_notes[n+11..n+11+y])
  971.           elsif battle_notes[n..n+10] == "<castskill "
  972.             y = 0
  973.             y += 1 until battle_notes[n+11+y] == '>'
  974.             insert_self_battle_animations(battle_notes[n+11..n+11+y].to_i)
  975.           elsif battle_notes[n..n+10] == "<condition "
  976.             y = 0
  977.             y += 1 until battle_notes[n+11+y] == '>'
  978.             all_battle_members[@subject.index].current_condition = battle_notes[n+11..n+11+y].to_i
  979.           end
  980.         end
  981.         return
  982.       end
  983.     end
  984.     lune_anime_process_action
  985.   end
  986.  
  987.  
  988.   #--------------------------------------------------------------------------
  989.   # * Adicionando animações do usuário
  990.   #--------------------------------------------------------------------------
  991.   def insert_battle_commands(n = 1, subject = nil, enen = nil)
  992.     @subject = subject if subject
  993.     action = Lune_Anime_Battle::Actions[n]
  994.     enemy = @reuse_targets
  995.     if action['Movement'].is_a?(String)
  996.       if action['Movement'] == 'enemy'
  997.         if @subject.actor?
  998.           x = enemy.first.screen_x + Lune_Anime_Battle::Offset_X
  999.           y = enemy.first.screen_y + Lune_Anime_Battle::Offset_Y
  1000.         else
  1001.           x = enemy.first.screen_x + Lune_Anime_Battle::E_Offset_X
  1002.           y = enemy.first.screen_y + Lune_Anime_Battle::E_Offset_Y
  1003.         end
  1004.       else
  1005.         index = 0
  1006.         if @subject.enemy?
  1007.           index += $game_party.battle_members.size
  1008.         end
  1009.         x = @start_battler_positions[@subject.index + index][0]
  1010.         y = @start_battler_positions[@subject.index + index][1]
  1011.       end
  1012.     else
  1013.       reserve_battle_actions = @subject.battle_actions.dup
  1014.       reserve_battle_actions.pop until reserve_battle_actions.empty? || reserve_battle_actions.last[0] == all_battle_members.index(@subject)
  1015.       if reserve_battle_actions.empty?
  1016.         x = action['Movement'][0] + @subject.screen_x
  1017.         y = action['Movement'][1] + @subject.screen_y
  1018.         if @subject.enemy?
  1019.           x -= action['Movement'][0] * 2
  1020.         end
  1021.       else
  1022.         x = action['Movement'][0] + reserve_battle_actions.last[5]
  1023.         y = action['Movement'][1] + reserve_battle_actions.last[6]
  1024.         if @subject.enemy?
  1025.           x -= action['Movement'][0] * 2
  1026.           y -= action['Movement'][1] * 2
  1027.         end
  1028.       end
  1029.     end
  1030.       get_to_x = (x -  @subject.screen_x) / action['Time']
  1031.       get_to_y = (y -  @subject.screen_y)  / action['Time']
  1032.     if enen
  1033.       if enen.actor?
  1034.         @subject.insert_actions([all_battle_members.index(@subject),action['Frame'], action['Time'], action['Frames'], action['Looping'], x, y, get_to_x, get_to_y, action['Time'], action['Speed'], action['Mirror'], action['Jump_Height']])
  1035.       else
  1036.         enen.insert_actions([all_battle_members.index(@subject),action['Frame'], action['Time'], action['Frames'], action['Looping'], x, y, get_to_x, get_to_y, action['Time'], action['Speed'], action['Mirror'], action['Jump_Height']])
  1037.       end
  1038.     else
  1039.       @subject.insert_actions([all_battle_members.index(@subject),action['Frame'], action['Time'], action['Frames'], action['Looping'], x, y, get_to_x, get_to_y, action['Time'], action['Speed'], action['Mirror'], action['Jump_Height']])
  1040.       change_character_animation(@subject.battle_actions[0][0], [@subject.battle_actions[0][1],@subject.battle_actions[0][10],@subject.battle_actions[0][3],@subject.battle_actions[0][4], @subject.battle_actions[0][11]])
  1041.     end
  1042.   end
  1043.   #--------------------------------------------------------------------------
  1044.   # * Adicionando animações de batalha
  1045.   #--------------------------------------------------------------------------
  1046.   def insert_battle_animations(n = 0, dmg = 0)
  1047.     enemy = @reuse_targets
  1048.     if n == 0
  1049.       @subject.insert_actions(["Make_Hit", dmg])
  1050.     elsif n.is_a?(String)
  1051.       @subject.insert_actions(["Movie", dmg, 1, n])
  1052.     else
  1053.       @subject.insert_actions([enemy, n])
  1054.       @subject.battle_actions.last[2] = $data_animations[n].frame_max
  1055.     end
  1056.     if @subject.battle_actions.size == 1
  1057.       @subject.battle_actions.last[5] = 0
  1058.       @subject.battle_actions.last[6] = 0
  1059.     else
  1060.       @subject.battle_actions.last[5] = @subject.battle_actions[@subject.battle_actions.size - 2][5]
  1061.       @subject.battle_actions.last[6] = @subject.battle_actions[@subject.battle_actions.size - 2][6]
  1062.       @subject.insert_actions(@subject.battle_actions[@subject.battle_actions.size - 2])
  1063.     end
  1064.   end
  1065.   def insert_battle_damage(n)
  1066.     insert_battle_animations(0, n)
  1067.   end
  1068.   def insert_battle_script(n)
  1069.     @subject.insert_actions(["Script_Call", n, 1])
  1070.   end
  1071.   def insert_battle_wait(n, sub = nil)
  1072.     if sub
  1073.       sub.insert_actions(["Wait_For", 0, n])
  1074.     else
  1075.       @subject.insert_actions(["Wait_For", 0, n])
  1076.     end
  1077.    
  1078.   end
  1079.   #--------------------------------------------------------------------------
  1080.   # * Adicionando animações no usuário
  1081.   #--------------------------------------------------------------------------
  1082.   def insert_self_battle_animations(n = 0)
  1083.     enemy = [@subject]
  1084.      @subject.insert_actions([enemy, n])
  1085.     last_battler = false
  1086.     @subject.battle_actions.last[2] = $data_animations[n].frame_max
  1087.     for n in 0... @subject.battle_actions.size - 1
  1088.       last_battler = n if @subject.battle_actions[n][0] == @subject.index
  1089.     end
  1090.     if  @subject.battle_actions.size == 1 || !last_battler
  1091.        @subject.battle_actions.last[5] = 0
  1092.        @subject.battle_actions.last[6] = 0
  1093.      else
  1094.       @subject.battle_actions.last[5] = @subject.battle_actions[last_battler][5]
  1095.       @subject.battle_actions.last[6] = @subject.battle_actions[last_battler][6]
  1096.       @subject.insert_actions(@subject.battle_actions[last_battler])
  1097.     end
  1098.   end
  1099.   #--------------------------------------------------------------------------
  1100.   # * Mudar a Sprite de batalha
  1101.   #--------------------------------------------------------------------------
  1102.   def change_character_animation(id, array)
  1103.     if array.is_a?(Integer)
  1104.       array = get_condition(id, array)
  1105.     end
  1106.     return if array[1] == nil
  1107.     all_battle_members[id].condition_time = array[6] if array[6] && all_battle_members[id].condition_time == 0
  1108.     all_battle_members[id].change_stance(array[0])
  1109.     all_battle_members[id].change_frames(array[1],array[2])
  1110.     all_battle_members[id].mirror_battler(array[4])
  1111.     all_battle_members[id].battler_loops?(array[3])
  1112.     all_battle_members[id].reset_count = true unless all_battle_members[id].dead?
  1113.   end
  1114.   #--------------------------------------------------------------------------
  1115.   # * Uso de habilidades/itens
  1116.   #--------------------------------------------------------------------------
  1117.   def use_item
  1118.     targets = @reuse_targets
  1119.     item = @subject.current_action.item
  1120.     if item.damage.type != 0 && item.damage.type != 3
  1121.       dm = Lune_Anime_Battle::Standard['Damage']
  1122.       targets.each {|target|
  1123.         change_character_animation(all_battle_members.index(target), dm)
  1124.       }
  1125.     end
  1126.     @log_window.display_use_item(@subject, item) if $akea_hit_porcentage == 0 || Lune_Anime_Battle::Show_On_Log
  1127.     @subject.use_item(item)
  1128.     refresh_status
  1129.     show_animation(targets, item.animation_id) if $akea_hit_porcentage == 0
  1130.     targets.each {|target| item.repeats.times { invoke_item(target, item) }}
  1131.     if $game_troop.all_dead? && $akea_hit_porcentage == 0
  1132.       for n in 0...all_battle_members.size
  1133.         change_character_animation(n, Lune_Anime_Battle::Standard['Victory']) if all_battle_members[n].alive?
  1134.       end
  1135.     end
  1136.   end
  1137.  
  1138.   #--------------------------------------------------------------------------
  1139.   # * Execução da ação
  1140.   #--------------------------------------------------------------------------
  1141.   def execute_action
  1142.     lune_anime_execute_action
  1143.     return if $game_troop.all_dead?
  1144.      for n in 0...all_battle_members.size
  1145.        all_battle_members[n].current_hp_condition
  1146.        change_character_animation(n, get_condition(n, all_battle_members[n].current_condition))
  1147.      end
  1148.   end
  1149.   #--------------------------------------------------------------------------
  1150.   # * Final do turno
  1151.   #--------------------------------------------------------------------------
  1152.   def turn_end
  1153.     for n in 0...all_battle_members.size
  1154.       all_battle_members[n].condition_turn
  1155.       all_battle_members[n].update_current_condition(1)
  1156.       change_character_animation(n, get_condition(n, all_battle_members[n].current_condition))
  1157.     end
  1158.     lune_anime_turn_end
  1159.   end
  1160. end
  1161.  
  1162.  
  1163.  
  1164. #==============================================================================
  1165. # ** Game_Enemy
  1166. #------------------------------------------------------------------------------
  1167. #  Esta classe gerencia os inimigos. Ela é utilizada internamente pela
  1168. # classe Game_Troop ($game_troop).
  1169. #==============================================================================
  1170.  
  1171. class Game_Enemy < Game_Battler
  1172. alias :lunemy_anime_initialize :initialize
  1173.   #--------------------------------------------------------------------------
  1174.   # * Aquisição da ID da animação de ataque normal
  1175.   #--------------------------------------------------------------------------
  1176.   def atk_animation_id1
  1177.     0
  1178.   end
  1179.   #--------------------------------------------------------------------------
  1180.   # * Aquisição da ID da animação de ataque normal
  1181.   #--------------------------------------------------------------------------
  1182.   def atk_animation_id2
  1183.     0
  1184.   end
  1185.   attr_accessor :current_position
  1186.   attr_accessor :frame_count
  1187.   attr_accessor :frame_rate
  1188.   attr_accessor :frame_index
  1189.   attr_accessor :battler_mirror
  1190.   attr_accessor :looping_animation
  1191.   attr_accessor :reset_count
  1192.   #--------------------------------------------------------------------------
  1193.   # * Inicialização do objeto
  1194.   #     actor_id : ID do herói
  1195.   #--------------------------------------------------------------------------
  1196.   def initialize(index, enemy_id)
  1197.     lunemy_anime_initialize(index, enemy_id)
  1198.     @battler_name = Lune_Anime_Battle::Enemy_Poses[enemy_id] if Lune_Anime_Battle::Enemy_Poses[enemy_id]
  1199.     @frame_count = 0
  1200.     @frame_rate = 0
  1201.     @current_position = 0
  1202.     @battler_mirror = false
  1203.     @looping_animation = 1
  1204.     @reset_count == true
  1205.   end
  1206.   #--------------------------------------------------------------------------
  1207.   # * Definição de uso de sprites
  1208.   #--------------------------------------------------------------------------
  1209.   def use_sprite?
  1210.     return true
  1211.   end
  1212.   #--------------------------------------------------------------------------
  1213.   # * Aquisição do coordenada Z na tela
  1214.   #--------------------------------------------------------------------------
  1215.   def screen_z
  1216.     return 110
  1217.   end
  1218.   #--------------------------------------------------------------------------
  1219.   # * Mudança de pose
  1220.   #--------------------------------------------------------------------------
  1221.   def change_stance(n)
  1222.     @current_position = n
  1223.   end
  1224.   #--------------------------------------------------------------------------
  1225.   # * Mudança de frames
  1226.   #--------------------------------------------------------------------------
  1227.   def change_frames(rate, index)
  1228.     @frame_count = 0
  1229.     @frame_rate = rate
  1230.     @frame_index = index
  1231.   end
  1232.   #--------------------------------------------------------------------------
  1233.   # * Espelhar o personagem?
  1234.   #--------------------------------------------------------------------------
  1235.   def mirror_battler(mirror = false)
  1236.     @battler_mirror = mirror
  1237.   end
  1238.   #--------------------------------------------------------------------------
  1239.   # * Loops?
  1240.   #--------------------------------------------------------------------------
  1241.   def battler_loops?(loop = 1)
  1242.     @looping_animation = loop
  1243.   end
  1244. end
  1245.  
  1246. #==============================================================================
  1247. # ** Spriteset_Battle
  1248. #------------------------------------------------------------------------------
  1249. #  Esta classe reune os sprites da tela de batalha. Esta classe é usada
  1250. # internamente pela classe Scene_Battle.
  1251. #==============================================================================
  1252.  
  1253. class Spriteset_Battle
  1254.   #--------------------------------------------------------------------------
  1255.   # * Criação dos sprites dos heróis
  1256.   #    Por padrão, não são exibidas imagens para os heróis.
  1257.   #--------------------------------------------------------------------------
  1258.   def create_actors
  1259.     @actor_sprites = $game_party.members.reverse.collect do |actor|
  1260.       Sprite_Battler.new(@viewport1, actor)
  1261.     end
  1262.   end
  1263. end
  1264.  
  1265. #==============================================================================
  1266. # ** Game_Actor
  1267. #------------------------------------------------------------------------------
  1268. #  Esta classe gerencia os heróis. Ela é utilizada internamente pela classe
  1269. # Game_Actors ($game_actors). A instância desta classe é referenciada
  1270. # pela classe Game_Party ($game_party).
  1271. #==============================================================================
  1272. class Game_Actor < Game_Battler
  1273. alias :lune_anime_initialize :initialize
  1274.   attr_accessor :current_position
  1275.   attr_accessor :frame_count
  1276.   attr_accessor :frame_rate
  1277.   attr_accessor :frame_index
  1278.   attr_accessor :battler_mirror
  1279.   attr_accessor :looping_animation
  1280.   attr_accessor :reset_count
  1281.   #--------------------------------------------------------------------------
  1282.   # * Inicialização do objeto
  1283.   #     actor_id : ID do herói
  1284.   #--------------------------------------------------------------------------
  1285.   def initialize(actor_id)
  1286.     lune_anime_initialize(actor_id)
  1287.     @battler_name = Lune_Anime_Battle::Battle_Poses[actor_id]
  1288.     @frame_count = 0
  1289.     @frame_rate = 0
  1290.     @current_position = 0
  1291.     @battler_mirror = false
  1292.     @looping_animation = 1
  1293.     @reset_count == true
  1294.   end
  1295.   #--------------------------------------------------------------------------
  1296.   # * Definição de uso de sprites
  1297.   #--------------------------------------------------------------------------
  1298.   def use_sprite?
  1299.     return true
  1300.   end
  1301.   #--------------------------------------------------------------------------
  1302.   # * Aquisição do coordenada Z na tela
  1303.   #--------------------------------------------------------------------------
  1304.   def screen_z
  1305.     return 110
  1306.   end
  1307.   #--------------------------------------------------------------------------
  1308.   # * Mudança de pose
  1309.   #--------------------------------------------------------------------------
  1310.   def change_stance(n)
  1311.     @current_position = n
  1312.   end
  1313.   #--------------------------------------------------------------------------
  1314.   # * Mudança de frames
  1315.   #--------------------------------------------------------------------------
  1316.   def change_frames(rate, index)
  1317.     @frame_count = 0
  1318.     @frame_rate = rate
  1319.     @frame_index = index
  1320.   end
  1321.   #--------------------------------------------------------------------------
  1322.   # * Espelhar o personagem?
  1323.   #--------------------------------------------------------------------------
  1324.   def mirror_battler(mirror = false)
  1325.     @battler_mirror = mirror
  1326.   end
  1327.   #--------------------------------------------------------------------------
  1328.   # * Loops?
  1329.   #--------------------------------------------------------------------------
  1330.   def battler_loops?(loop = 1)
  1331.     @looping_animation = loop
  1332.   end
  1333.  
  1334. end
  1335.  
  1336. #==============================================================================
  1337. # ** Sprite_Battler
  1338. #------------------------------------------------------------------------------
  1339. #  Este sprite é usado para exibir lutadores. Ele observa uma instância
  1340. # da classe Game_Battler e automaticamente muda as condições do sprite.
  1341. #==============================================================================
  1342.  
  1343. class Sprite_Battler < Sprite_Base
  1344. alias :lune_animation_initialize :initialize
  1345. alias :lune_anime_update_bitmap :update_bitmap
  1346. alias :lune_anime_revert_to_normal :revert_to_normal
  1347.  
  1348.   #--------------------------------------------------------------------------
  1349.   # * Inicialização do processo
  1350.   #--------------------------------------------------------------------------
  1351.   def initialize(viewport, battler = nil)
  1352.     lune_animation_initialize(viewport, battler)
  1353.     @charac_index = 0
  1354.     @charac_pattern = 0
  1355.     if @battler.actor? || Lune_Anime_Battle::Enemy[@battler.enemy_id]
  1356.       @battler.frame_index = get_condition(Lune_Anime_Battle::Standard['Stand'], 2)
  1357.       @battler.frame_rate = get_condition(Lune_Anime_Battle::Standard['Stand'], 1)
  1358.       @battler.frame_count = 0
  1359.       @battler.current_position = get_condition(Lune_Anime_Battle::Standard['Stand'], 0)
  1360.     end
  1361.   end
  1362.   def get_condition(condition, n)
  1363.     if @battler.actor?
  1364.         if Lune_Anime_Battle::Actor_Conditions[@battler.id][condition]
  1365.             return Lune_Anime_Battle::Actor_Conditions[@battler.id][condition][n]
  1366.         else
  1367.             return Lune_Anime_Battle::Conditions[condition][n]
  1368.         end
  1369.     else
  1370.         if Lune_Anime_Battle::Enemy_Conditions[@battler.enemy_id][condition]
  1371.             return Lune_Anime_Battle::Enemy_Conditions[@battler.enemy_id][condition][n]
  1372.         else
  1373.             return Lune_Anime_Battle::Conditions[condition][n]
  1374.         end
  1375.     end
  1376.   end
  1377.   #--------------------------------------------------------------------------
  1378.   # * Atualização do retângulo de origem
  1379.   #--------------------------------------------------------------------------
  1380.   def update_battler_position
  1381.     update_battler_movement
  1382.     if @battler.enemy?
  1383.       @cut_w = bitmap.width / Lune_Anime_Battle::Enemy[battler.enemy_id]['Frames']
  1384.       @cut_h = bitmap.height / Lune_Anime_Battle::Enemy[battler.enemy_id]['Positions']
  1385.     else
  1386.       @cut_w = bitmap.width / Lune_Anime_Battle::Actor[battler.id]['Frames']
  1387.       @cut_h = bitmap.height / Lune_Anime_Battle::Actor[battler.id]['Positions']
  1388.     end
  1389.     sx = @charac_index * @cut_w
  1390.     sy = @battler.current_position * @cut_h
  1391.     self.src_rect.set(sx, sy, @cut_w, @cut_h)
  1392.   end
  1393.   #--------------------------------------------------------------------------
  1394.   # * Atualização do frame
  1395.   #--------------------------------------------------------------------------
  1396.   def update_battler_movement
  1397.     if @battler.reset_count == true
  1398.       @charac_index = 0
  1399.       @battler.reset_count = false
  1400.     end
  1401.     @battler.frame_count += 1
  1402.     self.mirror = @battler.battler_mirror
  1403.     return unless @battler.frame_count % @battler.frame_rate == 0
  1404.     if @battler.looping_animation == 2
  1405.       if @charac_index == (@battler.frame_index - 1)
  1406.         @battler.looping_condition = true
  1407.         @charac_index -= 1
  1408.       elsif @charac_index < (@battler.frame_index - 1)
  1409.         @battler.looping_condition = false if @charac_index == 0
  1410.         @battler.looping_condition ? @charac_index -= 1 : @charac_index += 1
  1411.       end
  1412.     elsif @charac_index == (@battler.frame_index - 1) && @battler.looping_animation == 1
  1413.       @charac_index = 0
  1414.     elsif @charac_index < (@battler.frame_index - 1)
  1415.       @charac_index += 1
  1416.     end
  1417.   end
  1418.   #--------------------------------------------------------------------------
  1419.   # * Atualização do bitmap de origem
  1420.   #--------------------------------------------------------------------------
  1421.   def update_bitmap
  1422.     lune_anime_update_bitmap
  1423.     update_battler_position if @battler.actor? || Lune_Anime_Battle::Enemy[@battler.enemy_id]
  1424.   end
  1425.   #--------------------------------------------------------------------------
  1426.   # * Atualização da origem
  1427.   #--------------------------------------------------------------------------
  1428.   def update_origin
  1429.     if bitmap
  1430.       if @battler.enemy? && !Lune_Anime_Battle::Enemy[@battler.enemy_id]
  1431.         self.ox = bitmap.width / 2
  1432.         self.oy = bitmap.height
  1433.       elsif @battler.enemy?
  1434.         self.ox = bitmap.width / (2* Lune_Anime_Battle::Enemy[battler.enemy_id]['Frames'])
  1435.         self.oy = bitmap.height / Lune_Anime_Battle::Enemy[battler.enemy_id]['Positions']
  1436.       else
  1437.         self.ox = bitmap.width / (2* Lune_Anime_Battle::Actor[battler.id]['Frames'])
  1438.         self.oy = bitmap.height / Lune_Anime_Battle::Actor[battler.id]['Positions']
  1439.       end
  1440.     end
  1441.   end
  1442.   #--------------------------------------------------------------------------
  1443.   # * Voltar ao normal
  1444.   #--------------------------------------------------------------------------
  1445.   def revert_to_normal
  1446.     lune_anime_revert_to_normal
  1447.     return if (@battler.enemy? && !Lune_Anime_Battle::Enemy[@battler.enemy_id]) || !bitmap
  1448.     if @battler.enemy?
  1449.       self.ox = bitmap.width / (2* Lune_Anime_Battle::Enemy[battler.enemy_id]['Frames'])
  1450.     else
  1451.       self.ox = bitmap.width / (2* Lune_Anime_Battle::Actor[battler.id]['Frames'])
  1452.     end
  1453.   end
  1454.   #--------------------------------------------------------------------------
  1455.   # * Atualização do efeito de colapso
  1456.   #--------------------------------------------------------------------------
  1457.   def update_collapse
  1458.     return unless @battler.enemy?
  1459.     self.blend_type = 1
  1460.     self.color.set(255, 128, 128, 128)
  1461.     self.opacity = 256 - (48 - @effect_duration) * 6
  1462.   end
  1463. end
  1464. #==============================================================================
  1465. # ** Game_Battler
  1466. #------------------------------------------------------------------------------
  1467. #  Esta classe gerencia os battlers. Controla a adição de sprites e ações
  1468. # dos lutadores durante o combate.
  1469. # É usada como a superclasse das classes Game_Enemy e Game_Actor.
  1470. #==============================================================================
  1471.  
  1472. class Game_Battler < Game_BattlerBase
  1473. alias :lune_anime_initialize_b :initialize
  1474. alias :lune_anime_execute :execute_damage
  1475.   attr_accessor   :current_condition
  1476.   attr_reader     :battler_wait
  1477.   attr_accessor   :screen_x
  1478.   attr_accessor   :screen_y
  1479.   attr_accessor   :battle_actions
  1480.   attr_accessor   :condition_time
  1481.   attr_accessor   :looping_condition
  1482.   attr_accessor   :jump_height
  1483.   #--------------------------------------------------------------------------
  1484.   # * Inicialização do objeto
  1485.   #--------------------------------------------------------------------------
  1486.   def initialize
  1487.     lune_anime_initialize_b
  1488.     @battle_actions = Array.new
  1489.     @battler_wait = 0
  1490.     @screen_x = 0
  1491.     @screen_y = 0
  1492.     @condition_time = 0
  1493.     @starting_battle_x = 0
  1494.     @starting_battle_y = 0
  1495.     @jump_height = 0
  1496.     @looping_condition = false
  1497.     @current_condition = Lune_Anime_Battle::Standard['Stand']
  1498.   end
  1499.   def current_hp_condition
  1500.     hp_calc = self.hp * 100 / self.mhp
  1501.     if hp_calc > Lune_Anime_Battle::Hp
  1502.       @current_condition = Lune_Anime_Battle::Standard['Stand'] if @current_condition == Lune_Anime_Battle::Standard['Dead'] || @current_condition == Lune_Anime_Battle::Standard['Stand']
  1503.       return Lune_Anime_Battle::Standard['Stand']
  1504.     elsif self.hp != 0
  1505.       @current_condition = Lune_Anime_Battle::Standard['Weak'] if @current_condition == Lune_Anime_Battle::Standard['Dead'] || @current_condition == Lune_Anime_Battle::Standard['Stand']
  1506.       return Lune_Anime_Battle::Standard['Weak']
  1507.     else
  1508.       @current_condition = Lune_Anime_Battle::Standard['Dead']
  1509.       @battle_actions = []
  1510.       return Lune_Anime_Battle::Standard['Dead']
  1511.     end  
  1512.   end
  1513.   def update_current_condition(condition)
  1514.     if self.hp == 0 || condition == 0 || @condition_time <= 0
  1515.       @current_condition = current_hp_condition
  1516.       @condition_time = 0
  1517.       return
  1518.     end
  1519.   end
  1520.   def insert_actions(array = 0)
  1521.     if array == 0
  1522.       @starting_battle_x = self.screen_x
  1523.       @starting_battle_y = self.screen_y
  1524.       @battle_actions = []
  1525.     else
  1526.       @battle_actions << array
  1527.     end
  1528.     @looping_condition = false
  1529.   end
  1530.   def unshift_actions(array = 0)
  1531.     if array == 0
  1532.       @battle_actions = []
  1533.     else
  1534.       @battle_actions.unshift(array)
  1535.     end
  1536.     @looping_condition = false
  1537.   end
  1538.   def execute_actions
  1539.     return if @battle_actions.empty?
  1540.     self.screen_x += @battle_actions.first[7]
  1541.     self.screen_y += @battle_actions.first[8] + get_jump_height
  1542.     if @battle_actions.first[2] <= 1
  1543.       self.screen_x = @battle_actions.first[5]
  1544.       self.screen_y = @battle_actions.first[6]
  1545.       @starting_battle_x = self.screen_x
  1546.       @starting_battle_y = self.screen_y
  1547.     end
  1548.   end
  1549.   def get_jump_height
  1550.     if @battle_actions.first[5] < @starting_battle_x
  1551.       jump_peak = (@starting_battle_x - @battle_actions.first[5])/2
  1552.       jump_peak += @battle_actions.first[5]
  1553.       pos_x = (jump_peak - self.screen_x).to_f / [jump_peak, 1].max
  1554.       [@battle_actions.first[12] * pos_x, @battle_actions.first[12]].min
  1555.     else
  1556.       jump_peak = (@battle_actions.first[5] - @starting_battle_x)/2
  1557.       jump_peak += @starting_battle_x
  1558.       pos_x = (jump_peak - self.screen_x).to_f / [jump_peak, 1].max
  1559.       pos_x *= -1
  1560.       [@battle_actions.first[12] * pos_x, @battle_actions.first[12]].min
  1561.     end
  1562.   end
  1563.   def decrease_timer
  1564.     return if @battle_actions.empty?
  1565.     @battle_actions.first[2] -= 1
  1566.   end
  1567.   def remove_actions
  1568.     if @battle_actions.size > 1 && @battle_actions[1][0].is_a?(Integer)
  1569.       get_to_x = (@battle_actions[1][5] -  all_battle_members[@battle_actions[1][0]].screen_x) / @battle_actions[1][9]
  1570.       get_to_y = (@battle_actions[1][6] -  all_battle_members[@battle_actions[1][0]].screen_y) / @battle_actions[1][9]
  1571.       @battle_actions[1][7] = get_to_x
  1572.       @battle_actions[1][8] = get_to_y
  1573.     end
  1574.     @battle_actions.shift
  1575.   end
  1576.   def condition_turn
  1577.     @condition_time -= 1
  1578.   end
  1579.   #--------------------------------------------------------------------------
  1580.   # * Aquisição combinada de todos os membros aliados e inimigos
  1581.   #--------------------------------------------------------------------------
  1582.   def all_battle_members
  1583.     $game_party.members + $game_troop.members
  1584.   end
  1585. end
  1586.  
  1587. #==============================================================================
  1588. # ** Game_ActionResult
  1589. #------------------------------------------------------------------------------
  1590. #  Esta classe gerencia os resultados das ações nos combates.
  1591. # Esta classe é usada internamente pela classe Game_Battler.
  1592. #==============================================================================
  1593.  
  1594. class Game_ActionResult
  1595. alias :akea_animated_make_damage :make_damage
  1596.   #--------------------------------------------------------------------------
  1597.   # * Criação do dano
  1598.   #     value : valor do dano
  1599.   #     item  : objeto
  1600.   #--------------------------------------------------------------------------
  1601.   def make_damage(value, item)
  1602.     unless $akea_hit_porcentage == 0
  1603.       value *= $akea_hit_porcentage
  1604.       value /= 100
  1605.       value = value.to_i
  1606.     end
  1607.     akea_animated_make_damage(value, item)
  1608.   end
  1609. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement