Advertisement
Raizen

Akea Animated Battle System

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