Advertisement
Guest User

Battle Hud EX MOG

a guest
Feb 21st, 2017
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 242.77 KB | None | 0 0
  1. #==============================================================================
  2. # +++ MOG - Battle Hud EX (v6.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # https://atelierrgss.wordpress.com/
  6. #==============================================================================
  7. #
  8. # Coloque as imagens da hud na pasta.
  9. #
  10. # Graphics/Huds/Battle/
  11. #==============================================================================
  12. # Para ocultar ou apresentar a hud de batalha use o código abaixo.
  13. #
  14. # battle_hud_visible(false)
  15. #
  16. # ou
  17. #
  18. # battle_hud_visible(true)
  19. #
  20. #==============================================================================
  21. # Para mudar o sprite da face do battler use o código abaixo.
  22. #==============================================================================
  23. #
  24. # battler_face_name( ACTOR_ID, FIlE_NAME )
  25. #
  26. #==============================================================================
  27.  
  28. #==============================================================================
  29. # Atualizações desta versão.
  30. #==============================================================================
  31. # (ver 6.6)
  32. # - Correção do Crash caso optar por desativar o layout das janelas.
  33. # (ver 6.5)
  34. # - Melhoria no cálculo da posição Z.
  35. # - Correção de travar o menu.
  36. # (ver 6.4)
  37. # - Correção do glitch de aparecer um pedaço da Windowskin quando se
  38. # usa mais de 4 battlers na batalha.
  39. # (ver 6.3)
  40. # - Compatibilidade com o MOG Battle Camera.
  41. # (ver 6.2)
  42. # - Refresh da hud ao trocar a posição dos personagens.
  43. # (ver 6.0)
  44. # - Adição da camada da tela.
  45. # - Adição do efeito Slide.
  46. # - Adição de novas opções referente a fonte.
  47. #==============================================================================
  48.  
  49. $imported = {} if $imported.nil?
  50. $imported[:mog_battle_hud_ex] = true
  51.  
  52. module MOG_BATTLE_HUD_EX
  53.  
  54. #============================================================================
  55. #============================================================================
  56. # * HUD SPRITE (GENERAL)
  57. #============================================================================
  58. # Definição da quantidade maxima de personagens na batalha.
  59. #---------------------------------------------------------------------------
  60. MAX_BATTLE_MEMBERS = 4
  61. #---------------------------------------------------------------------------
  62. # Definição da prioridade da hud.
  63. #---------------------------------------------------------------------------
  64. HUD_Z = 110
  65. #---------------------------------------------------------------------------
  66. # Definição da posição geral da hud, influência em todos os sprites da hud.
  67. #---------------------------------------------------------------------------
  68. HUD_POSITION = [0,323]
  69. #---------------------------------------------------------------------------
  70. # Definição do espaço entre os membros do grupo.
  71. # (Use apenas para ajustes)
  72. #---------------------------------------------------------------------------
  73. MEMBERS_SPACE = [0,0]
  74. #---------------------------------------------------------------------------
  75. # Definição fixa da hud se deseja posicionar a hud em lugares
  76. # específicos da tela.
  77. #
  78. # FIXED_POSITION[INDEX_ID] = [X,Y]
  79. #
  80. #---------------------------------------------------------------------------
  81. FIXED_HUD_POSITION = []
  82. # FIXED_HUD_POSITION[0] = [10,10]
  83. # FIXED_HUD_POSITION[1] = [410,10]
  84. # FIXED_HUD_POSITION[2] = [10,320]
  85. # FIXED_HUD_POSITION[3] = [410,320]
  86. #---------------------------------------------------------------------------
  87. # Definição da posição do comando quando a opção de janelas fixa é ativada.
  88. #---------------------------------------------------------------------------
  89. FIXED_COMMAND_POSITION = []
  90. #FIXED_COMMAND_POSITION[0] = [130,10]
  91. # FIXED_COMMAND_POSITION[1] = [300,10]
  92. # FIXED_COMMAND_POSITION[2] = [130,290]
  93. # FIXED_COMMAND_POSITION[3] = [300,290]
  94. #---------------------------------------------------------------------------
  95. # Ocultar a HUD quando a janela de mensagem está ativa.
  96. #---------------------------------------------------------------------------
  97. MESSAGE_WINDOW_FADE_HUD = true
  98. #---------------------------------------------------------------------------
  99. # Definição da porcentagem do parâmetro baixo, isso influência na cor
  100. # do número dos parâmetros de HP, MP e TP.
  101. #---------------------------------------------------------------------------
  102. LOW_PARAMETER_PERCENTAGE = 30
  103. #============================================================================
  104. #============================================================================
  105.  
  106.  
  107. #============================================================================
  108. #============================================================================
  109. # * NAME
  110. #============================================================================
  111. # Ativar o Sprite do nome do personagem.
  112. #---------------------------------------------------------------------------
  113. NAME_VISIBLE = false
  114. #---------------------------------------------------------------------------
  115. # Definição da prioridade do Sprite.
  116. #---------------------------------------------------------------------------
  117. NAME_Z = 5
  118. #---------------------------------------------------------------------------
  119. # Definição da posição da Face. [X,Y]
  120. #---------------------------------------------------------------------------
  121. NAME_POSITION = [0,-7]
  122. #---------------------------------------------------------------------------
  123. # Definição do tipo alinhamento do nome.
  124. #
  125. # 0 - Esquerda
  126. # 1 - Centro
  127. # 2 - Direita
  128. #---------------------------------------------------------------------------
  129. NAME_ALIGN_TYPE = 1
  130. #---------------------------------------------------------------------------
  131. # Definição do nome da fonte.
  132. #---------------------------------------------------------------------------
  133. NAME_FONT_NAME = "Georgia"
  134. #---------------------------------------------------------------------------
  135. # Definição do tamanho da fonte.
  136. #---------------------------------------------------------------------------
  137. NAME_FONT_SIZE = 16
  138. #---------------------------------------------------------------------------
  139. # Ativar Bold.
  140. #---------------------------------------------------------------------------
  141. NAME_FONT_BOLD = true
  142. #---------------------------------------------------------------------------
  143. # Ativar Italic.
  144. #---------------------------------------------------------------------------
  145. NAME_FONT_ITALIC = true
  146. #---------------------------------------------------------------------------
  147. # Definição da cor da fonte
  148. #---------------------------------------------------------------------------
  149. NAME_FONT_COLOR = Color.new(255,255,255,255)
  150. #---------------------------------------------------------------------------
  151. # Ativar Sombra
  152. #---------------------------------------------------------------------------
  153. NAME_FONT_SHADOW = false
  154. #---------------------------------------------------------------------------
  155. # Definição da cor da sombra
  156. #---------------------------------------------------------------------------
  157. NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  158. #---------------------------------------------------------------------------
  159. # Definição da distância da sombra.
  160. #---------------------------------------------------------------------------
  161. NAME_FONT_SHADOW_POSITION = [2,2]
  162. #============================================================================
  163. #============================================================================
  164.  
  165.  
  166. #============================================================================
  167. #============================================================================
  168. # * FACE
  169. #============================================================================
  170. # Ativar a face.
  171. # Será necessário o arquivo.
  172. #
  173. # ACTOR_NAME + _Face.png
  174. #
  175. # Eric_Face.png
  176. #
  177. #---------------------------------------------------------------------------
  178. FACE_VISIBLE = true
  179. # Ativar as Faces representando os battlers.
  180. # Deixe "false" se tiver problemas de compatibilidade com scripts.
  181. FACE_BATTLER = true
  182. #---------------------------------------------------------------------------
  183. # Definição da prioridade do sprite.
  184. #---------------------------------------------------------------------------
  185. FACE_Z = -1
  186. #---------------------------------------------------------------------------
  187. # Definição da posição da Face. [X,Y]
  188. #---------------------------------------------------------------------------
  189. FACE_POSITION = [68,5]
  190. #---------------------------------------------------------------------------
  191. # Ativar faces animadas.
  192. # Será necessário ter uma imagem de 5 faces do personagem no mesmo arquivo.
  193. #
  194. # FACE1/FACE2/FACE3/FACE4
  195. #
  196. # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
  197. # a imagem será dividida por 1 frame
  198. #---------------------------------------------------------------------------
  199. FACE_ANIMATION = true
  200. #---------------------------------------------------------------------------
  201. # Ativar o efeito de Zoom quando o personagem usar alguma ação.
  202. #---------------------------------------------------------------------------
  203. FACE_ZOOM_ANIMATION = true
  204. #---------------------------------------------------------------------------
  205. # Ativar o efeito Mirror na animação de ação do personagem.
  206. #---------------------------------------------------------------------------
  207. FACE_ZOOM_MIRROR_EFFECT = false
  208. #---------------------------------------------------------------------------
  209. # Definição do tempo duração da animação da face.
  210. #---------------------------------------------------------------------------
  211. FACE_ANIMATION_DURATION = 40
  212. #---------------------------------------------------------------------------
  213. # Ativar o efeito tremor da face quando o personagem sofrer dano.
  214. #---------------------------------------------------------------------------
  215. FACE_SHAKE_EFFECT = true
  216. #============================================================================
  217. #============================================================================
  218.  
  219.  
  220. #============================================================================
  221. #============================================================================
  222. # * TURN (ACTIVE INDICATOR)
  223. #============================================================================
  224. # Ativar o indicador de turno do personagem.
  225. # Será necessário o arquivo.
  226. #
  227. # Turn.png
  228. #
  229. #---------------------------------------------------------------------------
  230. TURN_SPRITE_VISIBLE = true
  231. #---------------------------------------------------------------------------
  232. # Definição da prioridade do Sprite.
  233. #---------------------------------------------------------------------------
  234. TURN_SPRITE_Z = 0
  235. #---------------------------------------------------------------------------
  236. # Definição da posição do sprite de turno.
  237. #---------------------------------------------------------------------------
  238. TURN_SPRITE_POSITION = [8,-30]
  239. #---------------------------------------------------------------------------
  240. # Ativar o efeito de animação de piscar.
  241. #---------------------------------------------------------------------------
  242. TURN_BLINK_EFFECT = true
  243. #---------------------------------------------------------------------------
  244.  
  245.  
  246. #============================================================================
  247. #============================================================================
  248. # * HP
  249. #============================================================================
  250. # Ativar o número de HP.
  251. # Será necessário o arquivo.
  252. #
  253. # HP_Number.png
  254. #
  255. #---------------------------------------------------------------------------
  256. HP_NUMBER_VISIBLE = true
  257. #---------------------------------------------------------------------------
  258. # Definição da prioridade do Sprite.
  259. #---------------------------------------------------------------------------
  260. HP_NUMBER_Z = 2
  261. #---------------------------------------------------------------------------
  262. # Definição da posição do número de HP. [X,Y]
  263. #---------------------------------------------------------------------------
  264. HP_NUMBER_POSITION = [117,26]
  265. #---------------------------------------------------------------------------
  266. # Ativar o número de HP Total.
  267. # Será necessário o arquivo.
  268. #
  269. # HP_Number_Max.png
  270. #
  271. #---------------------------------------------------------------------------
  272. HP_NUMBER_MAX_VISIBLE = false
  273. #---------------------------------------------------------------------------
  274. # Definição da posição do número de HP Total. [X,Y]
  275. #---------------------------------------------------------------------------
  276. HP_NUMBER_MAX_POSITION = [165,30]
  277. #---------------------------------------------------------------------------
  278. # Definição do tipo alinhamento do número.
  279. #
  280. # 0 - Esquerda
  281. # 1 - Centro
  282. # 2 - Direita
  283. #---------------------------------------------------------------------------
  284. HP_NUMBER_ALIGN_TYPE = 2
  285. #---------------------------------------------------------------------------
  286. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  287. #---------------------------------------------------------------------------
  288. HP_NUMBER_WAVE_ALIGN_EFFECT = false
  289. #---------------------------------------------------------------------------
  290. # Apresentar os números em porcentagem.
  291. #---------------------------------------------------------------------------
  292. HP_NUMBER_PERCENTAGE = false
  293. #---------------------------------------------------------------------------
  294. # Ativar números animados ("Rolantes").
  295. #---------------------------------------------------------------------------
  296. HP_NUMBER_ANIMATION = true
  297. #---------------------------------------------------------------------------
  298. # Ativar a cor do HP baixo.
  299. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  300. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  301. #
  302. # NORMAL_COLOR
  303. # LOW_PARAMETER_COLOR
  304. #
  305. # Caso definir a função como FALSE a imagem será dividida apenas como
  306. # 1 frame de altura.
  307. #---------------------------------------------------------------------------
  308. HP_NUMBER_LOW_COLOR = false
  309. #---------------------------------------------------------------------------
  310. # Ativar o medidor de HP.
  311. # Será necessário o arquivo.
  312. #
  313. # HP_Meter.png
  314. #
  315. #---------------------------------------------------------------------------
  316. HP_METER_VISIBLE = true
  317. #---------------------------------------------------------------------------
  318. # Definição da prioridade do sprite.
  319. #---------------------------------------------------------------------------
  320. HP_METER_Z = 1
  321. #---------------------------------------------------------------------------
  322. # Definição da posição do medidor de HP. [X,Y]
  323. #---------------------------------------------------------------------------
  324. HP_METER_POSITION = [38,39]
  325. #---------------------------------------------------------------------------
  326. # Definição do ângulo do medidor.
  327. #---------------------------------------------------------------------------
  328. HP_METER_ANGLE = 0
  329. #---------------------------------------------------------------------------
  330. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  331. # inverso.
  332. #---------------------------------------------------------------------------
  333. HP_METER_MIRROR_EFFECT = false
  334. #---------------------------------------------------------------------------
  335. # Ativar o efeito animado de dano no medidor.
  336. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  337. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  338. #
  339. # NORMAL_COLOR
  340. # DAMAGE_COLOR
  341. #
  342. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  343. #---------------------------------------------------------------------------
  344. HP_METER_REDUCTION_ANIMATION = true
  345. #---------------------------------------------------------------------------
  346. # Ativar o efeito animado do "medidor fluindo".
  347. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  348. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  349. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  350. #---------------------------------------------------------------------------
  351. HP_METER_GRADIENT_ANIMATION = true
  352. #---------------------------------------------------------------------------
  353. # Ativar HP em ícones.
  354. # Será necessário ter a imagem.
  355. #
  356. # HP_Icon.png
  357. #
  358. #---------------------------------------------------------------------------
  359. HP_ICON_VISIBLE = false
  360. #---------------------------------------------------------------------------
  361. # Definição da prioridade do Sprite.
  362. #---------------------------------------------------------------------------
  363. HP_ICON_Z = 1
  364. #---------------------------------------------------------------------------
  365. # Posição do ícone de HP.
  366. #---------------------------------------------------------------------------
  367. HP_ICON_POSITION = [200,0]
  368. #---------------------------------------------------------------------------
  369. # Ativar o sprite EX do ultimo ícone
  370. # Será necessário ter a imagem.
  371. #
  372. # HP_Icon_EX.png
  373. #
  374. #---------------------------------------------------------------------------
  375. HP_ICON_EX_VISIBLE = false
  376. #---------------------------------------------------------------------------
  377. # Posição do ícone Animado.
  378. #---------------------------------------------------------------------------
  379. HP_ICON_EX_POSITION = [0,0]
  380. #---------------------------------------------------------------------------
  381. # Ativar o efeito de Zoom do Sprite.
  382. #---------------------------------------------------------------------------
  383. HP_ICON_EX_ZOOM_EFFECT = true
  384. #---------------------------------------------------------------------------
  385. # Espaço entre os ícones.
  386. #---------------------------------------------------------------------------
  387. HP_ICON_SPACE = [-10,-10]
  388. #---------------------------------------------------------------------------
  389. # Definição da quantidade maxima de ícones na horizontal.
  390. #---------------------------------------------------------------------------
  391. HP_ICON_COL_MAX = 10
  392. #---------------------------------------------------------------------------
  393. # Definição da quantidade maxima de ícones na vertical.
  394. #---------------------------------------------------------------------------
  395. HP_ICON_ROW_MAX = 2
  396. #---------------------------------------------------------------------------
  397. # Ativar o número de HP de ícones.
  398. # Será necessário ter a imagem.
  399. #
  400. # HP_Icon_Number.png
  401. #
  402. #---------------------------------------------------------------------------
  403. HP_ICON_NUMBER_VISIBLE = false
  404. #---------------------------------------------------------------------------
  405. # Definição da prioridade do sprite.
  406. #---------------------------------------------------------------------------
  407. HP_ICON_NUMBER_Z = 4
  408. #---------------------------------------------------------------------------
  409. # Posição do número do ícone
  410. #---------------------------------------------------------------------------
  411. HP_ICON_NUMBER_POSITION = [0,0]
  412. #---------------------------------------------------------------------------
  413. # Definição do tipo alinhamento do número.
  414. #
  415. # 0 - Esquerda
  416. # 1 - Centro
  417. # 2 - Direita
  418. #---------------------------------------------------------------------------
  419. HP_ICON_NUMBER_ALIGN_TYPE = 0
  420. #============================================================================
  421. #============================================================================
  422.  
  423.  
  424. #============================================================================
  425. #============================================================================
  426. # * MP
  427. #============================================================================
  428. # Ativar o número de MP.
  429. # Será necessário o arquivo.
  430. #
  431. # MP_Number.png
  432. #
  433. #---------------------------------------------------------------------------
  434. MP_NUMBER_VISIBLE = true
  435. #---------------------------------------------------------------------------
  436. # Definição da prioridade do Sprite.
  437. #---------------------------------------------------------------------------
  438. MP_NUMBER_Z = 2
  439. #---------------------------------------------------------------------------
  440. # Definição da posição do número de MP. [X,Y]
  441. #---------------------------------------------------------------------------
  442. MP_NUMBER_POSITION = [90,44]
  443. #---------------------------------------------------------------------------
  444. # Ativar o número de MP Total.
  445. # Será necessário o arquivo.
  446. #
  447. # MP_Number_Max.png
  448. #
  449. #---------------------------------------------------------------------------
  450. MP_NUMBER_MAX_VISIBLE = false
  451. #---------------------------------------------------------------------------
  452. # Definição da posição do número de MP Total. [X,Y]
  453. #---------------------------------------------------------------------------
  454. MP_NUMBER_MAX_POSITION = [128,53]
  455. #---------------------------------------------------------------------------
  456. # Definição do tipo alinhamento do número.
  457. #
  458. # 0 - Esquerda
  459. # 1 - Centro
  460. # 2 - Direita
  461. #---------------------------------------------------------------------------
  462. MP_NUMBER_ALIGN_TYPE = 2
  463. #---------------------------------------------------------------------------
  464. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  465. #---------------------------------------------------------------------------
  466. MP_NUMBER_WAVE_ALIGN_EFFECT = false
  467. #---------------------------------------------------------------------------
  468. # Apresentar os números em porcentagem.
  469. #---------------------------------------------------------------------------
  470. MP_NUMBER_PERCENTAGE = false
  471. #---------------------------------------------------------------------------
  472. # Ativar números animados ("Rolantes").
  473. #---------------------------------------------------------------------------
  474. MP_NUMBER_ANIMATION = true
  475. #---------------------------------------------------------------------------
  476. # Ativar a cor do MP baixo.
  477. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  478. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  479. #
  480. # NORMAL_COLOR
  481. # LOW_PARAMETER_COLOR
  482. #
  483. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  484. #---------------------------------------------------------------------------
  485. MP_NUMBER_LOW_COLOR = false
  486. #---------------------------------------------------------------------------
  487. # Ativar o medidor de MP.
  488. # Será necessário o arquivo.
  489. #
  490. # MP_Meter.png
  491. #
  492. #---------------------------------------------------------------------------
  493. MP_METER_VISIBLE = true
  494. #---------------------------------------------------------------------------
  495. # Definição da prioridade do sprite.
  496. #---------------------------------------------------------------------------
  497. MP_METER_Z = 1
  498. #---------------------------------------------------------------------------
  499. # Definição da posição do medidor de MP. [X,Y]
  500. #---------------------------------------------------------------------------
  501. MP_METER_POSITION = [9,56]
  502. #---------------------------------------------------------------------------
  503. # Definição do ângulo do medidor.
  504. #---------------------------------------------------------------------------
  505. MP_METER_ANGLE = 0
  506. #---------------------------------------------------------------------------
  507. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  508. # inverso.
  509. #---------------------------------------------------------------------------
  510. MP_METER_MIRROR_EFFECT = false
  511. #---------------------------------------------------------------------------
  512. # Ativar o efeito animado de dano no medidor.
  513. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  514. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  515. #
  516. # NORMAL_COLOR
  517. # DAMAGE_COLOR
  518. #
  519. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  520. #---------------------------------------------------------------------------
  521. MP_METER_REDUCTION_ANIMATION = true
  522. #---------------------------------------------------------------------------
  523. # Ativar o efeito animado do "medidor fluindo".
  524. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  525. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  526. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  527. #---------------------------------------------------------------------------
  528. MP_METER_GRADIENT_ANIMATION = true
  529. #---------------------------------------------------------------------------
  530. # Ativar MP em ícones.
  531. # Será necessário ter a imagem.
  532. #
  533. # MP_Icon.png
  534. #
  535. #---------------------------------------------------------------------------
  536. MP_ICON_VISIBLE = false
  537. #---------------------------------------------------------------------------
  538. # Definição da prioridade do Sprite.
  539. #---------------------------------------------------------------------------
  540. MP_ICON_Z = 1
  541. #---------------------------------------------------------------------------
  542. # Posição do ícone de MP.
  543. #---------------------------------------------------------------------------
  544. MP_ICON_POSITION = [200,64]
  545. #---------------------------------------------------------------------------
  546. # Ativar o sprite EX do ultimo ícone
  547. # Será necessário ter a imagem.
  548. #
  549. # MP_Icon_EX.png
  550. #
  551. #---------------------------------------------------------------------------
  552. MP_ICON_EX_VISIBLE = false
  553. #---------------------------------------------------------------------------
  554. # Posição do ícone Animado.
  555. #---------------------------------------------------------------------------
  556. MP_ICON_EX_POSITION = [0,0]
  557. #---------------------------------------------------------------------------
  558. # Ativar o efeito de Zoom do Sprite.
  559. #---------------------------------------------------------------------------
  560. MP_ICON_EX_ZOOM_EFFECT = true
  561. #---------------------------------------------------------------------------
  562. # Espaço entre os ícones.
  563. #---------------------------------------------------------------------------
  564. MP_ICON_SPACE = [-10,-10]
  565. #---------------------------------------------------------------------------
  566. # Definição da quantidade maxima de ícones na horizontal.
  567. #---------------------------------------------------------------------------
  568. MP_ICON_COL_MAX = 10
  569. #---------------------------------------------------------------------------
  570. # Definição da quantidade maxima de ícones na vertical.
  571. #---------------------------------------------------------------------------
  572. MP_ICON_ROW_MAX = 2
  573. #---------------------------------------------------------------------------
  574. # Ativar o número de MP de ícones.
  575. # Será necessário ter a imagem.
  576. #
  577. # MP_Icon_Number.png
  578. #
  579. #---------------------------------------------------------------------------
  580. MP_ICON_NUMBER_VISIBLE = false
  581. #---------------------------------------------------------------------------
  582. # Definição da prioridade do sprite.
  583. #---------------------------------------------------------------------------
  584. MP_ICON_NUMBER_Z = 4
  585. #---------------------------------------------------------------------------
  586. # Posição do número do ícone
  587. #---------------------------------------------------------------------------
  588. MP_ICON_NUMBER_POSITION = [0,64]
  589. #---------------------------------------------------------------------------
  590. # Definição do tipo alinhamento do número.
  591. #
  592. # 0 - Esquerda
  593. # 1 - Centro
  594. # 2 - Direita
  595. #---------------------------------------------------------------------------
  596. MP_ICON_NUMBER_ALIGN_TYPE = 0
  597. #============================================================================
  598. #============================================================================
  599.  
  600.  
  601. #============================================================================
  602. #============================================================================
  603. # * TP
  604. #============================================================================
  605. # Ativar o número de TP.
  606. # Será necessário o arquivo.
  607. #
  608. # TP_Number.png
  609. #
  610. #---------------------------------------------------------------------------
  611. TP_NUMBER_VISIBLE = true
  612. #---------------------------------------------------------------------------
  613. # Definição da prioridade do sprite.
  614. #---------------------------------------------------------------------------
  615. TP_NUMBER_Z = 5
  616. #---------------------------------------------------------------------------
  617. # Definição da posição do número de TP. [X,Y]
  618. #---------------------------------------------------------------------------
  619. TP_NUMBER_POSITION = [19,23]
  620. #---------------------------------------------------------------------------
  621. # Ativar o número de TP Total.
  622. # Será necessário o arquivo.
  623. #
  624. # TP_Number_Max.png
  625. #
  626. #---------------------------------------------------------------------------
  627. TP_NUMBER_MAX_VISIBLE = false
  628. #---------------------------------------------------------------------------
  629. # Definição da posição do número de TP Total. [X,Y]
  630. #---------------------------------------------------------------------------
  631. TP_NUMBER_MAX_POSITION = [165,73]
  632. #---------------------------------------------------------------------------
  633. # Definição do tipo alinhamento do número.
  634. #
  635. # 0 - Esquerda
  636. # 1 - Centro
  637. # 2 - Direita
  638. #---------------------------------------------------------------------------
  639. TP_NUMBER_ALIGN_TYPE = 1
  640. #---------------------------------------------------------------------------
  641. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  642. #---------------------------------------------------------------------------
  643. TP_NUMBER_WAVE_ALIGN_EFFECT = false
  644. #---------------------------------------------------------------------------
  645. # Apresentar os números em porcentagem.
  646. #---------------------------------------------------------------------------
  647. TP_NUMBER_PERCENTAGE = false
  648. #---------------------------------------------------------------------------
  649. # Ativar números animados ("Rolantes").
  650. #---------------------------------------------------------------------------
  651. TP_NUMBER_ANIMATION = true
  652. #---------------------------------------------------------------------------
  653. # Ativar a cor do TP baixo.
  654. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  655. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  656. #
  657. # NORMAL_COLOR
  658. # LOW_PARAMETER_COLOR
  659. #
  660. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  661. #---------------------------------------------------------------------------
  662. TP_NUMBER_LOW_COLOR = false
  663. #---------------------------------------------------------------------------
  664. # Ativar o medidor de TP.
  665. # Será necessário o arquivo.
  666. #
  667. # TP_Meter.png
  668. #
  669. #---------------------------------------------------------------------------
  670. TP_METER_VISIBLE = false
  671. #---------------------------------------------------------------------------
  672. # Definição da prioridade do sprite.
  673. #---------------------------------------------------------------------------
  674. TP_METER_Z = 1
  675. #---------------------------------------------------------------------------
  676. # Definição da posição do medidor de TP. [X,Y]
  677. #---------------------------------------------------------------------------
  678. TP_METER_POSITION = [68,74]
  679. #---------------------------------------------------------------------------
  680. # Definição do ângulo do medidor.
  681. #---------------------------------------------------------------------------
  682. TP_METER_ANGLE = 0
  683. #---------------------------------------------------------------------------
  684. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  685. # inverso.
  686. #---------------------------------------------------------------------------
  687. TP_METER_MIRROR_EFFECT = false
  688. #---------------------------------------------------------------------------
  689. # Ativar o efeito animado de dano no medidor.
  690. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  691. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  692. #
  693. # NORMAL_COLOR
  694. # DAMAGE_COLOR
  695. #
  696. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  697. #---------------------------------------------------------------------------
  698. TP_METER_REDUCTION_ANIMATION = true
  699. #---------------------------------------------------------------------------
  700. # Ativar o efeito animado do "medidor fluindo".
  701. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  702. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  703. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  704. #---------------------------------------------------------------------------
  705. TP_METER_GRADIENT_ANIMATION = true
  706. #---------------------------------------------------------------------------
  707. # Ativar TP em ícones.
  708. # Será necessário ter a imagem.
  709. #
  710. # TP_Icon.png
  711. #
  712. #---------------------------------------------------------------------------
  713. TP_ICON_VISIBLE = false
  714. #---------------------------------------------------------------------------
  715. # Definição da prioridade do sprite.
  716. #---------------------------------------------------------------------------
  717. TP_ICON_Z = 1
  718. #---------------------------------------------------------------------------
  719. # Posição do ícone de TP.
  720. #---------------------------------------------------------------------------
  721. TP_ICON_POSITION = [200,128]
  722. #---------------------------------------------------------------------------
  723. # Ativar o sprite EX do ultimo ícone
  724. # Será necessário ter a imagem.
  725. #
  726. # TP_Icon_EX.png
  727. #
  728. #---------------------------------------------------------------------------
  729. TP_ICON_EX_VISIBLE = false
  730. #---------------------------------------------------------------------------
  731. # Posição do ícone Animado.
  732. #---------------------------------------------------------------------------
  733. TP_ICON_EX_POSITION = [0,0]
  734. #---------------------------------------------------------------------------
  735. # Ativar o efeito de Zoom do Sprite.
  736. #---------------------------------------------------------------------------
  737. TP_ICON_EX_ZOOM_EFFECT = true
  738. #---------------------------------------------------------------------------
  739. # Espaço entre os ícones.
  740. #---------------------------------------------------------------------------
  741. TP_ICON_SPACE = [-10,-10]
  742. #---------------------------------------------------------------------------
  743. # Definição da quantidade maxima de ícones na horizontal.
  744. #---------------------------------------------------------------------------
  745. TP_ICON_COL_MAX = 10
  746. #---------------------------------------------------------------------------
  747. # Definição da quantidade maxima de ícones na vertical.
  748. #---------------------------------------------------------------------------
  749. TP_ICON_ROW_MAX = 2
  750. #---------------------------------------------------------------------------
  751. # Ativar o número de TP de ícones.
  752. # Será necessário ter a imagem.
  753. #
  754. # TP_Icon_Number.png
  755. #
  756. #---------------------------------------------------------------------------
  757. TP_ICON_NUMBER_VISIBLE = false
  758. #---------------------------------------------------------------------------
  759. # Definição da prioridade do sprite.
  760. #---------------------------------------------------------------------------
  761. TP_ICON_NUMBER_Z = 4
  762. #---------------------------------------------------------------------------
  763. # Posição do número do ícone
  764. #---------------------------------------------------------------------------
  765. TP_ICON_NUMBER_POSITION = [0,128]
  766. #---------------------------------------------------------------------------
  767. # Definição do tipo alinhamento do número.
  768. #
  769. # 0 - Esquerda
  770. # 1 - Centro
  771. # 2 - Direita
  772. #---------------------------------------------------------------------------
  773. TP_ICON_NUMBER_ALIGN_TYPE = 0
  774. #============================================================================
  775. #============================================================================
  776.  
  777. #============================================================================
  778. #============================================================================
  779. # * AT
  780. #============================================================================
  781. # Ativar o número de AT.
  782. # Será necessário o arquivo.
  783. #
  784. # AT_Number.png
  785. #
  786. #---------------------------------------------------------------------------
  787. AT_NUMBER_VISIBLE = false
  788. #---------------------------------------------------------------------------
  789. # Definição da prioridade do Sprite.
  790. #---------------------------------------------------------------------------
  791. AT_NUMBER_Z = 2
  792. #---------------------------------------------------------------------------
  793. # Definição da posição do número de AT. [X,Y]
  794. #---------------------------------------------------------------------------
  795. AT_NUMBER_POSITION = [125,-27]
  796. #---------------------------------------------------------------------------
  797. # Ativar o número de AT Total.
  798. # Será necessário o arquivo.
  799. #
  800. # AT_Number_Max.png
  801. #
  802. #---------------------------------------------------------------------------
  803. AT_NUMBER_MAX_VISIBLE = false
  804. #---------------------------------------------------------------------------
  805. # Definição da posição do número de AT Total. [X,Y]
  806. #---------------------------------------------------------------------------
  807. AT_NUMBER_MAX_POSITION = [165,-17]
  808. #---------------------------------------------------------------------------
  809. # Definição do tipo alinhamento do número.
  810. #
  811. # 0 - Esquerda
  812. # 1 - Centro
  813. # 2 - Direita
  814. #---------------------------------------------------------------------------
  815. AT_NUMBER_ALIGN_TYPE = 2
  816. #---------------------------------------------------------------------------
  817. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  818. #---------------------------------------------------------------------------
  819. AT_NUMBER_WAVE_ALIGN_EFFECT = false
  820. #---------------------------------------------------------------------------
  821. # Apresentar os números em porcentagem.
  822. #---------------------------------------------------------------------------
  823. AT_NUMBER_PERCENTAGE = true
  824. #---------------------------------------------------------------------------
  825. # Ativar números animados ("Rolantes").
  826. #---------------------------------------------------------------------------
  827. AT_NUMBER_ANIMATION = false
  828. #---------------------------------------------------------------------------
  829. # Ativar o medidor de AT.
  830. # Será necessário o arquivo.
  831. #
  832. # AT_Meter.png
  833. #
  834. #---------------------------------------------------------------------------
  835. AT_METER_VISIBLE = true
  836. #---------------------------------------------------------------------------
  837. # Definição da prioridade do sprite.
  838. #---------------------------------------------------------------------------
  839. AT_METER_Z = 1
  840. #---------------------------------------------------------------------------
  841. # Definição da posição do medidor de AT. [X,Y]
  842. #---------------------------------------------------------------------------
  843. AT_METER_POSITION = [38,76]
  844. #---------------------------------------------------------------------------
  845. # Definição do ângulo do medidor.
  846. #---------------------------------------------------------------------------
  847. AT_METER_ANGLE = 0
  848. #---------------------------------------------------------------------------
  849. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  850. # inverso.
  851. #---------------------------------------------------------------------------
  852. AT_METER_MIRROR_EFFECT = false
  853. #---------------------------------------------------------------------------
  854. # Ativar o efeito animado do "medidor fluindo".
  855. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  856. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  857. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  858. #---------------------------------------------------------------------------
  859. AT_METER_GRADIENT_ANIMATION = true
  860. #============================================================================
  861.  
  862.  
  863. #============================================================================
  864. #============================================================================
  865. # * LEVEL
  866. #============================================================================
  867. # Ativar o número de Level.
  868. # Será necessário o arquivo.
  869. #
  870. # LV_Number.png
  871. #
  872. #---------------------------------------------------------------------------
  873. LEVEL_NUMBER_VISIBLE = false
  874. #---------------------------------------------------------------------------
  875. # Definição da prioridade do Sprite.
  876. #---------------------------------------------------------------------------
  877. LEVEL_NUMBER_Z = 2
  878. #---------------------------------------------------------------------------
  879. # Definição da posição do número do Level. [X,Y]
  880. #---------------------------------------------------------------------------
  881. LEVEL_NUMBER_POSITION = [84,0]
  882. #---------------------------------------------------------------------------
  883. # Definição do tipo alinhamento do número.
  884. #
  885. # 0 - Esquerda
  886. # 1 - Centro
  887. # 2 - Direita
  888. #---------------------------------------------------------------------------
  889. LEVEL_NUMBER_ALIGN_TYPE = 1
  890. #============================================================================
  891. #============================================================================
  892.  
  893.  
  894. #============================================================================
  895. #============================================================================
  896. # * STATE
  897. #============================================================================
  898. # Ativar as condições.
  899. #---------------------------------------------------------------------------
  900. STATES_VISIBLE = true
  901. #---------------------------------------------------------------------------
  902. # Definição da prioridade do sprite.
  903. #---------------------------------------------------------------------------
  904. STATES_Z = 1
  905. #---------------------------------------------------------------------------
  906. # Definição da posição das condições. [X,Y]
  907. #---------------------------------------------------------------------------
  908. STATES_POSITION = [7,65]
  909. #---------------------------------------------------------------------------
  910. # Ativar o efeito animado das condições deslizando.
  911. #---------------------------------------------------------------------------
  912. STATES_SCROLLING_ANIMATION = false
  913. #---------------------------------------------------------------------------
  914. # Definição do ângulo do sprite.
  915. #---------------------------------------------------------------------------
  916. STATE_ANGLE = 0
  917. #---------------------------------------------------------------------------
  918. # Definição das condições que serão ocultadas pela hud.
  919. # EX - HIDE_STATES_ID = [9,10,12,14]
  920. #---------------------------------------------------------------------------
  921. HIDE_STATES_ID = []
  922. #============================================================================
  923. #============================================================================
  924.  
  925. #============================================================================
  926. #============================================================================
  927. # * SECOND LAYOUT (Overlayer)
  928. #============================================================================
  929. # Ativar a segunda camada de Layout
  930. # Será necessário o arquivo.
  931. #
  932. # Layout_2.png
  933. #
  934. #============================================================================
  935. SECOND_LAYOUT = false
  936. #---------------------------------------------------------------------------
  937. # Definição da prioridade do sprite.
  938. #---------------------------------------------------------------------------
  939. SECOND_LAYOUT_Z = 4
  940. #---------------------------------------------------------------------------
  941. # Definição da posição do sprite.
  942. #---------------------------------------------------------------------------
  943. SECOND_LAYOUT_POSITION = [-5,-10]
  944. #============================================================================
  945. #============================================================================
  946.  
  947. #============================================================================
  948. #============================================================================
  949. # * SCREEN LAYOUT
  950. #============================================================================
  951. # Ativar o Layout da tela.
  952. # Será necessário o arquivo.
  953. #
  954. # Layout_Screen.png
  955. #
  956. #============================================================================
  957. #Ativar o Layout da tela
  958. SCREEN_LAYOUT = false
  959. #---------------------------------------------------------------------------
  960. #Posição do layout
  961. #---------------------------------------------------------------------------
  962. SCREEN_LAYOUT_POSITION = [0,0]
  963. #---------------------------------------------------------------------------
  964. #Definição da posição Z
  965. #---------------------------------------------------------------------------
  966. SCREEN_LAYOUT_Z = -2
  967.  
  968. end
  969.  
  970. #============================================================================
  971. #============================================================================
  972. # * CUSTOM WINDOWS (GENERAL)
  973. #============================================================================
  974. module MOG_BATTLE_HUD_EX
  975.  
  976. #============================================================================
  977. # * Ativar Janelas Customizadas.
  978. #============================================================================
  979. ENABLE_CUSTOM_WINDOWS = true
  980.  
  981. #============================================================================
  982. # * BATTLE LOG WINDOW
  983. #============================================================================
  984. #Definição da posição da janela de log.
  985. BATTLE_LOG_POSITION = [0,0]
  986. #============================================================================
  987.  
  988. #============================================================================
  989. # * FONT SETTING
  990. #============================================================================
  991. #Ativar a configuração da fonte.
  992. ENABLE_WINDOW_FONT_SET = false
  993. #Definição do nome da fonte.
  994. WINDOW_FONT_NAME = nil
  995. #Definição do tamanho da fonte.
  996. WINDOW_FONT_SIZE = 18
  997. #Ativar fonte em bold;
  998. WINDOW_FONT_BOLD = true
  999. #Ativar fonte em itálico.
  1000. WINDOW_FONT_ITALIC = false
  1001.  
  1002. #============================================================================
  1003. # * SKILL WINDOW
  1004. #============================================================================
  1005. #Definição do tamanho da janela.
  1006. SKILL_WINDOW_SIZE = [Graphics.width, 120]
  1007. #Definição da posição da janela.
  1008. SKILL_WINDOW_POSITION = [0,0]
  1009. #Definição da transparência da janela.
  1010. SKILL_WINDOW_OPACITY = 0
  1011. #Ativar a imagem de Layout. ("Layout_Skill.png")
  1012. SKILL_WINDOW_LAYOUT = true
  1013. #Definição do layout.
  1014. SKILL_WINDOW_LAYOUT_POSITION = [0,-7]
  1015. #Definição da quantidade colunas máxima.
  1016. SKILL_COL_MAX = 2
  1017. #Ativar a animação de slide.
  1018. SKILL_WINDOW_SLIDE_EFFECT = false
  1019. #Definição da posição do slide.
  1020. SKILL_WINDOW_SLIDE_POSITION = [150,150]
  1021. #============================================================================
  1022.  
  1023. #============================================================================
  1024. # * ITEM WINDOW
  1025. #============================================================================
  1026. #Definição do tamanho da janela.
  1027. ITEM_WINDOW_SIZE = [Graphics.width, 120]
  1028. #Definição da posição da janela.
  1029. ITEM_WINDOW_POSITION = [0,0]
  1030. #Definição da transparência da janela.
  1031. ITEM_WINDOW_OPACITY = 0
  1032. #Ativar a imagem de Layout. ("Layout_Item.png")
  1033. ITEM_WINDOW_LAYOUT = true
  1034. #Definição do layout.
  1035. ITEM_WINDOW_LAYOUT_POSITION = [0,-7]
  1036. #Definição da quantidade colunas máxima.
  1037. ITEM_COL_MAX = 2
  1038. #Ativar a animação de slide.
  1039. ITEM_WINDOW_SLIDE_EFFECT = false
  1040. #Definição da posição do slide.
  1041. ITEM_WINDOW_SLIDE_POSITION = [150,150]
  1042. #============================================================================
  1043.  
  1044. #============================================================================
  1045. # * COMMAND WINDOW
  1046. #============================================================================
  1047. #Ajustar automáticamente
  1048. AUTO_ADJUST_ACTOR_COMMAND = true
  1049. #Definição da posição da janela. (Apenas para Ajustes)
  1050. ACTOR_COMMAND_POSITION = [0,-50]
  1051. #Definição da transparência da janela.
  1052. ACTOR_COMMAND_OPACITY = 0
  1053. #Ativar a imagem de Layout. ("Layout_Command.png")
  1054. ACTOR_COMMAND_LAYOUT = true
  1055. #Definição do layout.
  1056. ACTOR_COMMAND_LAYOUT_POSITION = [0,0]
  1057. #============================================================================
  1058.  
  1059. #============================================================================
  1060. # * HELP WINDOW
  1061. #============================================================================
  1062. #Definição do tamanho da janela.
  1063. HELP_WINDOW_SIZE = [Graphics.width, 72]
  1064. #Definição do tamanho da janela.
  1065. HELP_WINDOW_POSITION = [Graphics.width / 2, 0]
  1066. #Definição da transparência da janela.
  1067. HELP_WINDOW_OPACITY = 0
  1068. #Ativar a imagem de Layout. ("Layout_Help.png")
  1069. HELP_WINDOW_LAYOUT = true
  1070. #Definição do layout.
  1071. HELP_WINDOW_LAYOUT_POSITION = [0,0]
  1072. #Ativar a animação de slide.
  1073. HELP_WINDOW_SLIDE_EFFECT = false
  1074. #Definição da posição do slide.
  1075. HELP_WINDOW_SLIDE_POSITION = [0,-150]
  1076. #============================================================================
  1077.  
  1078. #============================================================================
  1079. # * TARGET ACTOR WINDOW
  1080. #============================================================================
  1081. #Definição do tamanho da janela.
  1082. ACTOR_WINDOW_SIZE = [Graphics.width, 120]
  1083. #Definição do tamanho da janela.
  1084. ACTOR_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1085. #Definição da transparência da janela.
  1086. ACTOR_WINDOW_OPACITY = 0
  1087. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1088. ACTOR_WINDOW_LAYOUT = true
  1089. #Definição do layout.
  1090. ACTOR_WINDOW_LAYOUT_POSITION = [0,0]
  1091. #Ativar a animação de slide.
  1092. ACTOR_WINDOW_SLIDE_EFFECT = false
  1093. #Definição da posição do slide.
  1094. ACTOR_WINDOW_SLIDE_POSITION = [0,100]
  1095. #============================================================================
  1096.  
  1097. #============================================================================
  1098. # * TARGET ENEMY WINDOW
  1099. #============================================================================
  1100. #Definição do tamanho da janela.
  1101. ENEMY_WINDOW_SIZE = [Graphics.width, 120]
  1102. #Definição do tamanho da janela.
  1103. ENEMY_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  1104. #Definição da transparência da janela.
  1105. ENEMY_WINDOW_OPACITY = 0
  1106. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1107. ENEMY_WINDOW_LAYOUT = true
  1108. #Definição do layout.
  1109. ENEMY_WINDOW_LAYOUT_POSITION = [0,0]
  1110. #Ativar a animação de slide.
  1111. ENEMY_WINDOW_SLIDE_EFFECT = false
  1112. #Definição da posição do slide.
  1113. ENEMY_WINDOW_SLIDE_POSITION = [0,100]
  1114. #============================================================================
  1115.  
  1116. #============================================================================
  1117. # * PARTY WINDOW (Fight/Escape)
  1118. #============================================================================
  1119. #Definição do tamanho da janela.
  1120. PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
  1121. #Definição da transparência da janela.
  1122. PARTY_COMMAND_OPACITY = 0
  1123. #Ativar a imagem de Layout. ("Layout_Party.png")
  1124. PARTY_COMMAND_LAYOUT = true
  1125. #Definição do layout.
  1126. PARTY_COMMAND_LAYOUT_POSITION = [0,0]
  1127. #Ativar a animação de slide.
  1128. PARTY_COMMAND_SLIDE_EFFECT = false
  1129. #Definição da posição do slide.
  1130. PARTY_COMMAND_SLIDE_POSITION = [0,-150]
  1131. #============================================================================
  1132.  
  1133. end
  1134.  
  1135. #==============================================================================
  1136. # ** Cache
  1137. #==============================================================================
  1138. module Cache
  1139.  
  1140. #--------------------------------------------------------------------------
  1141. # * Hud
  1142. #--------------------------------------------------------------------------
  1143. def self.battle_hud(filename)
  1144. load_bitmap("Graphics/Huds/Battle/", filename)
  1145. end
  1146.  
  1147. end
  1148.  
  1149. #==============================================================================
  1150. # ** Game Temp
  1151. #==============================================================================
  1152. class Game_Temp
  1153.  
  1154. attr_accessor :battler_face_pos
  1155. attr_accessor :hud_pos
  1156. attr_accessor :hud_pos_real
  1157. attr_accessor :com_pos
  1158. attr_accessor :mbhud_force_refresh
  1159. attr_accessor :mbhud_window
  1160. attr_accessor :command_visible
  1161. attr_accessor :refresh_turn_sprite
  1162. attr_accessor :battle_hud_visible
  1163. attr_accessor :battle_hud_visible_refresh
  1164. attr_accessor :battle_end
  1165.  
  1166. #--------------------------------------------------------------------------
  1167. # * Initialize
  1168. #--------------------------------------------------------------------------
  1169. alias mog_monogatari_bhud_initialize initialize
  1170. def initialize
  1171. @battler_face_pos = []
  1172. @hud_pos = []
  1173. @hud_pos_real = []
  1174. @com_pos = []
  1175. @mbhud_force_refresh = false
  1176. @mbhud_window = [false,false,false,false,false,false,false]
  1177. @command_visible = false
  1178. @refresh_turn_sprite = false
  1179. @battle_hud_visible = true
  1180. @battle_hud_visible_refresh = [false,false]
  1181. @battle_end = false
  1182. mog_monogatari_bhud_initialize
  1183. end
  1184.  
  1185. #--------------------------------------------------------------------------
  1186. # * Check Screen Xyz
  1187. #--------------------------------------------------------------------------
  1188. def check_screen_xyz_nil
  1189. return if !SceneManager.face_battler?
  1190. for actor in $game_party.battle_members
  1191. actor.screen_x = 0 if actor.screen_x == nil
  1192. actor.screen_y = 0 if actor.screen_y == nil
  1193. actor.screen_z = 0 if actor.screen_z == nil
  1194. end
  1195. end
  1196.  
  1197. #--------------------------------------------------------------------------
  1198. # ● Sprite Visible
  1199. #--------------------------------------------------------------------------
  1200. def sprite_visible
  1201. return false if $game_message.visible
  1202. return false if $game_temp.battle_end
  1203. return true
  1204. end
  1205.  
  1206. end
  1207.  
  1208. #==============================================================================
  1209. # ** Game Interpreter
  1210. #==============================================================================
  1211. class Game_Interpreter
  1212.  
  1213. #--------------------------------------------------------------------------
  1214. # * Refresh Battle Hud
  1215. #--------------------------------------------------------------------------
  1216. def refresh_battle_hud
  1217. $game_temp.check_screen_xyz_nil rescue nil
  1218. $game_temp.mbhud_force_refresh = true
  1219. end
  1220.  
  1221. #--------------------------------------------------------------------------
  1222. # * Battler Face Name
  1223. #--------------------------------------------------------------------------
  1224. def battler_face_name(actor_id,face_name = "")
  1225. for actor in $game_party.members
  1226. actor.battler_face_name = face_name if actor.id == actor_id
  1227. end
  1228. refresh_battle_hud
  1229. end
  1230.  
  1231. #--------------------------------------------------------------------------
  1232. # * Battler Hud Visible
  1233. #--------------------------------------------------------------------------
  1234. def battle_hud_visible(value)
  1235. $game_temp.battle_hud_visible = value
  1236. end
  1237.  
  1238. #--------------------------------------------------------------------------
  1239. # * Command_129
  1240. #--------------------------------------------------------------------------
  1241. alias mog_monogatari_bhud_command_129 command_129
  1242. def command_129
  1243. mog_monogatari_bhud_command_129
  1244. refresh_battle_hud if SceneManager.scene_is?(Scene_Battle)
  1245. end
  1246.  
  1247. end
  1248.  
  1249. #==============================================================================
  1250. # ** Game Actor
  1251. #==============================================================================
  1252. class Game_Actor < Game_Battler
  1253.  
  1254. attr_accessor :face_animation
  1255. attr_accessor :battler_face_name
  1256.  
  1257. #--------------------------------------------------------------------------
  1258. # * Setup
  1259. #--------------------------------------------------------------------------
  1260. alias mog_monogatari_face_animation setup
  1261. def setup(actor_id)
  1262. mog_monogatari_face_animation(actor_id)
  1263. @face_animation = [0,0,0]
  1264. @battler_face_name = "Face_" + actor_id.to_s
  1265. end
  1266.  
  1267. #--------------------------------------------------------------------------
  1268. # ● Real Next Level
  1269. #--------------------------------------------------------------------------
  1270. def real_next_level
  1271. next_level_exp - exp_for_level(level)
  1272. end
  1273.  
  1274. #--------------------------------------------------------------------------
  1275. # ● Remain Exp
  1276. #--------------------------------------------------------------------------
  1277. def remain_exp
  1278. exp - exp_for_level(level)
  1279. end
  1280.  
  1281. #--------------------------------------------------------------------------
  1282. # ● Gain Exp Test
  1283. #--------------------------------------------------------------------------
  1284. def gain_exp_test
  1285. exp_r = rand(next_level_exp)
  1286. change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1287. end
  1288.  
  1289. #--------------------------------------------------------------------------
  1290. # ● Low HP?
  1291. #--------------------------------------------------------------------------
  1292. def low_hp?
  1293. hp <= (mhp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1294. end
  1295.  
  1296. #--------------------------------------------------------------------------
  1297. # ● Low MP?
  1298. #--------------------------------------------------------------------------
  1299. def low_mp?
  1300. mp <= (mmp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1301. end
  1302.  
  1303. #--------------------------------------------------------------------------
  1304. # ● Low TP?
  1305. #--------------------------------------------------------------------------
  1306. def low_tp?
  1307. tp <= (max_tp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1308. end
  1309.  
  1310. end
  1311.  
  1312. #==============================================================================
  1313. # ** Game Party
  1314. #==============================================================================
  1315. class Game_Party < Game_Unit
  1316.  
  1317. #--------------------------------------------------------------------------
  1318. # * Get Maximum Number of Battle Members
  1319. #--------------------------------------------------------------------------
  1320. def max_battle_members
  1321. return MOG_BATTLE_HUD_EX::MAX_BATTLE_MEMBERS
  1322. end
  1323.  
  1324. #--------------------------------------------------------------------------
  1325. # * Swap Order
  1326. #--------------------------------------------------------------------------
  1327. alias mog_bhex_swap_order swap_order
  1328. def swap_order(index1, index2)
  1329. mog_bhex_swap_order(index1, index2)
  1330. if SceneManager.scene_is?(Scene_Battle)
  1331. $game_temp.check_screen_xyz_nil rescue nil
  1332. $game_temp.mbhud_force_refresh = true
  1333. end
  1334. end
  1335.  
  1336. end
  1337.  
  1338. #==============================================================================
  1339. # ** BattleManager
  1340. #==============================================================================
  1341. module BattleManager
  1342.  
  1343. #--------------------------------------------------------------------------
  1344. # * Current Index
  1345. #--------------------------------------------------------------------------
  1346. def self.current_index
  1347. if $imported[:mog_atb_system]
  1348. return actor.index if actor
  1349. end
  1350. return 0 if @actor_index == nil
  1351. return @actor_index != -1 ? @actor_index : 0
  1352. end
  1353.  
  1354. #--------------------------------------------------------------------------
  1355. # * Current Index Real
  1356. #--------------------------------------------------------------------------
  1357. def self.current_index_real
  1358. return -1 if @actor_index == nil
  1359. return @actor_index
  1360. end
  1361.  
  1362. #--------------------------------------------------------------------------
  1363. # * Next Actor Avaliable
  1364. #--------------------------------------------------------------------------
  1365. def self.next_actor_avaliable?
  1366. return false if @actor_index == nil
  1367. next_index = @actor_index + 1
  1368. return false if next_index >= $game_party.members.size
  1369. return true
  1370. end
  1371.  
  1372. #--------------------------------------------------------------------------
  1373. # * To Next Command Input
  1374. #--------------------------------------------------------------------------
  1375. def self.next_command_avaliable
  1376. aindex = @actor_index
  1377. begin
  1378. if !actor || !actor.next_command
  1379. return false if actor == nil
  1380. aindex += 1
  1381. return false if aindex >= $game_party.members.size
  1382. end
  1383. end until actor.inputable?
  1384. return true
  1385. end
  1386.  
  1387. #--------------------------------------------------------------------------
  1388. # * Can Enable Window?
  1389. #--------------------------------------------------------------------------
  1390. def self.can_enable_window?
  1391. max_members = $game_party.members.size
  1392. index_real = current_index_real + 1
  1393. return false if index_real > max_members
  1394. return false if in_turn?
  1395. return false if $imported[:mog_battle_cursor]
  1396. return true
  1397. end
  1398.  
  1399. end
  1400.  
  1401. #==============================================================================
  1402. # ** SceneManager
  1403. #==============================================================================
  1404. module SceneManager
  1405.  
  1406. #--------------------------------------------------------------------------
  1407. # * Face Battler
  1408. #--------------------------------------------------------------------------
  1409. def self.face_battler?
  1410. return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
  1411. return false if !MOG_BATTLE_HUD_EX::FACE_VISIBLE
  1412. return false if $imported[:mog_sprite_actor]
  1413. return false if $imported[:ve_animated_battle]
  1414. return false if $imported[:ve_actor_battlers]
  1415. return false if $imported["YES-BattleSymphony"]
  1416. return false if $imported["YEA-VisualBattlers"]
  1417. return false if $imported["Galv_Animated_Battlers"]
  1418. return false if $imported['KRX-AnimatedBattlers']
  1419. return false if $imported[:Theo_BasicFuntions]
  1420. return false if $sv_camera != nil
  1421. return false if BattleManager.true_surprise != nil rescue nil
  1422. return false if $imported[:jet][:AnimatedBattlers] rescue nil
  1423. return true
  1424. end
  1425.  
  1426. end
  1427.  
  1428. #==============================================================================
  1429. # ■ Sprite Picture
  1430. #==============================================================================
  1431. class Sprite_Picture < Sprite
  1432.  
  1433. #--------------------------------------------------------------------------
  1434. # * Initialize
  1435. #--------------------------------------------------------------------------
  1436. alias mog_battle_hud_initialize initialize
  1437. def initialize(viewport, picture)
  1438. mog_battle_hud_initialize(viewport, picture)
  1439. self.viewport = nil if SceneManager.scene_is?(Scene_Battle)
  1440.  
  1441. end
  1442.  
  1443. #--------------------------------------------------------------------------
  1444. # * Update Position
  1445. #--------------------------------------------------------------------------
  1446. alias mog_battle_hud_update_position update_position
  1447. def update_position
  1448. mog_battle_hud_update_position
  1449. self.z = @picture.number + 120 if SceneManager.scene_is?(Scene_Battle)
  1450. end
  1451.  
  1452. end
  1453.  
  1454. #==============================================================================
  1455. # ■ Sprite Base
  1456. #==============================================================================
  1457. class Sprite_Base < Sprite
  1458.  
  1459. #--------------------------------------------------------------------------
  1460. # * Initialize
  1461. #--------------------------------------------------------------------------
  1462. alias mog_bhud_ex_initialize initialize
  1463. def initialize(viewport = nil)
  1464. @ani_x = SceneManager.face_battler? ? MOG_BATTLE_HUD_EX::HUD_Z + 20 : 100
  1465. mog_bhud_ex_initialize(viewport)
  1466. end
  1467.  
  1468. #--------------------------------------------------------------------------
  1469. # * Animation Set Sprite
  1470. #--------------------------------------------------------------------------
  1471. alias mog_battle_hud_ex_animation_set_sprites animation_set_sprites
  1472. def animation_set_sprites(frame)
  1473. mog_battle_hud_ex_animation_set_sprites(frame)
  1474. update_sprite_z_animation rescue nil if SceneManager.scene_is?(Scene_Battle)
  1475. end
  1476.  
  1477. #--------------------------------------------------------------------------
  1478. # * Update Sprite Z Animation
  1479. #--------------------------------------------------------------------------
  1480. def update_sprite_z_animation
  1481. if $imported[:mog_battle_camera]
  1482. @ani_sprites.each_with_index do |sprite, i|
  1483. sprite.z = @ani_x + i end
  1484. else
  1485. @ani_sprites.each_with_index do |sprite, i|
  1486. sprite.viewport = nil ; sprite.z = @ani_x + i end
  1487. end
  1488. end
  1489.  
  1490. end
  1491.  
  1492. #==============================================================================
  1493. # ** Spriteset Battle
  1494. #==============================================================================
  1495. class Spriteset_Battle
  1496.  
  1497. #--------------------------------------------------------------------------
  1498. # * Create Actors
  1499. #--------------------------------------------------------------------------
  1500. alias mog_battle_hud_create_actors create_actors
  1501. def create_actors
  1502. if can_create_max_members?
  1503. @actor_sprites = Array.new($game_party.max_battle_members) { Sprite_Battler.new(@viewport1) }
  1504. return
  1505. end
  1506. mog_battle_hud_create_actors
  1507. end
  1508.  
  1509. #--------------------------------------------------------------------------
  1510. # * Can Create Max Members
  1511. #--------------------------------------------------------------------------
  1512. def can_create_max_members?
  1513. return false if $imported[:ve_animated_battle]
  1514. return false if $imported[:ve_actor_battlers]
  1515. return false if $sv_camera != nil
  1516. return true
  1517. end
  1518.  
  1519. end
  1520.  
  1521. #==============================================================================
  1522. # ■ Scene Battle
  1523. #==============================================================================
  1524. class Scene_Battle < Scene_Base
  1525.  
  1526. #--------------------------------------------------------------------------
  1527. # ● Clear All Windows
  1528. #--------------------------------------------------------------------------
  1529. alias mog_battle_hud_ex_start start
  1530. def start
  1531. setup_battle_hud_ex
  1532. mog_battle_hud_ex_start
  1533. end
  1534.  
  1535. #--------------------------------------------------------------------------
  1536. # ● Setup Battle Hud EX
  1537. #--------------------------------------------------------------------------
  1538. def setup_battle_hud_ex
  1539. @force_clear_duration = 0
  1540. end
  1541.  
  1542. #--------------------------------------------------------------------------
  1543. # ● Clear All Windows
  1544. #--------------------------------------------------------------------------
  1545. def clear_all_windows
  1546. if @actor_window != nil
  1547. @actor_window.visible = false
  1548. @actor_window.active = false
  1549. end
  1550. if @status_window != nil
  1551. @status_window.visible = false
  1552. @status_window.active = false
  1553. end
  1554. if @actor_command_window != nil
  1555. @actor_command_window.visible = false
  1556. @actor_command_window.active = false
  1557. end
  1558. if @party_command_window != nil
  1559. @party_command_window.visible = false
  1560. @party_command_window.active = false
  1561. end
  1562. if @help_window != nil
  1563. @help_window.visible = false
  1564. end
  1565. end
  1566.  
  1567. #--------------------------------------------------------------------------
  1568. # ● Update
  1569. #--------------------------------------------------------------------------
  1570. alias mog_battle_hud_ex_update_main update
  1571. def update
  1572. mog_battle_hud_ex_update_main
  1573. update_battle_hud_ex
  1574. end
  1575.  
  1576. #--------------------------------------------------------------------------
  1577. # ● Update Battle Hud_ex
  1578. #--------------------------------------------------------------------------
  1579. def update_battle_hud_ex
  1580. @status_window.visible = false
  1581. end
  1582.  
  1583. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1584. #--------------------------------------------------------------------------
  1585. # * On Skill OK
  1586. #--------------------------------------------------------------------------
  1587. alias mog_battle_hud_ex_on_skill_ok on_skill_ok
  1588. def on_skill_ok
  1589. @skill = @skill_window.item
  1590. @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
  1591. mog_battle_hud_ex_on_skill_ok
  1592. end
  1593.  
  1594. #--------------------------------------------------------------------------
  1595. # * On Item OK
  1596. #--------------------------------------------------------------------------
  1597. alias mog_battle_hud_on_item_ok on_item_ok
  1598. def on_item_ok
  1599. @item = @item_window.item
  1600. @item_window.hide if @item.for_opponent? or @item.for_friend?
  1601. mog_battle_hud_on_item_ok
  1602. end
  1603.  
  1604. #--------------------------------------------------------------------------
  1605. # * On Enemy Cancel
  1606. #--------------------------------------------------------------------------
  1607. alias mog_battle_hud_ex_on_enemy_cancel on_enemy_cancel
  1608. def on_enemy_cancel
  1609. mog_battle_hud_ex_on_enemy_cancel
  1610. @skill_window.show if @skill_window.active
  1611. @item_window.show if @item_window.active
  1612. end
  1613.  
  1614. #--------------------------------------------------------------------------
  1615. # * On Actor Cancel
  1616. #--------------------------------------------------------------------------
  1617. alias mog_battle_hud_ex_on_actor_cancel on_actor_cancel
  1618. def on_actor_cancel
  1619. mog_battle_hud_ex_on_actor_cancel
  1620. @skill_window.show if @skill_window.active
  1621. @item_window.show if @item_window.active
  1622. mog_battle_hud_ex_on_actor_cancel
  1623. end
  1624. end
  1625.  
  1626. end
  1627.  
  1628. if SceneManager.face_battler?
  1629. #==============================================================================
  1630. # ■ Game_Actor
  1631. #==============================================================================
  1632. class Game_Actor < Game_Battler
  1633.  
  1634. attr_accessor :screen_x
  1635. attr_accessor :screen_y
  1636. attr_accessor :screen_z
  1637.  
  1638.  
  1639. #--------------------------------------------------------------------------
  1640. # ● Use Sprite?
  1641. #--------------------------------------------------------------------------
  1642. def use_sprite?
  1643. return true
  1644. end
  1645.  
  1646. end
  1647.  
  1648. #==============================================================================
  1649. # ■ Sprite_Battler
  1650. #==============================================================================
  1651. class Sprite_Battler < Sprite_Base
  1652. include MOG_BATTLE_HUD_EX
  1653.  
  1654. #--------------------------------------------------------------------------
  1655. # ● Update Collapse
  1656. #--------------------------------------------------------------------------
  1657. alias mog_battle_hud_update_collapse update_collapse
  1658. def update_collapse
  1659. return if face_can_cancel_method?
  1660. mog_battle_hud_update_collapse
  1661. end
  1662.  
  1663. #--------------------------------------------------------------------------
  1664. # ● Update Instant Collapse
  1665. #--------------------------------------------------------------------------
  1666. alias mog_battle_hud_update_instant_collapse update_instant_collapse
  1667. def update_instant_collapse
  1668. return if face_can_cancel_method?
  1669. mog_battle_hud_update_instant_collapse
  1670. end
  1671.  
  1672. #--------------------------------------------------------------------------
  1673. # ● Face Can Cancel Method
  1674. #--------------------------------------------------------------------------
  1675. def face_can_cancel_method?
  1676. return false if !SceneManager.face_battler?
  1677. return false if @battler.is_a?(Game_Enemy)
  1678. self.opacity = 255 ; self.visible = true
  1679. return true
  1680. end
  1681.  
  1682. #--------------------------------------------------------------------------
  1683. # ● Update Bitmap
  1684. #--------------------------------------------------------------------------
  1685. alias mog_battle_hud_ex_update_bitmap update_bitmap
  1686. def update_bitmap
  1687. return if face_can_cancel_method?
  1688. mog_battle_hud_ex_update_bitmap
  1689. end
  1690.  
  1691. #--------------------------------------------------------------------------
  1692. # ● Update Position
  1693. #--------------------------------------------------------------------------
  1694. alias mog_battle_hud_ex_update_position update_position
  1695. def update_position
  1696. if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  1697. if !face_sprite_visible? or $game_temp.battle_end
  1698. self.y = -1000
  1699. return
  1700. end
  1701. end
  1702. mog_battle_hud_ex_update_position
  1703. end
  1704.  
  1705. #--------------------------------------------------------------------------
  1706. # * Sprite Visible
  1707. #--------------------------------------------------------------------------
  1708. def face_sprite_visible?
  1709. return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  1710. return false if !$game_temp.battle_hud_visible
  1711. return true
  1712. end
  1713.  
  1714. end
  1715.  
  1716. end
  1717.  
  1718. #==============================================================================
  1719. # ** Window_BattleStatus
  1720. #==============================================================================
  1721. class Window_BattleStatus < Window_Selectable
  1722. include MOG_BATTLE_HUD_EX
  1723.  
  1724. #--------------------------------------------------------------------------
  1725. # * Get Window Width
  1726. #--------------------------------------------------------------------------
  1727. def window_width
  1728. ACTOR_WINDOW_SIZE[0]
  1729. end
  1730.  
  1731. #--------------------------------------------------------------------------
  1732. # * Refresh
  1733. #--------------------------------------------------------------------------
  1734. alias mog_monogatari_refresh refresh
  1735. def refresh
  1736. mog_monogatari_refresh
  1737. self.visible = false
  1738. self.opacity = 0
  1739. self.contents_opacity = 0
  1740. self.y = 1200
  1741. end
  1742.  
  1743. end
  1744.  
  1745. #==============================================================================
  1746. # ** Window Actor Command
  1747. #==============================================================================
  1748. class Window_ActorCommand < Window_Command
  1749.  
  1750. #--------------------------------------------------------------------------
  1751. # * Update
  1752. #--------------------------------------------------------------------------
  1753. alias mog_hud_battle_hud_ex_turn_sprite_update update
  1754. def update
  1755. mog_hud_battle_hud_ex_turn_sprite_update
  1756. $game_temp.command_visible = self.visible
  1757. end
  1758.  
  1759. end
  1760.  
  1761. #==============================================================================
  1762. # ** Window_BattleActor
  1763. #==============================================================================
  1764. class Window_BattleActor < Window_BattleStatus
  1765.  
  1766. #--------------------------------------------------------------------------
  1767. # * Refresh
  1768. #--------------------------------------------------------------------------
  1769. alias mog_battle_hud_ex_actor_w_refresh refresh
  1770. def refresh
  1771. mog_battle_hud_ex_actor_w_refresh
  1772. self.contents_opacity = 255
  1773. self.opacity = 255 if !MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1774. self.visible = true
  1775. end
  1776.  
  1777. end
  1778.  
  1779. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1780.  
  1781. #==============================================================================
  1782. # ** Window BattleLog
  1783. #==============================================================================
  1784. class Window_BattleLog < Window_Selectable
  1785.  
  1786. include MOG_BATTLE_HUD_EX
  1787.  
  1788. #--------------------------------------------------------------------------
  1789. # * Initialize
  1790. #--------------------------------------------------------------------------
  1791. alias mog_battle_hud_ex_log_initialize initialize
  1792. def initialize
  1793. mog_battle_hud_ex_log_initialize
  1794. self.x = BATTLE_LOG_POSITION[0]
  1795. self.y = BATTLE_LOG_POSITION[1]
  1796. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1797. end
  1798.  
  1799. #--------------------------------------------------------------------------
  1800. # * Create Back Sprite
  1801. #--------------------------------------------------------------------------
  1802. alias mog_battle_hud_ex_log_create_back_sprite create_back_sprite
  1803. def create_back_sprite
  1804. self.x = BATTLE_LOG_POSITION[0]
  1805. self.y = BATTLE_LOG_POSITION[1]
  1806. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1807. mog_battle_hud_ex_log_create_back_sprite
  1808. end
  1809.  
  1810. end
  1811.  
  1812. #==============================================================================
  1813. # ** Window Actor Command
  1814. #==============================================================================
  1815. class Window_ActorCommand < Window_Command
  1816.  
  1817. include MOG_BATTLE_HUD_EX
  1818.  
  1819. #--------------------------------------------------------------------------
  1820. # * Initialize
  1821. #--------------------------------------------------------------------------
  1822. alias mog_monogatari_initialize initialize
  1823. def initialize
  1824. mog_monogatari_initialize
  1825. create_layout if $imported[:mog_battle_command_ex] == nil
  1826. end
  1827.  
  1828. #--------------------------------------------------------------------------
  1829. # * Dispose
  1830. #--------------------------------------------------------------------------
  1831. alias mog_monogatari_actor_command_dispose dispose
  1832. def dispose
  1833. mog_monogatari_actor_command_dispose
  1834. dispose_layout
  1835. end
  1836.  
  1837. #--------------------------------------------------------------------------
  1838. # * Create Layout
  1839. #--------------------------------------------------------------------------
  1840. def create_layout
  1841. return if @layout != nil
  1842. return if !ACTOR_COMMAND_LAYOUT
  1843. return if $game_temp.mbhud_window[0]
  1844. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1845. $game_temp.mbhud_window[0] = true
  1846. @layout = Sprite.new
  1847. @layout.bitmap = Cache.battle_hud("Layout_Command")
  1848. @layout.z = self.z - 1
  1849. @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1850. @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1851. @layout.visible = false
  1852. end
  1853.  
  1854. #--------------------------------------------------------------------------
  1855. # * Dispose Layout
  1856. #--------------------------------------------------------------------------
  1857. def dispose_layout
  1858. return if @layout == nil
  1859. @layout.dispose
  1860. @layout = nil
  1861. end
  1862.  
  1863. #--------------------------------------------------------------------------
  1864. # * Refresh Layout
  1865. #--------------------------------------------------------------------------
  1866. def refresh_layout
  1867. return if @layout == nil
  1868. @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1869. @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1870. @layout.visible = self.visible
  1871. @layout.z = self.z - 1
  1872. end
  1873.  
  1874. #--------------------------------------------------------------------------
  1875. # * Select
  1876. #--------------------------------------------------------------------------
  1877. alias mog_monogatari_select_actor_command select
  1878. def select(index)
  1879. mog_monogatari_select_actor_command(index)
  1880. set_command_position if $imported[:mog_battle_command_ex] == nil
  1881. end
  1882.  
  1883. #--------------------------------------------------------------------------
  1884. # * Set Command Position
  1885. #--------------------------------------------------------------------------
  1886. def set_command_position
  1887. self.viewport = nil
  1888. self.opacity = ACTOR_COMMAND_OPACITY
  1889. battler_index = BattleManager.current_index rescue nil
  1890. battler_index = 0 if battler_index == nil
  1891. if @actor != nil and $game_temp.hud_pos[battler_index] != nil
  1892. if FIXED_COMMAND_POSITION[battler_index] != nil
  1893. self.x = FIXED_COMMAND_POSITION[battler_index][0]
  1894. self.y = FIXED_COMMAND_POSITION[battler_index][1]
  1895. else
  1896. self.x = ACTOR_COMMAND_POSITION[0] + $game_temp.hud_pos[battler_index][0] - (self.width / 2)
  1897. self.x = Graphics.width - self.width if self.x + self.width > Graphics.width
  1898. self.x = 0 if self.x < 0
  1899. self.y = ACTOR_COMMAND_POSITION[1] + $game_temp.hud_pos[battler_index][1] - self.height
  1900. end
  1901. end
  1902. refresh_layout
  1903. end
  1904.  
  1905. #--------------------------------------------------------------------------
  1906. # * Refresh
  1907. #--------------------------------------------------------------------------
  1908. alias mog_battle_hud_ex_refresh refresh
  1909. def refresh
  1910. mog_battle_hud_ex_refresh
  1911. $game_temp.refresh_turn_sprite = true if $imported[:mog_battle_command_ex] == nil
  1912. end
  1913.  
  1914. #--------------------------------------------------------------------------
  1915. # * Update
  1916. #--------------------------------------------------------------------------
  1917. alias mog_monogatari_actor_commnand_update update
  1918. def update
  1919. mog_monogatari_actor_commnand_update
  1920. if $imported[:mog_battle_command_ex] == nil
  1921. self.visible = self.active
  1922. if !@layout.nil?
  1923. refresh_layout if @layout.visible != self.visible
  1924. @layout.visible = false if !$game_temp.sprite_visible
  1925. end
  1926. self.visible = false if !$game_temp.sprite_visible
  1927. end
  1928. end
  1929.  
  1930. end
  1931.  
  1932. #==============================================================================
  1933. # ** Window_PartyCommand
  1934. #==============================================================================
  1935. class Window_PartyCommand < Window_Command
  1936.  
  1937. include MOG_BATTLE_HUD_EX
  1938.  
  1939. #--------------------------------------------------------------------------
  1940. # * Initialize
  1941. #--------------------------------------------------------------------------
  1942. alias mog_monogatari_party_initialize initialize
  1943. def initialize
  1944. mog_monogatari_party_initialize
  1945. # self.x = @org_position[0] ; self.y = @org_position[1]
  1946. # self.opacity = PARTY_COMMAND_OPACITY
  1947. create_layout
  1948. end
  1949.  
  1950. #--------------------------------------------------------------------------
  1951. # * Dispose
  1952. #--------------------------------------------------------------------------
  1953. alias mog_monogatari_party_window_dispose dispose
  1954. def dispose
  1955. mog_monogatari_party_window_dispose
  1956. dispose_layout
  1957. end
  1958.  
  1959. #--------------------------------------------------------------------------
  1960. # * Create Layout
  1961. #--------------------------------------------------------------------------
  1962. def create_layout
  1963. return if @layout != nil
  1964. return if !PARTY_COMMAND_LAYOUT
  1965. return if $game_temp.mbhud_window[1]
  1966. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1967. $game_temp.mbhud_window[1] = true
  1968. @org_position_2 = [@org_position[0] + PARTY_COMMAND_LAYOUT_POSITION[0],@org_position[1] + PARTY_COMMAND_LAYOUT_POSITION[1]]
  1969. @layout = Sprite.new
  1970. @layout.bitmap = Cache.battle_hud("Layout_Party")
  1971. @layout.z = self.z - 1
  1972. refresh_layout
  1973. @layout.visible = false
  1974. end
  1975.  
  1976. #--------------------------------------------------------------------------
  1977. # * Dispose Layout
  1978. #--------------------------------------------------------------------------
  1979. def dispose_layout
  1980. return if @layout == nil
  1981. @layout.dispose
  1982. @layout = nil
  1983. end
  1984.  
  1985. #--------------------------------------------------------------------------
  1986. # * Refresh Layout
  1987. #--------------------------------------------------------------------------
  1988. def refresh_layout
  1989. return if @layout == nil
  1990. @layout.x = @org_position_2[0]
  1991. @layout.y = @org_position_2[1]
  1992. @layout.x += PARTY_COMMAND_SLIDE_POSITION[0] if PARTY_COMMAND_SLIDE_EFFECT
  1993. @layout.y += PARTY_COMMAND_SLIDE_POSITION[1] if PARTY_COMMAND_SLIDE_EFFECT
  1994. @layout.visible = self.visible
  1995. end
  1996.  
  1997. #--------------------------------------------------------------------------
  1998. # * Select
  1999. #--------------------------------------------------------------------------
  2000. alias mog_monogatari_refresh_partycommand refresh
  2001. def refresh
  2002. if @org_position == nil
  2003. @org_position = [PARTY_COMMAND_POSITION[0] - (self.width / 2),
  2004. PARTY_COMMAND_POSITION[1] - (self.height / 2)]
  2005. end
  2006. mog_monogatari_refresh_partycommand
  2007.  
  2008. self.viewport = nil
  2009. self.x = @org_position[0] ; self.y = @org_position[1]
  2010. if PARTY_COMMAND_SLIDE_EFFECT
  2011. self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2012. self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2013.  
  2014. end
  2015. self.opacity = PARTY_COMMAND_OPACITY
  2016. end
  2017.  
  2018. def show
  2019.  
  2020. end
  2021.  
  2022. #--------------------------------------------------------------------------
  2023. # * Show
  2024. #--------------------------------------------------------------------------
  2025. alias mog_bg_ex_slide_show_party show
  2026. def show
  2027. self.viewport = nil
  2028. self.x = @org_position[0] ; self.y = @org_position[1]
  2029. if PARTY_COMMAND_SLIDE_EFFECT
  2030. self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2031. self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2032.  
  2033. end
  2034. self.opacity = PARTY_COMMAND_OPACITY
  2035. mog_bg_ex_slide_show_party
  2036. end
  2037.  
  2038. #--------------------------------------------------------------------------
  2039. # * Update
  2040. #--------------------------------------------------------------------------
  2041. alias mog_monogatari_party_window_update update
  2042. def update
  2043. mog_monogatari_party_window_update
  2044. self.visible = self.active
  2045. if @layout != nil and @layout.visible != self.visible
  2046. refresh_layout
  2047. end
  2048. execute_slide_effect if self.visible
  2049. end
  2050.  
  2051. end
  2052.  
  2053. #==============================================================================
  2054. # ** Window_Help
  2055. #==============================================================================
  2056. class Window_Help < Window_Base
  2057.  
  2058. include MOG_BATTLE_HUD_EX
  2059.  
  2060. #--------------------------------------------------------------------------
  2061. # * Object Initialization
  2062. #--------------------------------------------------------------------------
  2063. alias mog_monogatari_battle_help_initialize initialize
  2064. def initialize(line_number = 2)
  2065. @battle_phase = false
  2066. mog_monogatari_battle_help_initialize(line_number)
  2067. @wait_time = 5
  2068. if SceneManager.scene_is?(Scene_Battle)
  2069. @battle_phase = true
  2070. self.width = HELP_WINDOW_SIZE[0]
  2071. self.height = HELP_WINDOW_SIZE[1]
  2072. @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
  2073. HELP_WINDOW_POSITION[1]]
  2074. self.x = @org_position[0]
  2075. self.y = @org_position[1]
  2076. self.opacity = HELP_WINDOW_OPACITY
  2077. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2078. create_layout
  2079. end
  2080. end
  2081.  
  2082. #--------------------------------------------------------------------------
  2083. # * Dispose
  2084. #--------------------------------------------------------------------------
  2085. alias mog_monogatari_help_window_dispose dispose
  2086. def dispose
  2087. mog_monogatari_help_window_dispose
  2088. dispose_layout
  2089. end
  2090.  
  2091. #--------------------------------------------------------------------------
  2092. # * Create Layout
  2093. #--------------------------------------------------------------------------
  2094. def create_layout
  2095. return if @layout != nil
  2096. return if !HELP_WINDOW_LAYOUT
  2097. return if $game_temp.mbhud_window[2]
  2098. return if !SceneManager.scene_is?(Scene_Battle)
  2099. $game_temp.mbhud_window[2] = true
  2100. @org_position_2 = [self.x + HELP_WINDOW_LAYOUT_POSITION[0],self.y + HELP_WINDOW_LAYOUT_POSITION[1]]
  2101. @layout = Sprite.new
  2102. @layout.bitmap = Cache.battle_hud("Layout_Help")
  2103. @layout.z = self.z - 1
  2104. refresh_layout
  2105. @layout.visible = false
  2106. end
  2107.  
  2108. #--------------------------------------------------------------------------
  2109. # * Dispose Layout
  2110. #--------------------------------------------------------------------------
  2111. def dispose_layout
  2112. return if @layout == nil
  2113. @layout.dispose
  2114. @layout = nil
  2115. end
  2116.  
  2117. #--------------------------------------------------------------------------
  2118. # * Refresh Layout
  2119. #--------------------------------------------------------------------------
  2120. def refresh_layout
  2121. return if @layout == nil
  2122. @layout.x = @org_position_2[0]
  2123. @layout.y = @org_position_2[1]
  2124. @layout.x += HELP_WINDOW_SLIDE_POSITION[0] if HELP_WINDOW_SLIDE_EFFECT
  2125. @layout.y += HELP_WINDOW_SLIDE_POSITION[1] if HELP_WINDOW_SLIDE_EFFECT
  2126. @layout.visible = self.visible
  2127. end
  2128.  
  2129. #--------------------------------------------------------------------------
  2130. # * Show
  2131. #--------------------------------------------------------------------------
  2132. alias mog_bg_ex_slide_show_help show
  2133. def show
  2134. if @battle_phase
  2135. self.viewport = nil
  2136. self.x = @org_position[0] ; self.y = @org_position[1]
  2137. if HELP_WINDOW_SLIDE_EFFECT
  2138. self.x += HELP_WINDOW_SLIDE_POSITION[0]
  2139. self.y += HELP_WINDOW_SLIDE_POSITION[1]
  2140. end
  2141. self.opacity = HELP_WINDOW_OPACITY
  2142. end
  2143. mog_bg_ex_slide_show_help
  2144. end
  2145.  
  2146. #--------------------------------------------------------------------------
  2147. # * Update
  2148. #--------------------------------------------------------------------------
  2149. alias mog_monogatari_help_window_update update
  2150. def update
  2151. if @wait_time > 0
  2152. @wait_time -= 1
  2153. return
  2154. end
  2155. mog_monogatari_help_window_update
  2156. if SceneManager.scene_is?(Scene_Battle)
  2157. if @layout != nil
  2158. refresh_layout if @layout.visible != self.visible
  2159. @layout.visible = self.visible
  2160. end
  2161. self.visible = false if !$game_temp.sprite_visible
  2162. execute_slide_effect if self.visible
  2163. end
  2164. end
  2165.  
  2166. end
  2167.  
  2168. #==============================================================================
  2169. # ** Window_BattleActor
  2170. #==============================================================================
  2171. class Window_BattleActor < Window_BattleStatus
  2172.  
  2173. include MOG_BATTLE_HUD_EX
  2174.  
  2175. #--------------------------------------------------------------------------
  2176. # * Initialize
  2177. #--------------------------------------------------------------------------
  2178. alias mog_monogatari_battle_actor_initialize initialize
  2179. def initialize(info_viewport)
  2180. @force_hide = can_force_hide?
  2181. mog_monogatari_battle_actor_initialize(info_viewport)
  2182. self.width = ACTOR_WINDOW_SIZE[0]
  2183. self.height = ACTOR_WINDOW_SIZE[1]
  2184. @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
  2185. ACTOR_WINDOW_POSITION[1] - self.height]
  2186. @org_position[1] = Graphics.height + 64 if @force_hide
  2187. self.x = @org_position[0]
  2188. self.y = @org_position[1]
  2189. self.opacity = ACTOR_WINDOW_OPACITY
  2190. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2191. self.viewport = nil
  2192. create_layout
  2193. end
  2194.  
  2195. #--------------------------------------------------------------------------
  2196. # * Can Force Hide?
  2197. #--------------------------------------------------------------------------
  2198. def can_force_hide?
  2199. return true if $imported[:ve_target_arrow]
  2200. return true if $imported[:mog_battle_cursor]
  2201. return false
  2202. end
  2203.  
  2204. #--------------------------------------------------------------------------
  2205. # * Dispose
  2206. #--------------------------------------------------------------------------
  2207. alias mog_monogatari_actor_window_dispose dispose
  2208. def dispose
  2209. mog_monogatari_actor_window_dispose
  2210. dispose_layout
  2211. end
  2212.  
  2213. #--------------------------------------------------------------------------
  2214. # * Create Layout
  2215. #--------------------------------------------------------------------------
  2216. def create_layout
  2217. return if @layout != nil
  2218. return if !ACTOR_WINDOW_LAYOUT
  2219. return if $game_temp.mbhud_window[3]
  2220. $game_temp.mbhud_window[3] = true
  2221. @org_position_2 = [self.x + ACTOR_WINDOW_LAYOUT_POSITION[0],self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]]
  2222. @layout = Sprite.new
  2223. @layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
  2224. @layout.z = self.z - 1
  2225. refresh_layout
  2226. @layout.visible = false
  2227. end
  2228.  
  2229. #--------------------------------------------------------------------------
  2230. # * Dispose Layout
  2231. #--------------------------------------------------------------------------
  2232. def dispose_layout
  2233. return if @layout == nil
  2234. @layout.dispose
  2235. @layout = nil
  2236. end
  2237.  
  2238. #--------------------------------------------------------------------------
  2239. # * Refresh Layout
  2240. #--------------------------------------------------------------------------
  2241. def refresh_layout
  2242. return if @layout == nil
  2243. @layout.x = @org_position_2[0]
  2244. @layout.y = @org_position_2[1]
  2245. @layout.x += ACTOR_WINDOW_SLIDE_POSITION[0] if ACTOR_WINDOW_SLIDE_EFFECT
  2246. @layout.y += ACTOR_WINDOW_SLIDE_POSITION[1] if ACTOR_WINDOW_SLIDE_EFFECT
  2247. @layout.visible = self.visible
  2248. end
  2249.  
  2250. if $imported[:ve_target_arrow]
  2251. #--------------------------------------------------------------------------
  2252. # * New method: show_actor
  2253. #--------------------------------------------------------------------------
  2254. alias mog_battle_hud_ex_show_actor show_actor
  2255. def show_actor
  2256. return true if SceneManager.face_battler?
  2257. mog_battle_hud_ex_show_actor
  2258. end
  2259. end
  2260.  
  2261. #--------------------------------------------------------------------------
  2262. # * Show
  2263. #--------------------------------------------------------------------------
  2264. alias mog_bg_ex_slide_show_actor show
  2265. def show
  2266. self.viewport = nil
  2267. self.x = @org_position[0] ; self.y = @org_position[1]
  2268. if ACTOR_WINDOW_SLIDE_EFFECT
  2269. self.x += ACTOR_WINDOW_SLIDE_POSITION[0]
  2270. self.y += ACTOR_WINDOW_SLIDE_POSITION[1]
  2271. end
  2272. self.opacity = ACTOR_WINDOW_OPACITY
  2273. mog_bg_ex_slide_show_actor
  2274. end
  2275.  
  2276. #--------------------------------------------------------------------------
  2277. # * Update
  2278. #--------------------------------------------------------------------------
  2279. alias mog_monogatari_actor_window_update update
  2280. def update
  2281. mog_monogatari_actor_window_update
  2282. self.visible = self.active
  2283. self.visible = false if @force_hide
  2284. if @layout != nil
  2285. refresh_layout if @layout.visible != self.visible
  2286. end
  2287. if !$game_temp.sprite_visible
  2288. self.visible = false
  2289. @layout.visible = self.visible if @layout != nil
  2290. end
  2291. execute_slide_effect if self.visible
  2292. end
  2293.  
  2294. end
  2295.  
  2296. #==============================================================================
  2297. # ** Window_BattleEnemy
  2298. #==============================================================================
  2299. class Window_BattleEnemy < Window_Selectable
  2300.  
  2301. include MOG_BATTLE_HUD_EX
  2302.  
  2303. #--------------------------------------------------------------------------
  2304. # * Initialize
  2305. #--------------------------------------------------------------------------
  2306. alias mog_monogatari_battle_enemy_initialize initialize
  2307. def initialize(info_viewport)
  2308. @force_hide = can_force_hide?
  2309. mog_monogatari_battle_enemy_initialize(info_viewport)
  2310. self.width = ENEMY_WINDOW_SIZE[0]
  2311. self.height = ENEMY_WINDOW_SIZE[1]
  2312. @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
  2313. ENEMY_WINDOW_POSITION[1] - self.height]
  2314. @org_position[1] = Graphics.height + 64 if @force_hide
  2315. self.x = @org_position[0]
  2316. self.y = @org_position[1]
  2317. self.opacity = ENEMY_WINDOW_OPACITY
  2318. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2319. create_layout
  2320. end
  2321.  
  2322. #--------------------------------------------------------------------------
  2323. # * Can Force Hide?
  2324. #--------------------------------------------------------------------------
  2325. def can_force_hide?
  2326. return true if $imported[:ve_target_arrow]
  2327. return true if $imported[:mog_battle_cursor]
  2328. return false
  2329. end
  2330.  
  2331. #--------------------------------------------------------------------------
  2332. # * Dispose
  2333. #--------------------------------------------------------------------------
  2334. alias mog_monogatari_enemy_window_dispose dispose
  2335. def dispose
  2336. mog_monogatari_enemy_window_dispose
  2337. dispose_layout
  2338. end
  2339.  
  2340. #--------------------------------------------------------------------------
  2341. # * Create Layout
  2342. #--------------------------------------------------------------------------
  2343. def create_layout
  2344. return if @layout != nil
  2345. return if !ENEMY_WINDOW_LAYOUT
  2346. return if $game_temp.mbhud_window[4]
  2347. $game_temp.mbhud_window[4] = true
  2348. @org_position_2 = [self.x + ENEMY_WINDOW_LAYOUT_POSITION[0],self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]]
  2349. @layout = Sprite.new
  2350. @layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
  2351. @layout.z = self.z - 1
  2352. refresh_layout
  2353. @layout.visible = false
  2354. end
  2355.  
  2356. #--------------------------------------------------------------------------
  2357. # * Dispose Layout
  2358. #--------------------------------------------------------------------------
  2359. def dispose_layout
  2360. return if @layout == nil
  2361. @layout.dispose
  2362. @layout = nil
  2363. end
  2364.  
  2365. #--------------------------------------------------------------------------
  2366. # * Refresh Layout
  2367. #--------------------------------------------------------------------------
  2368. def refresh_layout
  2369. return if @layout == nil
  2370. @layout.x = @org_position_2[0]
  2371. @layout.y = @org_position_2[1]
  2372. @layout.x += ENEMY_WINDOW_SLIDE_POSITION[0] if ENEMY_WINDOW_SLIDE_EFFECT
  2373. @layout.y += ENEMY_WINDOW_SLIDE_POSITION[1] if ENEMY_WINDOW_SLIDE_EFFECT
  2374. @layout.visible = self.visible
  2375. end
  2376.  
  2377. #--------------------------------------------------------------------------
  2378. # * Show
  2379. #--------------------------------------------------------------------------
  2380. alias mog_bg_ex_slide_show_enemy show
  2381. def show
  2382. self.viewport = nil
  2383. self.x = @org_position[0] ; self.y = @org_position[1]
  2384. if ENEMY_WINDOW_SLIDE_EFFECT
  2385. self.x += ENEMY_WINDOW_SLIDE_POSITION[0]
  2386. self.y += ENEMY_WINDOW_SLIDE_POSITION[1]
  2387. end
  2388. self.opacity = ENEMY_WINDOW_OPACITY
  2389. mog_bg_ex_slide_show_enemy
  2390. end
  2391.  
  2392. #--------------------------------------------------------------------------
  2393. # * Update
  2394. #--------------------------------------------------------------------------
  2395. alias mog_monogatari_enemy_window_update update
  2396. def update
  2397. mog_monogatari_enemy_window_update
  2398. self.visible = false if @force_hide
  2399. if @layout != nil and @layout.visible != self.visible
  2400. refresh_layout
  2401. end
  2402. if !$game_temp.sprite_visible
  2403. self.visible = false
  2404. @layout.visible = self.visible if @layout != nil
  2405. end
  2406. execute_slide_effect if self.visible
  2407. end
  2408.  
  2409. if $imported["YEA-BattleEngine"]
  2410. #--------------------------------------------------------------------------
  2411. # * Draw Item
  2412. #--------------------------------------------------------------------------
  2413. def draw_item(index)
  2414. change_color(normal_color)
  2415. name = $game_troop.alive_members[index].name
  2416. draw_text(item_rect_for_text(index), name)
  2417. end
  2418. end
  2419.  
  2420. #--------------------------------------------------------------------------
  2421. # * Process Cursor Move
  2422. #--------------------------------------------------------------------------
  2423. alias mog_atb_wenemy_process_cursor_move process_cursor_move
  2424. def process_cursor_move
  2425. return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2426. mog_atb_wenemy_process_cursor_move
  2427. end
  2428.  
  2429. #--------------------------------------------------------------------------
  2430. # * Process Handling
  2431. #--------------------------------------------------------------------------
  2432. alias mog_atb_wenemy_process_handling process_handling
  2433. def process_handling
  2434. return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2435. mog_atb_wenemy_process_handling
  2436. end
  2437.  
  2438. end
  2439.  
  2440. #==============================================================================
  2441. # ** Window_BattleSkill
  2442. #==============================================================================
  2443. class Window_BattleSkill < Window_SkillList
  2444. include MOG_BATTLE_HUD_EX
  2445.  
  2446. #--------------------------------------------------------------------------
  2447. # * Initialize
  2448. #--------------------------------------------------------------------------
  2449. alias mog_monogatari_battle_skill_initialize initialize
  2450. def initialize(help_window, info_viewport)
  2451. @force_hide = can_force_hide?
  2452. @force_hide_active = can_force_hide_active?
  2453. mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  2454. self.width = SKILL_WINDOW_SIZE[0]
  2455. self.height = SKILL_WINDOW_SIZE[1]
  2456. @org_position = [SKILL_WINDOW_POSITION[0],
  2457. Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  2458. self.x = @org_position[0]
  2459. self.y = @org_position[1]
  2460. self.opacity = SKILL_WINDOW_OPACITY
  2461. self.viewport = nil
  2462. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2463. create_layout
  2464. end
  2465.  
  2466. #--------------------------------------------------------------------------
  2467. # * Col Max
  2468. #--------------------------------------------------------------------------
  2469. def col_max
  2470. return SKILL_COL_MAX
  2471. end
  2472.  
  2473. #--------------------------------------------------------------------------
  2474. # * Can Force Hide Active?
  2475. #--------------------------------------------------------------------------
  2476. def can_force_hide_active?
  2477. return true if $imported[:ve_target_arrow]
  2478. return true if $imported[:mog_battle_cursor] != nil
  2479. return false
  2480. end
  2481.  
  2482. #--------------------------------------------------------------------------
  2483. # * Can Force Hide?
  2484. #--------------------------------------------------------------------------
  2485. def can_force_hide?
  2486. return false
  2487. end
  2488.  
  2489. #--------------------------------------------------------------------------
  2490. # * Dispose
  2491. #--------------------------------------------------------------------------
  2492. alias mog_monogatari_skill_window_dispose dispose
  2493. def dispose
  2494. mog_monogatari_skill_window_dispose
  2495. dispose_layout
  2496. end
  2497.  
  2498. #--------------------------------------------------------------------------
  2499. # * Create Layout
  2500. #--------------------------------------------------------------------------
  2501. def create_layout
  2502. return if @layout != nil
  2503. return if !SKILL_WINDOW_LAYOUT
  2504. return if $game_temp.mbhud_window[5]
  2505. $game_temp.mbhud_window[5] = true
  2506. @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
  2507. @layout = Sprite.new
  2508. @layout.bitmap = Cache.battle_hud("Layout_Skill")
  2509. @layout.z = self.z - 1
  2510. refresh_layout
  2511. @layout.visible = false
  2512. end
  2513.  
  2514. #--------------------------------------------------------------------------
  2515. # * Dispose Layout
  2516. #--------------------------------------------------------------------------
  2517. def dispose_layout
  2518. return if @layout == nil
  2519. @layout.dispose
  2520. @layout = nil
  2521. end
  2522.  
  2523. #--------------------------------------------------------------------------
  2524. # * Refresh Layout
  2525. #--------------------------------------------------------------------------
  2526. def refresh_layout
  2527. return if @layout == nil
  2528. @layout.x = @org_position_2[0]
  2529. @layout.y = @org_position_2[1]
  2530. @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
  2531. @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
  2532. @layout.visible = self.visible
  2533. end
  2534.  
  2535. #--------------------------------------------------------------------------
  2536. # * Show
  2537. #--------------------------------------------------------------------------
  2538. alias mog_bg_ex_slide_show_skill show
  2539. def show
  2540. self.viewport = nil
  2541. self.x = @org_position[0] ; self.y = @org_position[1]
  2542. if SKILL_WINDOW_SLIDE_EFFECT
  2543. self.x += SKILL_WINDOW_SLIDE_POSITION[0]
  2544. self.y += SKILL_WINDOW_SLIDE_POSITION[1]
  2545. end
  2546. self.opacity = SKILL_WINDOW_OPACITY
  2547. mog_bg_ex_slide_show_skill
  2548. end
  2549.  
  2550. #--------------------------------------------------------------------------
  2551. # * Update
  2552. #--------------------------------------------------------------------------
  2553. alias mog_monogatari_skill_window_update update
  2554. def update
  2555. mog_monogatari_skill_window_update
  2556. self.visible = self.active if @force_hide_active
  2557. self.visible = false if @force_hide
  2558. if @layout != nil and @layout.visible != self.visible
  2559. refresh_layout
  2560. end
  2561. self.visible = false if !$game_temp.sprite_visible
  2562. execute_slide_effect if self.visible
  2563. end
  2564.  
  2565. end
  2566.  
  2567. #==============================================================================
  2568. # ** Window_BattleItem
  2569. #==============================================================================
  2570. class Window_BattleItem < Window_ItemList
  2571. include MOG_BATTLE_HUD_EX
  2572.  
  2573. #--------------------------------------------------------------------------
  2574. # * Initialize
  2575. #--------------------------------------------------------------------------
  2576. alias mog_monogatari_battle_item_initialize initialize
  2577. def initialize(help_window, info_viewport)
  2578. @force_hide = can_force_hide?
  2579. @force_hide_active = can_force_hide_active?
  2580. mog_monogatari_battle_item_initialize(help_window, info_viewport)
  2581. self.width = ITEM_WINDOW_SIZE[0]
  2582. self.height = ITEM_WINDOW_SIZE[1]
  2583. @org_position = [ITEM_WINDOW_POSITION[0],
  2584. Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  2585. self.x = @org_position[0]
  2586. self.y = @org_position[1]
  2587. self.viewport = nil
  2588. self.opacity = ITEM_WINDOW_OPACITY
  2589. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2590. create_layout
  2591. end
  2592.  
  2593. #--------------------------------------------------------------------------
  2594. # * Col Max
  2595. #--------------------------------------------------------------------------
  2596. def col_max
  2597. return ITEM_COL_MAX
  2598. end
  2599.  
  2600. #--------------------------------------------------------------------------
  2601. # * Can Force Hide Active?
  2602. #--------------------------------------------------------------------------
  2603. def can_force_hide_active?
  2604. return true if $imported[:ve_target_arrow]
  2605. return true if $imported[:mog_battle_cursor] != nil
  2606. return false
  2607. end
  2608.  
  2609. #--------------------------------------------------------------------------
  2610. # * Can Force Hide?
  2611. #--------------------------------------------------------------------------
  2612. def can_force_hide?
  2613. return false
  2614. end
  2615.  
  2616. #--------------------------------------------------------------------------
  2617. # * Dispose
  2618. #--------------------------------------------------------------------------
  2619. alias mog_monogatari_item_window_dispose dispose
  2620. def dispose
  2621. mog_monogatari_item_window_dispose
  2622. dispose_layout
  2623. end
  2624.  
  2625. #--------------------------------------------------------------------------
  2626. # * Create Layout
  2627. #--------------------------------------------------------------------------
  2628. def create_layout
  2629. return if @layout != nil
  2630. return if !ITEM_WINDOW_LAYOUT
  2631. return if $game_temp.mbhud_window[6]
  2632. $game_temp.mbhud_window[6] = true
  2633. @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
  2634. @layout = Sprite.new
  2635. @layout.bitmap = Cache.battle_hud("Layout_Item")
  2636. @layout.z = self.z - 1
  2637. refresh_layout
  2638. @layout.visible = false
  2639. end
  2640.  
  2641. #--------------------------------------------------------------------------
  2642. # * Dispose Layout
  2643. #--------------------------------------------------------------------------
  2644. def dispose_layout
  2645. return if @layout == nil
  2646. @layout.dispose
  2647. @layout = nil
  2648. end
  2649.  
  2650. #--------------------------------------------------------------------------
  2651. # * Refresh Layout
  2652. #--------------------------------------------------------------------------
  2653. def refresh_layout
  2654. return if @layout == nil
  2655. @layout.x = @org_position_2[0]
  2656. @layout.y = @org_position_2[1]
  2657. @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
  2658. @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
  2659. @layout.visible = self.visible
  2660. end
  2661.  
  2662. #--------------------------------------------------------------------------
  2663. # * Show
  2664. #--------------------------------------------------------------------------
  2665. alias mog_bg_ex_slide_show_item show
  2666. def show
  2667. self.viewport = nil
  2668. self.x = @org_position[0] ; self.y = @org_position[1]
  2669. if ITEM_WINDOW_SLIDE_EFFECT
  2670. self.x += ITEM_WINDOW_SLIDE_POSITION[0]
  2671. self.y += ITEM_WINDOW_SLIDE_POSITION[1]
  2672. end
  2673. self.opacity = ITEM_WINDOW_OPACITY
  2674. mog_bg_ex_slide_show_item
  2675. end
  2676.  
  2677. #--------------------------------------------------------------------------
  2678. # * Update
  2679. #--------------------------------------------------------------------------
  2680. alias mog_monogatari_item_window_update update
  2681. def update
  2682. mog_monogatari_item_window_update
  2683. self.visible = self.active if @force_hide_active
  2684. self.visible = false if @force_hide
  2685. if @layout != nil
  2686. refresh_layout if @layout.visible != self.visible
  2687. end
  2688. self.visible = false if !$game_temp.sprite_visible
  2689. execute_slide_effect if self.visible
  2690. end
  2691.  
  2692. end
  2693.  
  2694. end
  2695.  
  2696. #--------------------------------------------------------------------------
  2697. #--------------------------------------------------------------------------
  2698. #################################
  2699. if $imported["YEA-BattleEngine"]
  2700. #################################
  2701.  
  2702. #==============================================================================
  2703. # ** Window_BattleStatusAid
  2704. #==============================================================================
  2705. class Window_BattleStatusAid < Window_BattleStatus
  2706.  
  2707. #--------------------------------------------------------------------------
  2708. # * Refresh
  2709. #--------------------------------------------------------------------------
  2710. def refresh
  2711. contents.clear
  2712. self.visible = false
  2713. end
  2714.  
  2715. end
  2716.  
  2717. #==============================================================================
  2718. # ** Window_BattleStatus
  2719. #==============================================================================
  2720. class Window_BattleStatus < Window_Selectable
  2721.  
  2722. #--------------------------------------------------------------------------
  2723. # * Update
  2724. #--------------------------------------------------------------------------
  2725. alias mog_monogatari_bhud_yf_update update
  2726. def update
  2727. mog_monogatari_bhud_yf_update
  2728. update_visible_yf
  2729. end
  2730.  
  2731. #--------------------------------------------------------------------------
  2732. # * Update Visible Yf
  2733. #--------------------------------------------------------------------------
  2734. def update_visible_yf
  2735. self.visible = self.active
  2736. self.visible = false if !$game_temp.sprite_visible
  2737. end
  2738.  
  2739. end
  2740.  
  2741. #==============================================================================
  2742. # ■ Window ActorCommand
  2743. #==============================================================================
  2744. class Window_ActorCommand < Window_Command
  2745.  
  2746. #--------------------------------------------------------------------------
  2747. # * Show
  2748. #--------------------------------------------------------------------------
  2749. alias mog_bhud_yf_command_show show
  2750. def show
  2751. return if !BattleManager.can_enable_window?
  2752. mog_bhud_yf_command_show
  2753. end
  2754.  
  2755. #--------------------------------------------------------------------------
  2756. # * Update
  2757. #--------------------------------------------------------------------------
  2758. alias mog_monogatari_bhud_yf_actorcommand_update update
  2759. def update
  2760. mog_monogatari_bhud_yf_actorcommand_update
  2761. update_visible_yf
  2762. end
  2763.  
  2764. #--------------------------------------------------------------------------
  2765. # * Update Visible Yf
  2766. #--------------------------------------------------------------------------
  2767. def update_visible_yf
  2768. self.visible = self.active
  2769. self.visible = false if !$game_temp.sprite_visible
  2770. end
  2771.  
  2772. end
  2773.  
  2774. #==============================================================================
  2775. # ** Scene Battle
  2776. #==============================================================================
  2777. class Scene_Battle < Scene_Base
  2778.  
  2779. include MOG_BATTLE_HUD_EX
  2780.  
  2781. #--------------------------------------------------------------------------
  2782. # alias method: create_skill_window
  2783. #--------------------------------------------------------------------------
  2784. alias mog_yf_scene_battle_create_skill_window create_skill_window
  2785. def create_skill_window
  2786. mog_yf_scene_battle_create_skill_window
  2787. @skill_window.width = SKILL_WINDOW_SIZE[0]
  2788. @skill_window.height = SKILL_WINDOW_SIZE[1]
  2789. @skill_window.x = SKILL_WINDOW_POSITION[0]
  2790. @skill_window.y = SKILL_WINDOW_POSITION[1]
  2791. end
  2792.  
  2793. #--------------------------------------------------------------------------
  2794. # alias method: create_item_window
  2795. #--------------------------------------------------------------------------
  2796. alias mog_yf_scene_battle_create_item_window create_item_window
  2797. def create_item_window
  2798. mog_yf_scene_battle_create_item_window
  2799. @item_window.width = ITEM_WINDOW_SIZE[0]
  2800. @item_window.height = ITEM_WINDOW_SIZE[1]
  2801. @item_window.x = ITEM_WINDOW_POSITION[0]
  2802. @item_window.y = ITEM_WINDOW_POSITION[1]
  2803. end
  2804.  
  2805. if !$imported[:mog_atb_system]
  2806. #--------------------------------------------------------------------------
  2807. # * Next Command
  2808. #--------------------------------------------------------------------------
  2809. def next_command
  2810. if BattleManager.next_command
  2811. @status_window.show
  2812. redraw_current_status
  2813. @actor_command_window.show
  2814. @status_aid_window.hide
  2815. start_actor_command_selection
  2816. else
  2817. turn_start
  2818. end
  2819. end
  2820. end
  2821.  
  2822. #--------------------------------------------------------------------------
  2823. # * STW Can Visible
  2824. #--------------------------------------------------------------------------
  2825. def stw_can_visible?
  2826. return false if !BattleManager.can_enable_window?
  2827. return false if @item_window.visible
  2828. return false if @skill_window.visible
  2829. return true if @actor_window.active
  2830. return false
  2831. end
  2832.  
  2833. if $imported["YEA-CommandEquip"]
  2834. #--------------------------------------------------------------------------
  2835. # * Command Equip
  2836. #--------------------------------------------------------------------------
  2837. alias mog_yf_command_equip command_equip
  2838. def command_equip
  2839. @actor_command_window.visible = false
  2840. @actor_command_window.update
  2841. $game_temp.battle_hud_visible_refresh = [true,false]
  2842. @spriteset.update_battle_hud_ex
  2843. @spriteset.battler_sprites.each do |s| s.dispose_animation end
  2844. mog_yf_command_equip
  2845. $game_temp.battle_hud_visible_refresh = [true,true]
  2846. end
  2847. end
  2848.  
  2849. end
  2850.  
  2851. end
  2852. #--------------------------------------------------------------------------
  2853.  
  2854.  
  2855. ######################################
  2856. if $imported["YEA-EnemyTargetInfo"]
  2857. ######################################
  2858.  
  2859. #==============================================================================
  2860. # ■ Window_Comparison
  2861. #==============================================================================
  2862. class Window_Comparison < Window_Base
  2863.  
  2864. #--------------------------------------------------------------------------
  2865. # * Refresh
  2866. #--------------------------------------------------------------------------
  2867. alias mog_battle_hud_ex_yf_refresh refresh
  2868. def refresh
  2869. mog_battle_hud_ex_yf_refresh
  2870. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2871. self.viewport = nil
  2872. end
  2873.  
  2874. end
  2875.  
  2876. #==============================================================================
  2877. # ■ Window_ComparisonHelp
  2878. #==============================================================================
  2879. class Window_ComparisonHelp < Window_Base
  2880.  
  2881. #--------------------------------------------------------------------------
  2882. # * Refresh
  2883. #--------------------------------------------------------------------------
  2884. alias mog_battle_hud_ex_yf_refresh refresh
  2885. def refresh
  2886. mog_battle_hud_ex_yf_refresh
  2887. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2888. self.viewport = nil
  2889. end
  2890.  
  2891. end
  2892. end
  2893. #--------------------------------------------------------------------------
  2894. #--------------------------------------------------------------------------
  2895.  
  2896.  
  2897. #################################
  2898. if $imported["YEA-EnemyTargetInfo"]
  2899. #################################
  2900. class Window_Comparison < Window_Base
  2901.  
  2902. #--------------------------------------------------------------------------
  2903. # initialize
  2904. #--------------------------------------------------------------------------
  2905. alias mog_battle_hud_yf_wcomparison_initialize initialize
  2906. def initialize(type)
  2907. mog_battle_hud_yf_wcomparison_initialize(type)
  2908. self.z = 102
  2909. end
  2910.  
  2911. end
  2912. end
  2913. #--------------------------------------------------------------------------
  2914. #--------------------------------------------------------------------------
  2915.  
  2916. #--------------------------------------------------------------------------
  2917. #--------------------------------------------------------------------------
  2918. #################################
  2919. if $imported["YSA-CATB"]
  2920. #################################
  2921.  
  2922. #==============================================================================
  2923. # ■ Enemy CATB Gauge Viewport
  2924. #==============================================================================
  2925. class Enemy_CATB_Gauge_Viewport < Viewport
  2926.  
  2927. #--------------------------------------------------------------------------
  2928. # initialize
  2929. #--------------------------------------------------------------------------
  2930. alias mog_battle_hud_ex_yami_initialize initialize
  2931. def initialize(battler, sprite, type)
  2932. mog_battle_hud_ex_yami_initialize(battler, sprite, type)
  2933. self.z = 90
  2934. end
  2935.  
  2936. end
  2937.  
  2938. #==============================================================================
  2939. # ■ Game_Battler
  2940. #==============================================================================
  2941. class Game_Battler < Game_BattlerBase
  2942.  
  2943. attr_accessor :catb_value
  2944. attr_accessor :max_atb
  2945.  
  2946. #--------------------------------------------------------------------------
  2947. # * Max ATB
  2948. #--------------------------------------------------------------------------
  2949. def max_atb
  2950. return MAX_CATB_VALUE
  2951. return 1
  2952. end
  2953.  
  2954. end
  2955.  
  2956. end
  2957. #--------------------------------------------------------------------------
  2958. #--------------------------------------------------------------------------
  2959.  
  2960. #==============================================================================
  2961. # ** Window Base
  2962. #==============================================================================
  2963. class Window_Base < Window
  2964.  
  2965. #--------------------------------------------------------------------------
  2966. # * Execute Move W
  2967. #--------------------------------------------------------------------------
  2968. def execute_move_w(sprite,type,cp,np)
  2969. sp = 6 + ((cp - np).abs / 10)
  2970. if cp > np ; cp -= sp ; cp = np if cp < np
  2971. elsif cp < np ; cp += sp ; cp = np if cp > np
  2972. end
  2973. sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  2974. end
  2975.  
  2976. #--------------------------------------------------------------------------
  2977. # * Set BH EX Font
  2978. #--------------------------------------------------------------------------
  2979. def set_bh_ex_font
  2980. return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
  2981. self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
  2982. self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
  2983. self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
  2984. self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
  2985. end
  2986.  
  2987. #--------------------------------------------------------------------------
  2988. # * Execute Slide Effect
  2989. #--------------------------------------------------------------------------
  2990. def execute_slide_effect
  2991. return if @org_position == nil
  2992. execute_move_w(self,0,self.x,@org_position[0])
  2993. execute_move_w(self,1,self.y,@org_position[1])
  2994. return if @layout == nil
  2995. execute_move_w(@layout,0,@layout.x,@org_position_2[0])
  2996. execute_move_w(@layout,1,@layout.y,@org_position_2[1])
  2997. end
  2998.  
  2999. end
  3000.  
  3001. #==============================================================================
  3002. # ** Window Help
  3003. #==============================================================================
  3004. class Window_Help < Window_Base
  3005.  
  3006. #--------------------------------------------------------------------------
  3007. # * Draw Text
  3008. #--------------------------------------------------------------------------
  3009. alias mog_bh_ex_draw_text_help draw_text
  3010. def draw_text(*args)
  3011. set_bh_ex_font
  3012. mog_bh_ex_draw_text_help(*args)
  3013. end
  3014.  
  3015. end
  3016.  
  3017. #==============================================================================
  3018. # ** Window BattleActor
  3019. #==============================================================================
  3020. class Window_BattleActor < Window_BattleStatus
  3021.  
  3022. #--------------------------------------------------------------------------
  3023. # * Draw Item
  3024. #--------------------------------------------------------------------------
  3025. alias mog_bbex_draw_item_actor draw_item
  3026. def draw_item(index)
  3027. set_bh_ex_font
  3028. mog_bbex_draw_item_actor(index)
  3029. end
  3030.  
  3031. end
  3032.  
  3033. #==============================================================================
  3034. # ** Window BattleEnemy
  3035. #==============================================================================
  3036. class Window_BattleEnemy < Window_Selectable
  3037.  
  3038. #--------------------------------------------------------------------------
  3039. # * Draw Item
  3040. #--------------------------------------------------------------------------
  3041. alias mog_bbex_draw_item_enemy draw_item
  3042. def draw_item(index)
  3043. set_bh_ex_font
  3044. mog_bbex_draw_item_enemy(index)
  3045. end
  3046.  
  3047. end
  3048.  
  3049. #==============================================================================
  3050. # ** Window ItemList
  3051. #==============================================================================
  3052. class Window_ItemList < Window_Selectable
  3053.  
  3054. #--------------------------------------------------------------------------
  3055. # * Draw Item Name
  3056. #--------------------------------------------------------------------------
  3057. alias mog_bhex_draw_item_name_item draw_item_name
  3058. def draw_item_name(item, x, y, enabled = true, width = 172)
  3059. set_bh_ex_font
  3060. mog_bhex_draw_item_name_item(item, x, y, enabled , width )
  3061. end
  3062.  
  3063. end
  3064.  
  3065. #==============================================================================
  3066. # ** Window SkillList
  3067. #==============================================================================
  3068. class Window_SkillList < Window_Selectable
  3069.  
  3070. #--------------------------------------------------------------------------
  3071. # * Draw Item Name
  3072. #--------------------------------------------------------------------------
  3073. alias mog_bhex_draw_item_name_skill draw_item_name
  3074. def draw_item_name(item, x, y, enabled = true, width = 172)
  3075. set_bh_ex_font
  3076. mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
  3077. end
  3078.  
  3079. end
  3080.  
  3081. #==============================================================================
  3082. # ** Spriteset_Battle
  3083. #==============================================================================
  3084. class Spriteset_Battle
  3085.  
  3086. #--------------------------------------------------------------------------
  3087. # * Initialize
  3088. #--------------------------------------------------------------------------
  3089. alias mog_battle_hud_ex_initialize initialize
  3090. def initialize
  3091. check_screen_xyz_nil rescue nil
  3092. mog_battle_hud_ex_initialize
  3093. create_battle_hud_ex
  3094. end
  3095.  
  3096. #--------------------------------------------------------------------------
  3097. # * Check Screen Xyz
  3098. #--------------------------------------------------------------------------
  3099. def check_screen_xyz_nil
  3100. return if !SceneManager.face_battler?
  3101. for actor in $game_party.battle_members
  3102. actor.screen_x = 0 if actor.screen_x == nil
  3103. actor.screen_y = 0 if actor.screen_y == nil
  3104. actor.screen_z = 0 if actor.screen_z == nil
  3105. end
  3106. end
  3107.  
  3108. #--------------------------------------------------------------------------
  3109. # * Check Screen Xyz after
  3110. #--------------------------------------------------------------------------
  3111. def check_screen_xyz_after
  3112. return if !SceneManager.face_battler?
  3113. $game_party.battle_members.each_with_index do |actor, index|
  3114. actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  3115. actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  3116. actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  3117. end
  3118. end
  3119.  
  3120. #--------------------------------------------------------------------------
  3121. # * Dispose
  3122. #--------------------------------------------------------------------------
  3123. alias mog_battle_hud_ex_dispose dispose
  3124. def dispose
  3125. dispose_battle_hud_ex
  3126. mog_battle_hud_ex_dispose
  3127. end
  3128.  
  3129. #--------------------------------------------------------------------------
  3130. # * Update
  3131. #--------------------------------------------------------------------------
  3132. alias mog_battle_hud_ex_update update
  3133. def update
  3134. mog_battle_hud_ex_update
  3135. update_battle_hud_ex
  3136. end
  3137.  
  3138. #--------------------------------------------------------------------------
  3139. # * Create Battle Hud EX
  3140. #--------------------------------------------------------------------------
  3141. def create_battle_hud_ex
  3142. return if @battle_hud_ex != nil
  3143. $game_temp.battle_hud_visible = true
  3144. @battle_hud_ex = Monogatari_Bhud.new(nil)
  3145. check_screen_xyz_after
  3146. end
  3147.  
  3148. #--------------------------------------------------------------------------
  3149. # * Dispose Battle Hud EX
  3150. #--------------------------------------------------------------------------
  3151. def dispose_battle_hud_ex
  3152. return if @battle_hud_ex == nil
  3153. @battle_hud_ex.dispose
  3154. @battle_hud_ex = nil
  3155. $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  3156. end
  3157.  
  3158. #--------------------------------------------------------------------------
  3159. # * Update Battle Hud EX
  3160. #--------------------------------------------------------------------------
  3161. def update_battle_hud_ex
  3162. refresh_battle_hud if $game_temp.mbhud_force_refresh
  3163. return if @battle_hud_ex == nil
  3164. @battle_hud_ex.update
  3165. end
  3166.  
  3167. #--------------------------------------------------------------------------
  3168. # * Refresh Battle Hud
  3169. #--------------------------------------------------------------------------
  3170. def refresh_battle_hud
  3171. $game_temp.mbhud_force_refresh = false
  3172. check_screen_xyz_nil rescue nil
  3173. dispose_battle_hud_ex
  3174. create_battle_hud_ex
  3175. end
  3176.  
  3177. end
  3178.  
  3179. #==============================================================================
  3180. # ** Monogatari Bhud
  3181. #==============================================================================
  3182. class Monogatari_Bhud
  3183.  
  3184. include MOG_BATTLE_HUD_EX
  3185.  
  3186. #--------------------------------------------------------------------------
  3187. # * Initialize
  3188. #--------------------------------------------------------------------------
  3189. def initialize(viewport)
  3190. @battle_hud = [] ; @sprite_visitle_wait = 0
  3191. $game_party.battle_members.each_with_index do |actor, index|
  3192. @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
  3193. create_turn_sprite(nil)
  3194. create_screen_layout(nil)
  3195. end
  3196.  
  3197. #--------------------------------------------------------------------------
  3198. # * Max members
  3199. #--------------------------------------------------------------------------
  3200. def max_members
  3201. if $game_party.members.size > $game_party.max_battle_members
  3202. return $game_party.max_battle_members
  3203. end
  3204. return $game_party.members.size
  3205. end
  3206.  
  3207. #--------------------------------------------------------------------------
  3208. # * Dispose
  3209. #--------------------------------------------------------------------------
  3210. def dispose
  3211. @battle_hud.each {|sprite| sprite.dispose }
  3212. dispose_turn_sprite
  3213. dispose_screen_layout
  3214. end
  3215.  
  3216. #--------------------------------------------------------------------------
  3217. # * Update
  3218. #--------------------------------------------------------------------------
  3219. def update
  3220. @battle_hud.each {|sprite| sprite.update }
  3221. update_turn_sprite
  3222. update_screen_layout
  3223. refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
  3224. end
  3225.  
  3226. #--------------------------------------------------------------------------
  3227. # * Update
  3228. #--------------------------------------------------------------------------
  3229. def refresh_battle_hud_visible
  3230. $game_temp.battle_hud_visible_refresh[0] = false
  3231. @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
  3232. @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
  3233. @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
  3234. @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
  3235. end
  3236.  
  3237. end
  3238.  
  3239. #==============================================================================
  3240. # ** Monogatari Bhud
  3241. #==============================================================================
  3242. class Monogatari_Bhud
  3243.  
  3244. #--------------------------------------------------------------------------
  3245. # * Can Update Turn Sprite
  3246. #--------------------------------------------------------------------------
  3247. def can_refresh_turn_sprite?
  3248. return true if @turn_sprite.visible != $game_temp.command_visible
  3249. return true if $game_temp.refresh_turn_sprite
  3250. return false
  3251. end
  3252.  
  3253. #--------------------------------------------------------------------------
  3254. # * Create Turn Sprite
  3255. #--------------------------------------------------------------------------
  3256. def create_turn_sprite(viewport)
  3257. return if !TURN_SPRITE_VISIBLE
  3258. return if @turn_sprite != nil
  3259. @turn_sprite = Sprite.new
  3260. @turn_sprite.bitmap = Cache.battle_hud("Turn")
  3261. @turn_sprite.viewport = viewport
  3262. @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
  3263. @turn_sprite.visible = false
  3264. @turn_sprite_update_time = 5
  3265. @turn_sprite_blink = [0,0]
  3266. end
  3267.  
  3268. #--------------------------------------------------------------------------
  3269. # * Dispose Turn Sprite
  3270. #--------------------------------------------------------------------------
  3271. def dispose_turn_sprite
  3272. return if @turn_sprite == nil
  3273. @turn_sprite.dispose
  3274. @turn_sprite = nil
  3275. end
  3276.  
  3277. #--------------------------------------------------------------------------
  3278. # * Update Turn Sprite
  3279. #--------------------------------------------------------------------------
  3280. def update_turn_sprite
  3281. return if @turn_sprite == nil
  3282. if @turn_sprite_update_time > 0
  3283. @turn_sprite_update_time -= 1
  3284. return
  3285. end
  3286. update_turn_visible
  3287. update_turn_blink
  3288. end
  3289.  
  3290. #--------------------------------------------------------------------------
  3291. # * Update Turn Visible
  3292. #--------------------------------------------------------------------------
  3293. def update_turn_visible
  3294. $game_temp.refresh_turn_sprite = false
  3295. @turn_sprite.visible = can_turn_sprite_visible?
  3296. return if BattleManager.actor == nil
  3297. x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
  3298. y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
  3299. x = -1000 if x == nil ; y = -1000 if y == nil
  3300. @turn_sprite.x = x ; @turn_sprite.y = y
  3301. end
  3302.  
  3303. #--------------------------------------------------------------------------
  3304. # * Can Turn Sprite Visible?
  3305. #--------------------------------------------------------------------------
  3306. def can_turn_sprite_visible?
  3307. return false if BattleManager.actor == nil
  3308. return false if $game_temp.battle_end
  3309. return false if $game_message.visible
  3310. return true
  3311. end
  3312.  
  3313. #--------------------------------------------------------------------------
  3314. # * Update Turn Blink
  3315. #--------------------------------------------------------------------------
  3316. def update_turn_blink
  3317. return if !TURN_BLINK_EFFECT
  3318. return if !@turn_sprite.visible
  3319. @turn_sprite_blink[0] += 1
  3320. case @turn_sprite_blink[0]
  3321. when 0..30
  3322. @turn_sprite_blink[1] += 3
  3323. when 31..60
  3324. @turn_sprite_blink[1] -= 3
  3325. else
  3326. @turn_sprite_blink = [0,0]
  3327. end
  3328. @turn_sprite.opacity = 150 + @turn_sprite_blink[1]
  3329. end
  3330.  
  3331.  
  3332. end
  3333.  
  3334. #==============================================================================
  3335. # ** Monogatari Bhud
  3336. #==============================================================================
  3337. class Monogatari_Bhud
  3338.  
  3339. #--------------------------------------------------------------------------
  3340. # * Create Screen Layout
  3341. #--------------------------------------------------------------------------
  3342. def create_screen_layout(viewport)
  3343. return if !SCREEN_LAYOUT
  3344. @screen_layout = Sprite.new
  3345. @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
  3346. @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
  3347. @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
  3348. @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
  3349. @screen_layout.opacity = 0
  3350. @screen_layout.viewport = viewport
  3351. end
  3352.  
  3353. #--------------------------------------------------------------------------
  3354. # * Dispose Screen Layout
  3355. #--------------------------------------------------------------------------
  3356. def dispose_screen_layout
  3357. return if @screen_layout == nil
  3358. @screen_layout.dispose ; @screen_layout = nil
  3359. end
  3360.  
  3361. #--------------------------------------------------------------------------
  3362. # * Update Screen Layout
  3363. #--------------------------------------------------------------------------
  3364. def update_screen_layout
  3365. return if @screen_layout == nil
  3366. @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  3367. sprite_visible(@screen_layout)
  3368. end
  3369.  
  3370. #--------------------------------------------------------------------------
  3371. # * Sprite Visible
  3372. #--------------------------------------------------------------------------
  3373. def sprite_visible?
  3374. return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3375. return false if !$game_temp.battle_hud_visible
  3376. return false if !$game_temp.sprite_visible
  3377. return true
  3378. end
  3379.  
  3380. #--------------------------------------------------------------------------
  3381. # * Sprite Visible
  3382. #--------------------------------------------------------------------------
  3383. def sprite_visible(sprite)
  3384. if sprite_visible?
  3385. sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3386. else
  3387. sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3388. end
  3389. end
  3390.  
  3391. end
  3392.  
  3393. #==============================================================================
  3394. #==============================================================================
  3395. # ** Battle Hud EX
  3396. #==============================================================================
  3397. #==============================================================================
  3398. class Battle_Hud_EX
  3399. include MOG_BATTLE_HUD_EX
  3400.  
  3401. #--------------------------------------------------------------------------
  3402. # * Initialize
  3403. #--------------------------------------------------------------------------
  3404. def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  3405. pre_cache
  3406. setup(actor,index,max_members)
  3407. create_sprites(viewport)
  3408. end
  3409.  
  3410. #--------------------------------------------------------------------------
  3411. # * Setup
  3412. #--------------------------------------------------------------------------
  3413. def setup(actor,index,max_members)
  3414. $game_temp.battle_end = false
  3415. @actor = actor
  3416. @actor_index = index
  3417. @max_members = max_members
  3418. @actor.face_animation = [0,0,0]
  3419. @hp_icon_max = -1
  3420. @hp_icon_old = -1
  3421. @hp_icon_col_max = HP_ICON_COL_MAX
  3422. @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  3423. @hp_icon_row_max = HP_ICON_ROW_MAX
  3424. @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  3425. @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  3426. @mp_icon_max = -1
  3427. @mp_icon_old = -1
  3428. @mp_icon_col_max = MP_ICON_COL_MAX
  3429. @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  3430. @mp_icon_row_max = MP_ICON_ROW_MAX
  3431. @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  3432. @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  3433. @tp_icon_max = -1
  3434. @tp_icon_old = -1
  3435. @tp_icon_col_max = TP_ICON_COL_MAX
  3436. @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  3437. @tp_icon_row_max = TP_ICON_ROW_MAX
  3438. @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  3439. @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  3440. @sprite_visible = true
  3441. @sprite_visitle_wait = 0
  3442. setup_actor
  3443. setup_position
  3444. end
  3445.  
  3446. #--------------------------------------------------------------------------
  3447. # * Setup Actor
  3448. #--------------------------------------------------------------------------
  3449. def setup_actor
  3450. return if @actor == nil
  3451. @hp_number_refresh = true
  3452. @hp_number2_refresh = true
  3453. @hp_number_old = @actor.hp
  3454. @hp_number2_old = @actor.mhp
  3455. @hp_old_meter = 0
  3456. @mp_number_refresh = true
  3457. @mp_number2_refresh = true
  3458. @mp_number_old = @actor.mp
  3459. @mp_number2_old = @actor.mmp
  3460. @mp_old_meter = 0
  3461. @tp_number_refresh = true
  3462. @tp_number2_refresh = true
  3463. @tp_number_old = @actor.tp
  3464. @tp_number2_old = @actor.max_tp
  3465. @tp_old_meter = 0
  3466. @at_number_refresh = true
  3467. @at_number2_refresh = true
  3468. @at_number_old = actor_at
  3469. @at_number2_old = actor_max_at
  3470. @at_old_meter = 0
  3471. catb = ATB::MAX_AP rescue nil
  3472. @ccwinter_atb = true if catb != nil
  3473. end
  3474.  
  3475. #--------------------------------------------------------------------------
  3476. # * Terminate
  3477. #--------------------------------------------------------------------------
  3478. def terminate
  3479. @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
  3480. end
  3481.  
  3482. #--------------------------------------------------------------------------
  3483. # * AT
  3484. #--------------------------------------------------------------------------
  3485. def actor_at
  3486. return @actor.atb if $imported[:mog_atb_system]
  3487. return @actor.atb if $imported[:ve_active_time_battle]
  3488. return @actor.catb_value if $imported["YSA-CATB"]
  3489. return @actor.ap if @ccwinter_atb != nil
  3490. return 0
  3491. end
  3492.  
  3493. #--------------------------------------------------------------------------
  3494. # * Max AT
  3495. #--------------------------------------------------------------------------
  3496. def actor_max_at
  3497. return @actor.atb_max if $imported[:mog_atb_system]
  3498. return @actor.max_atb if $imported[:ve_active_time_battle]
  3499. return @actor.max_atb if $imported["YSA-CATB"]
  3500. return ATB::MAX_AP if @ccwinter_atb != nil
  3501. return 1
  3502. end
  3503.  
  3504. #--------------------------------------------------------------------------
  3505. # ● Actor Cast
  3506. #--------------------------------------------------------------------------
  3507. def actor_cast
  3508. return @actor.atb_cast[1] if $imported[:mog_atb_system]
  3509. return @actor.atb if $imported[:ve_active_time_battle]
  3510. return @actor.chant_count rescue 0 if @ccwinter_atb != nil
  3511. return 0
  3512. end
  3513.  
  3514. #--------------------------------------------------------------------------
  3515. # ● Actor Max Cast
  3516. #--------------------------------------------------------------------------
  3517. def actor_max_cast
  3518. if $imported[:mog_atb_system]
  3519. return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
  3520. return @actor.atb_cast[0].speed.abs
  3521. end
  3522. return @actor.max_atb if $imported[:ve_active_time_battle]
  3523. return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
  3524. return 1
  3525. end
  3526.  
  3527. #--------------------------------------------------------------------------
  3528. # ● Actor Cast?
  3529. #--------------------------------------------------------------------------
  3530. def actor_cast?
  3531. if $imported[:mog_atb_system]
  3532. return true if !@actor.atb_cast.empty?
  3533. end
  3534. if $imported[:ve_active_time_battle]
  3535. return true if @actor.cast_action?
  3536. end
  3537. if @ccwinter_atb
  3538. return true if @actor.chanting?
  3539. end
  3540. return false
  3541. end
  3542.  
  3543. #--------------------------------------------------------------------------
  3544. # * Create Sprites
  3545. #--------------------------------------------------------------------------
  3546. def create_sprites(viewport)
  3547. dispose
  3548. return if @actor == nil
  3549. create_layout(viewport)
  3550. create_layout_2(viewport)
  3551. create_name(viewport)
  3552. create_face(viewport)
  3553. create_hp_number(viewport)
  3554. create_hp_number_max(viewport)
  3555. create_hp_meter(viewport)
  3556. create_hp_icon(viewport)
  3557. create_hp_icon_ex(viewport)
  3558. create_hp_icon_number(viewport)
  3559. create_mp_number(viewport)
  3560. create_mp_number_max(viewport)
  3561. create_mp_meter(viewport)
  3562. create_mp_icon(viewport)
  3563. create_mp_icon_ex(viewport)
  3564. create_mp_icon_number(viewport)
  3565. create_tp_number(viewport)
  3566. create_tp_number_max(viewport)
  3567. create_tp_meter(viewport)
  3568. create_tp_icon(viewport)
  3569. create_tp_icon_ex(viewport)
  3570. create_tp_icon_number(viewport)
  3571. create_at_number(viewport)
  3572. create_at_number_max(viewport)
  3573. create_at_meter(viewport)
  3574. create_level_number(viewport)
  3575. create_states(viewport)
  3576. update
  3577. end
  3578.  
  3579. #--------------------------------------------------------------------------
  3580. # * Sprite Visible
  3581. #--------------------------------------------------------------------------
  3582. def sprite_visible?
  3583. return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3584. return false if !$game_temp.battle_hud_visible
  3585. return false if !$game_temp.sprite_visible
  3586. return true
  3587. end
  3588.  
  3589. #--------------------------------------------------------------------------
  3590. # * Sprite Visible
  3591. #--------------------------------------------------------------------------
  3592. def sprite_visible(sprite)
  3593. if @sprite_visible
  3594. sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3595. else
  3596. sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3597. end
  3598. end
  3599.  
  3600. end
  3601.  
  3602. #==============================================================================
  3603. #==============================================================================
  3604. # ** Battle Hud EX
  3605. #==============================================================================
  3606. #==============================================================================
  3607. class Battle_Hud_EX
  3608.  
  3609. #--------------------------------------------------------------------------
  3610. # * Setup Position
  3611. #--------------------------------------------------------------------------
  3612. def setup_position
  3613. sprite_width = (Graphics.width - 64) / 4
  3614. sprite_center = sprite_width / 2
  3615. if $game_party.battle_members.size > 4
  3616. members = $game_party.battle_members.size - 4
  3617. fx = 32 * members
  3618. else
  3619. fx = 0
  3620. end
  3621. space_x = MEMBERS_SPACE[0] - fx
  3622. space_y = MEMBERS_SPACE[1]
  3623. center = Graphics.width / 2
  3624. members_space = (Graphics.width + space_x) / @max_members
  3625. members_space2 = (members_space * @actor_index)
  3626. members_space3 = ((members_space / 2) * (@max_members - 1))
  3627. members_space_y = space_y * @actor_index
  3628. x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  3629. screen_resize_y = 0
  3630. screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  3631. y = HUD_POSITION[1] + members_space_y + screen_resize_y
  3632. @hud_position = [x,y]
  3633. $game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
  3634. $game_temp.hud_pos_real[@actor_index] = [x,y]
  3635. x2 = x + sprite_center
  3636. $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3637. $game_temp.hud_pos[@actor_index] = [x2,y]
  3638. if FIXED_HUD_POSITION[@actor_index] != nil
  3639. @hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
  3640. $game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
  3641. $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3642. $game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]
  3643. end
  3644. end
  3645.  
  3646. end
  3647.  
  3648. #==============================================================================
  3649. # ** Game Temp
  3650. #==============================================================================
  3651. class Game_Temp
  3652.  
  3653. attr_accessor :cache_bhud_sprites
  3654.  
  3655. #--------------------------------------------------------------------------
  3656. # * Cache Battle Hud
  3657. #--------------------------------------------------------------------------
  3658. def cache_battle_hud
  3659. execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  3660. end
  3661.  
  3662. #--------------------------------------------------------------------------
  3663. # * Execute Cache Bhud Sprites
  3664. #--------------------------------------------------------------------------
  3665. def execute_cache_bhud_sprites
  3666. @cache_bhud_sprites = []
  3667. windows = ["Layout_Command","Layout_Party","Layout_Help",
  3668. "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  3669. "Layout_Item"]
  3670. for s in windows
  3671. @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3672. end
  3673. sprites = ["Layout","Layout_2",
  3674. "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  3675. "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",
  3676. "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",
  3677. "LV_Number","Turn","Iconset","Layout_Screen"
  3678. ]
  3679. for s in sprites
  3680. @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3681. end
  3682. end
  3683.  
  3684. end
  3685.  
  3686. #==============================================================================
  3687. # ** Spriteset_Map
  3688. #==============================================================================
  3689. class Spriteset_Map
  3690.  
  3691. #--------------------------------------------------------------------------
  3692. # * Initialize
  3693. #--------------------------------------------------------------------------
  3694. alias mog_monogatari_bhud_initialize initialize
  3695. def initialize
  3696. $game_temp.cache_battle_hud
  3697. mog_monogatari_bhud_initialize
  3698. end
  3699.  
  3700. end
  3701.  
  3702. #==============================================================================
  3703. #==============================================================================
  3704. # ** Battle Hud EX
  3705. #==============================================================================
  3706. #==============================================================================
  3707. class Battle_Hud_EX
  3708.  
  3709. #--------------------------------------------------------------------------
  3710. # * Pre Cache
  3711. #--------------------------------------------------------------------------
  3712. def pre_cache
  3713. $game_temp.cache_battle_hud
  3714. @force_hide = false
  3715. @force_hide_time = 0
  3716. @fade_hud = false
  3717. @fade_hud_gold = false
  3718. @fade_hud_equip = false
  3719. @layout_image = Cache.battle_hud("Layout")
  3720. @layout_cw = @layout_image.width
  3721. @layout_ch = @layout_image.height
  3722. @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  3723. @layout2_cw = @layout2_image.width if @layout2_image != nil
  3724. @layout2_ch = @layout2_image.height if @layout2_image != nil
  3725. @layout2_cw = 0 if @layout2_cw == nil
  3726. #------------------------------------------------
  3727. # HP
  3728. #------------------------------------------------
  3729. if HP_NUMBER_VISIBLE
  3730. @hp_number_image = Cache.battle_hud("HP_Number")
  3731. @hp_number_cw = @hp_number_image.width / 10
  3732. if HP_NUMBER_LOW_COLOR
  3733. @hp_number_ch = @hp_number_image.height / 2
  3734. else
  3735. @hp_number_ch = @hp_number_image.height
  3736. end
  3737. @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  3738. @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number
  3739. end
  3740. if HP_NUMBER_MAX_VISIBLE
  3741. @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  3742. @hp_number2_cw = @hp_number2_image.width / 10
  3743. @hp_number2_ch = @hp_number2_image.height
  3744. end
  3745. if HP_METER_VISIBLE
  3746. @hp_meter_image = Cache.battle_hud("HP_Meter")
  3747. if HP_METER_GRADIENT_ANIMATION
  3748. @hp_meter_cw = @hp_meter_image.width / 3
  3749. else
  3750. @hp_meter_cw = @hp_meter_image.width
  3751. end
  3752. if HP_METER_REDUCTION_ANIMATION
  3753. @hp_meter_ch = @hp_meter_image.height / 2
  3754. else
  3755. @hp_meter_ch = @hp_meter_image.height
  3756. end
  3757. end
  3758. if HP_ICON_VISIBLE
  3759. @hp_icon_image = Cache.battle_hud("HP_Icon")
  3760. @hp_icon_cw = @hp_icon_image.width / 2
  3761. @hp_icon_ch = @hp_icon_image.height
  3762. end
  3763. if HP_ICON_EX_VISIBLE
  3764. @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  3765. @hp_icon2_cw = @hp_icon2_image.width
  3766. @hp_icon2_ch = @hp_icon2_image.height
  3767. end
  3768. if HP_ICON_NUMBER_VISIBLE
  3769. @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  3770. @hp_icon_number_cw = @hp_icon_number_image.width / 10
  3771. @hp_icon_number_ch = @hp_icon_number_image.height
  3772. end
  3773. #------------------------------------------------
  3774. # MP
  3775. #------------------------------------------------
  3776. if MP_NUMBER_VISIBLE
  3777. @mp_number_image = Cache.battle_hud("MP_Number")
  3778. @mp_number_cw = @mp_number_image.width / 10
  3779. if MP_NUMBER_LOW_COLOR
  3780. @mp_number_ch = @mp_number_image.height / 2
  3781. else
  3782. @mp_number_ch = @mp_number_image.height
  3783. end
  3784. @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  3785. @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  3786. end
  3787. if MP_NUMBER_MAX_VISIBLE
  3788. @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  3789. @mp_number2_cw = @mp_number2_image.width / 10
  3790. @mp_number2_ch = @mp_number2_image.height
  3791. end
  3792. if MP_METER_VISIBLE
  3793. @mp_meter_image = Cache.battle_hud("MP_Meter")
  3794. if MP_METER_GRADIENT_ANIMATION
  3795. @mp_meter_cw = @mp_meter_image.width / 3
  3796. else
  3797. @mp_meter_cw = @mp_meter_image.width
  3798. end
  3799. if MP_METER_REDUCTION_ANIMATION
  3800. @mp_meter_ch = @mp_meter_image.height / 2
  3801. else
  3802. @mp_meter_ch = @mp_meter_image.height
  3803. end
  3804. end
  3805. if MP_ICON_VISIBLE
  3806. @mp_icon_image = Cache.battle_hud("MP_Icon")
  3807. @mp_icon_cw = @mp_icon_image.width / 2
  3808. @mp_icon_ch = @mp_icon_image.height
  3809. end
  3810. if MP_ICON_EX_VISIBLE
  3811. @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  3812. @mp_icon2_cw = @mp_icon2_image.width
  3813. @mp_icon2_ch = @mp_icon2_image.height
  3814. end
  3815. if MP_ICON_NUMBER_VISIBLE
  3816. @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  3817. @mp_icon_number_cw = @mp_icon_number_image.width / 10
  3818. @mp_icon_number_ch = @mp_icon_number_image.height
  3819. end
  3820. #------------------------------------------------
  3821. # TP
  3822. #------------------------------------------------
  3823. if TP_NUMBER_VISIBLE
  3824. @tp_number_image = Cache.battle_hud("TP_Number")
  3825. @tp_number_cw = @tp_number_image.width / 10
  3826. if TP_NUMBER_LOW_COLOR
  3827. @tp_number_ch = @tp_number_image.height / 2
  3828. else
  3829. @tp_number_ch = @tp_number_image.height
  3830. end
  3831. @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  3832. @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number
  3833. end
  3834. if TP_NUMBER_MAX_VISIBLE
  3835. @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  3836. @tp_number2_cw = @tp_number2_image.width / 10
  3837. @tp_number2_ch = @tp_number2_image.height
  3838. end
  3839. if TP_METER_VISIBLE
  3840. @tp_meter_image = Cache.battle_hud("TP_Meter")
  3841. if TP_METER_GRADIENT_ANIMATION
  3842. @tp_meter_cw = @tp_meter_image.width / 3
  3843. else
  3844. @tp_meter_cw = @tp_meter_image.width
  3845. end
  3846. if TP_METER_REDUCTION_ANIMATION
  3847. @tp_meter_ch = @tp_meter_image.height / 2
  3848. else
  3849. @tp_meter_ch = @tp_meter_image.height
  3850. end
  3851. end
  3852. if TP_ICON_VISIBLE
  3853. @tp_icon_image = Cache.battle_hud("TP_Icon")
  3854. @tp_icon_cw = @tp_icon_image.width / 2
  3855. @tp_icon_ch = @tp_icon_image.height
  3856. end
  3857. if TP_ICON_EX_VISIBLE
  3858. @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  3859. @tp_icon2_cw = @tp_icon2_image.width
  3860. @tp_icon2_ch = @tp_icon2_image.height
  3861. end
  3862. if TP_ICON_NUMBER_VISIBLE
  3863. @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  3864. @tp_icon_number_cw = @tp_icon_number_image.width / 10
  3865. @tp_icon_number_ch = @tp_icon_number_image.height
  3866. end
  3867. #------------------------------------------------
  3868. # AT
  3869. #------------------------------------------------
  3870. if AT_NUMBER_VISIBLE
  3871. @at_number_image = Cache.battle_hud("AT_Number")
  3872. @at_number_cw = @at_number_image.width / 10
  3873. @at_number_ch = @at_number_image.height
  3874. @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  3875. @at_number_ch += (@at_number_ch / 2) if @at_wave_number
  3876. end
  3877. if AT_NUMBER_MAX_VISIBLE
  3878. @at_number2_image = Cache.battle_hud("Max_AT_Number")
  3879. @at_number2_cw = @at_number2_image.width / 10
  3880. @at_number2_ch = @at_number2_image.height
  3881. end
  3882. if AT_METER_VISIBLE
  3883. @at_meter_image = Cache.battle_hud("AT_Meter")
  3884. if AT_METER_GRADIENT_ANIMATION
  3885. @at_meter_cw = @at_meter_image.width / 3
  3886. else
  3887. @at_meter_cw = @at_meter_image.width
  3888. end
  3889. @at_meter_ch = @at_meter_image.height / 3
  3890. end
  3891. #------------------------------------------------
  3892. # LV
  3893. #------------------------------------------------
  3894. if LEVEL_NUMBER_VISIBLE
  3895. @lv_number_image = Cache.battle_hud("LV_Number")
  3896. @lv_number_cw = @lv_number_image.width / 10
  3897. @lv_number_ch = @lv_number_image.height
  3898. end
  3899. #------------------------------------------------
  3900. # ICON
  3901. #------------------------------------------------
  3902. if STATES_VISIBLE or EQUIPMENT_VISIBLE
  3903. @icon_image = Cache.system("Iconset")
  3904. end
  3905. end
  3906.  
  3907. #--------------------------------------------------------------------------
  3908. # * Check Icon Image
  3909. #--------------------------------------------------------------------------
  3910. def check_icon_image
  3911. if @icon_image == nil or @icon_image.disposed?
  3912. @icon_image = Cache.system("Iconset")
  3913. end
  3914. end
  3915.  
  3916. end
  3917.  
  3918. #==============================================================================
  3919. #==============================================================================
  3920. # ** Battle Hud EX
  3921. #==============================================================================
  3922. #==============================================================================
  3923. class Battle_Hud_EX
  3924.  
  3925. #--------------------------------------------------------------------------
  3926. # * Update Number
  3927. #--------------------------------------------------------------------------
  3928. def update_number(type,value)
  3929. actor_value = @actor.hp if type == 0
  3930. actor_value = @actor.mp if type == 1
  3931. actor_value = @actor.tp if type == 2
  3932. actor_value = @actor.mhp if type == 3
  3933. actor_value = @actor.mmp if type == 4
  3934. actor_value = @actor.max_tp if type == 5
  3935. actor_value = actor_at if type == 6
  3936. actor_value = actor_max_at if type == 7
  3937. if value < actor_value
  3938. value += number_refresh_speed(actor_value,value)
  3939. value = actor_value if value >= actor_value
  3940. refresh_sprite_number(type,value)
  3941. elsif value > actor_value
  3942. value -= number_refresh_speed(actor_value,value)
  3943. value = actor_value if value <= actor_value
  3944. refresh_sprite_number(type,value)
  3945. end
  3946. end
  3947.  
  3948. #--------------------------------------------------------------------------
  3949. # * Number Refresh Speed
  3950. #--------------------------------------------------------------------------
  3951. def number_refresh_speed(actor_value,value)
  3952. n = 1 * (actor_value - value).abs / 10
  3953. return [[n, 99999999].min,1].max
  3954. end
  3955.  
  3956. #--------------------------------------------------------------------------
  3957. # * Update Number Fix
  3958. #--------------------------------------------------------------------------
  3959. def update_number_fix(type)
  3960. if type == 0
  3961. @hp_number_old = @actor.hp
  3962. @hp_number_refresh = true
  3963. elsif type == 1
  3964. @mp_number_old = @actor.mp
  3965. @mp_number_refresh = true
  3966. elsif type == 2
  3967. @tp_number_old = @actor.tp
  3968. @tp_number_refresh = true
  3969. elsif type == 3
  3970. @hp_number2_old = @actor.mhp
  3971. @hp_number2_refresh = true
  3972. elsif type == 4
  3973. @mp_number2_old = @actor.mmp
  3974. @mp_number2_refresh = true
  3975. elsif type == 5
  3976. @tp_number2_old = @actor.max_tp
  3977. @tp_number2_refresh = true
  3978. elsif type == 6
  3979. @at_number_old = actor_at
  3980. @at_number_refresh = true
  3981. elsif type == 7
  3982. @at_number2_old = actor_max_at
  3983. @at_number2_refresh = true
  3984. end
  3985. end
  3986.  
  3987. #--------------------------------------------------------------------------
  3988. # * Refresh Sprite Number
  3989. #--------------------------------------------------------------------------
  3990. def refresh_sprite_number(type,value)
  3991. @hp_number_refresh = true if type == 0
  3992. @hp_number_old = value if type == 0
  3993. @mp_number_refresh = true if type == 1
  3994. @mp_number_old = value if type == 1
  3995. @tp_number_refresh = true if type == 2
  3996. @tp_number_old = value if type == 2
  3997. @hp_number2_refresh = true if type == 3
  3998. @hp_number2_old = value if type == 3
  3999. @mp_number2_refresh = true if type == 4
  4000. @mp_number2_old = value if type == 4
  4001. @tp_number2_refresh = true if type == 5
  4002. @tp_number2_old = value if type == 5
  4003. @at_number_refresh = true if type == 6
  4004. @at_number_old = value if type == 6
  4005. @at_number2_refresh = true if type == 7
  4006. @at_number2_old = value if type == 7
  4007. end
  4008.  
  4009. #--------------------------------------------------------------------------
  4010. # * Refresh Number
  4011. #--------------------------------------------------------------------------
  4012. def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  4013. sprite.bitmap.clear
  4014. clear_number_refresh(type)
  4015. number_color = low_number_color(type,number_ch)
  4016. if type == 0 and HP_NUMBER_PERCENTAGE
  4017. value_max = @actor.mhp
  4018. value = value.to_f / value_max.to_f * 100
  4019. value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  4020. elsif type == 1 and MP_NUMBER_PERCENTAGE
  4021. value_max = @actor.mmp
  4022. value = value.to_f / value_max.to_f * 100
  4023. elsif type == 2 and TP_NUMBER_PERCENTAGE
  4024. value_max = @actor.max_tp
  4025. value = value.to_f / value_max.to_f * 100
  4026. elsif type == 3 and HP_NUMBER_PERCENTAGE
  4027. value = 100
  4028. elsif type == 4 and MP_NUMBER_PERCENTAGE
  4029. value = 100
  4030. elsif type == 5 and TP_NUMBER_PERCENTAGE
  4031. value = 100
  4032. elsif type == 6 and AT_NUMBER_PERCENTAGE
  4033. value_max = actor_max_at
  4034. value = value.to_f / value_max.to_f * 100
  4035. elsif type == 7 and AT_NUMBER_PERCENTAGE
  4036. value = 100
  4037. end
  4038. value = 9999999 if value > 9999999
  4039. number_value = value.truncate.abs.to_s.split(//)
  4040. wave_h = 0
  4041. wave_h2 = wave_number ? (number_ch / 3) : 0
  4042. wave_h3 = number_color != 0 ? wave_h2 : 0
  4043. for r in 0..number_value.size - 1
  4044. number_value_abs = number_value[r].to_i
  4045. wh = wave_h2 * wave_h
  4046. wh2 = wave_h == 0 ? wave_h2 : 0
  4047. nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  4048. sprite.bitmap.blt(number_cw * r, wh, image, nsrc_rect)
  4049. wave_h = wave_h == 0 ? 1 : 0
  4050. end
  4051. refresh_number_position(type,number_value.size,number_cw)
  4052. end
  4053.  
  4054. #--------------------------------------------------------------------------
  4055. # * Refresh Number
  4056. #--------------------------------------------------------------------------
  4057. def refresh_number_position(type,number_value,number_cw)
  4058. cx = number_value * number_cw
  4059. if type == 0
  4060. case HP_NUMBER_ALIGN_TYPE
  4061. when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4062. when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  4063. when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  4064. end
  4065. elsif type == 1
  4066. case MP_NUMBER_ALIGN_TYPE
  4067. when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4068. when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  4069. when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  4070. end
  4071. elsif type == 2
  4072. case TP_NUMBER_ALIGN_TYPE
  4073. when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4074. when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  4075. when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  4076. end
  4077. elsif type == 3
  4078. case HP_NUMBER_ALIGN_TYPE
  4079. when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4080. when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4081. when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  4082. end
  4083. elsif type == 4
  4084. case MP_NUMBER_ALIGN_TYPE
  4085. when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4086. when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4087. when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  4088. end
  4089. elsif type == 5
  4090. case TP_NUMBER_ALIGN_TYPE
  4091. when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4092. when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4093. when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  4094. end
  4095. elsif type == 6
  4096. case MP_NUMBER_ALIGN_TYPE
  4097. when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4098. when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4099. when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4100. end
  4101. elsif type == 7
  4102. case AT_NUMBER_ALIGN_TYPE
  4103. when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4104. when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4105. when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4106. end
  4107. end
  4108. end
  4109.  
  4110. #--------------------------------------------------------------------------
  4111. # * Low Number Color
  4112. #--------------------------------------------------------------------------
  4113. def low_number_color(type,number_ch)
  4114. if type == 0
  4115. if HP_NUMBER_LOW_COLOR
  4116. return @actor.low_hp? ? number_ch : 0
  4117. else
  4118. return 0
  4119. end
  4120. elsif type == 1
  4121. if MP_NUMBER_LOW_COLOR
  4122. return @actor.low_mp? ? number_ch : 0
  4123. else
  4124. return 0
  4125. end
  4126. elsif type == 2
  4127. if TP_NUMBER_LOW_COLOR
  4128. return @actor.low_tp? ? number_ch : 0
  4129. else
  4130. return 0
  4131. end
  4132. else
  4133. return 0
  4134. end
  4135. end
  4136.  
  4137. #--------------------------------------------------------------------------
  4138. # * Clear Number Refresh
  4139. #--------------------------------------------------------------------------
  4140. def clear_number_refresh(type)
  4141. @hp_number_refresh = false if type == 0
  4142. @mp_number_refresh = false if type == 1
  4143. @tp_number_refresh = false if type == 2
  4144. @hp_number2_refresh = false if type == 3
  4145. @mp_number2_refresh = false if type == 4
  4146. @tp_number2_refresh = false if type == 5
  4147. @at_number_refresh = false if type == 6
  4148. @at_number2_refresh = false if type == 7
  4149. end
  4150.  
  4151. #--------------------------------------------------------------------------
  4152. # * Icon Limit
  4153. #--------------------------------------------------------------------------
  4154. def icon_limit(value,value_max)
  4155. n1 = value / value_max
  4156. n2 = value - (n1 * value_max)
  4157. n2 = value_max if (n2 == 0 and value > 0)
  4158. return n2
  4159. end
  4160.  
  4161. end
  4162.  
  4163. #==============================================================================
  4164. #==============================================================================
  4165. # ** Battle Hud EX
  4166. #==============================================================================
  4167. #==============================================================================
  4168. class Battle_Hud_EX
  4169.  
  4170. #--------------------------------------------------------------------------
  4171. # * Create Layout
  4172. #--------------------------------------------------------------------------
  4173. def create_layout(viewport)
  4174. @layout = Sprite.new
  4175. @layout.bitmap = @layout_image
  4176. @layout.z = HUD_Z
  4177. @layout.x = @hud_position[0]
  4178. @layout.y = @hud_position[1]
  4179. @layout.opacity = 0
  4180. @layout.viewport = viewport
  4181. end
  4182.  
  4183. #--------------------------------------------------------------------------
  4184. # * Update Layout
  4185. #--------------------------------------------------------------------------
  4186. def update_layout
  4187. return if @layout == nil
  4188. sprite_visible(@layout)
  4189. end
  4190.  
  4191. #--------------------------------------------------------------------------
  4192. # * Create Layout
  4193. #--------------------------------------------------------------------------
  4194. def create_layout_2(viewport)
  4195. return if !SECOND_LAYOUT
  4196. @layout2 = Sprite.new
  4197. @layout2.bitmap = @layout2_image
  4198. @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  4199. @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  4200. @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  4201. @layout2.opacity = 0
  4202. @layout2.viewport = viewport
  4203. end
  4204.  
  4205. #--------------------------------------------------------------------------
  4206. # * Update Layout
  4207. #--------------------------------------------------------------------------
  4208. def update_layout_2
  4209. return if @layout2 == nil
  4210. sprite_visible(@layout2)
  4211. end
  4212.  
  4213. end
  4214.  
  4215. #==============================================================================
  4216. #==============================================================================
  4217. # ** Battle Hud EX
  4218. #==============================================================================
  4219. #==============================================================================
  4220. class Battle_Hud_EX
  4221.  
  4222. #--------------------------------------------------------------------------
  4223. # * Create Name
  4224. #--------------------------------------------------------------------------
  4225. def create_name(viewport)
  4226. return if !NAME_VISIBLE
  4227. @name = Sprite.new
  4228. @name.bitmap = Bitmap.new(160,32)
  4229. @name.bitmap.font.size = NAME_FONT_SIZE
  4230. @name.bitmap.font.bold = NAME_FONT_BOLD
  4231. @name.bitmap.font.italic = NAME_FONT_ITALIC
  4232. @name.bitmap.font.color = NAME_FONT_COLOR
  4233. @name.z = HUD_Z + NAME_Z
  4234. @name.x = @hud_position[0] + NAME_POSITION[0]
  4235. @name.y = @hud_position[1] + NAME_POSITION[1]
  4236. @name.viewport = viewport
  4237. @name.opacity = 0
  4238. refresh_name
  4239. end
  4240.  
  4241. #--------------------------------------------------------------------------
  4242. # * Refresh Name
  4243. #--------------------------------------------------------------------------
  4244. def refresh_name
  4245. return if @name == nil
  4246. @name.bitmap.clear
  4247. if NAME_FONT_SHADOW
  4248. @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  4249. @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  4250. @name.bitmap.font.color = NAME_FONT_COLOR
  4251. end
  4252. @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  4253. end
  4254.  
  4255. #--------------------------------------------------------------------------
  4256. # * Update Name
  4257. #--------------------------------------------------------------------------
  4258. def update_name
  4259. return if @name == nil
  4260. sprite_visible(@name)
  4261. end
  4262.  
  4263. end
  4264.  
  4265. #==============================================================================
  4266. #==============================================================================
  4267. # ** Battle Hud EX
  4268. #==============================================================================
  4269. #==============================================================================
  4270. class Battle_Hud_EX
  4271.  
  4272. #--------------------------------------------------------------------------
  4273. # * Create HP Number
  4274. #--------------------------------------------------------------------------
  4275. def create_hp_number(viewport)
  4276. return if !HP_NUMBER_VISIBLE
  4277. @hp_number = Sprite.new
  4278. @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
  4279. @hp_number.z = HUD_Z + HP_NUMBER_Z
  4280. @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4281. @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  4282. @hp_number.viewport = viewport
  4283. @hp_number.opacity = 0
  4284. end
  4285.  
  4286. #--------------------------------------------------------------------------
  4287. # * Create HP Number Max
  4288. #--------------------------------------------------------------------------
  4289. def create_hp_number_max(viewport)
  4290. return if !HP_NUMBER_MAX_VISIBLE
  4291. @hp_number2 = Sprite.new
  4292. @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
  4293. @hp_number2.z = HUD_Z + HP_NUMBER_Z
  4294. @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4295. @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  4296. @hp_number2.viewport = viewport
  4297. @hp_number2.opacity = 0
  4298. end
  4299.  
  4300. #--------------------------------------------------------------------------
  4301. # * Create HP Meter
  4302. #--------------------------------------------------------------------------
  4303. def create_hp_meter(viewport)
  4304. return if !HP_METER_VISIBLE
  4305. @hp_flow_max = @hp_meter_cw * 2
  4306. @hp_flow = rand(@hp_flow_max)
  4307. @hp_meter = Sprite.new
  4308. @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  4309. @hp_meter.z = HUD_Z + HP_METER_Z
  4310. @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  4311. @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  4312. @hp_meter.angle = HP_METER_ANGLE
  4313. @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  4314. @hp_meter.viewport = viewport
  4315. @hp_meter.opacity = 0
  4316. end
  4317.  
  4318. #--------------------------------------------------------------------------
  4319. # ● Update Flow HP
  4320. #--------------------------------------------------------------------------
  4321. def update_flow_hp
  4322. @hp_meter.bitmap.clear
  4323. @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  4324. meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  4325. meter_width = 0 if meter_width == nil
  4326. execute_hp_damage_flow(meter_width)
  4327. meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  4328. @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)
  4329. @hp_flow += 1
  4330. @hp_flow = 0 if @hp_flow >= @hp_flow_max
  4331. end
  4332.  
  4333. #--------------------------------------------------------------------------
  4334. # ● Execute HP Damage Flow
  4335. #--------------------------------------------------------------------------
  4336. def execute_hp_damage_flow(meter_width)
  4337. return if !HP_METER_REDUCTION_ANIMATION
  4338. return if @hp_old_meter == meter_width
  4339. n = (@hp_old_meter - meter_width).abs * 3 / 100
  4340. damage_flow = [[n, 2].min,0.5].max
  4341. @hp_old_meter -= damage_flow
  4342. @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  4343. src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  4344. @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)
  4345. end
  4346.  
  4347. #--------------------------------------------------------------------------
  4348. # * Create HP Icon
  4349. #--------------------------------------------------------------------------
  4350. def create_hp_icon(viewport)
  4351. return if !HP_ICON_VISIBLE
  4352. @hp_icon = Sprite.new
  4353. icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  4354. icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  4355. @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4356. @hp_icon.z = HUD_Z + HP_ICON_Z
  4357. @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  4358. @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  4359. @hp_icon.viewport = viewport
  4360. @hp_icon.opacity = 0
  4361. end
  4362.  
  4363. #--------------------------------------------------------------------------
  4364. # * Refresh HP Icon
  4365. #--------------------------------------------------------------------------
  4366. def refresh_hp_icon
  4367. @hp_icon_old = @actor.hp
  4368. @hp_icon.bitmap.clear
  4369. max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  4370. if @actor.hp > max_value
  4371. icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  4372. else
  4373. icon_max = @actor.mhp
  4374. end
  4375. for i in 0...icon_max
  4376. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4377. rx = (i * (@hp_icon_cw + HP_ICON_SPACE[0]) ) - ((i / @hp_icon_col_max) * (@hp_icon_cw + HP_ICON_SPACE[0]) * @hp_icon_col_max)
  4378. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4379. i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  4380. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4381. end
  4382. icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  4383. rx = 0
  4384. ry = 0
  4385. for i in 0...icon_max
  4386. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4387. rx = (i * (@hp_icon_cw + HP_ICON_SPACE[0]) ) - ((i / @hp_icon_col_max) * (@hp_icon_cw + HP_ICON_SPACE[0]) * @hp_icon_col_max)
  4388. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4389. i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  4390. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4391. end
  4392. refresh_hp_icon_ex(rx,ry)
  4393. end
  4394.  
  4395. #--------------------------------------------------------------------------
  4396. # * Create HP Icon EX
  4397. #--------------------------------------------------------------------------
  4398. def create_hp_icon_ex(viewport)
  4399. return if !HP_ICON_EX_VISIBLE
  4400. @hp_icon3_anime_phase = 0
  4401. @hp_icon3 = Sprite.new
  4402. @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  4403. @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  4404. @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  4405. @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  4406. @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  4407. @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  4408. @hp_icon3.x = @hp_icon3_org[0]
  4409. @hp_icon3.y = @hp_icon3_org[1]
  4410. @hp_icon3.viewport = viewport
  4411. @hp_icon3.opacity = 0
  4412. end
  4413.  
  4414. #--------------------------------------------------------------------------
  4415. # * Refresh HP Icon EX
  4416. #--------------------------------------------------------------------------
  4417. def refresh_hp_icon_ex(rx,ry)
  4418. return if @hp_icon3 == nil
  4419. @hp_icon3.bitmap.clear
  4420. return if @actor.hp == 0
  4421. i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  4422. @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  4423. @hp_icon3.x = @hp_icon3_org[0] + rx
  4424. @hp_icon3.y = @hp_icon3_org[1] + ry
  4425. end
  4426.  
  4427. #--------------------------------------------------------------------------
  4428. # * Update Icon HP EX Anime
  4429. #--------------------------------------------------------------------------
  4430. def update_icon_hp_ex_anime
  4431. return if !HP_ICON_EX_ZOOM_EFFECT
  4432. if @hp_icon3_anime_phase == 0
  4433. @hp_icon3.zoom_x += 0.01
  4434. if @hp_icon3.zoom_x >= 1.30
  4435. @hp_icon3.zoom_x = 1.30
  4436. @hp_icon3_anime_phase = 1
  4437. end
  4438. else
  4439. @hp_icon3.zoom_x -= 0.01
  4440. if @hp_icon3.zoom_x <= 1.05
  4441. @hp_icon3.zoom_x = 1.05
  4442. @hp_icon3_anime_phase = 0
  4443. end
  4444. end
  4445. @hp_icon3.zoom_y = @hp_icon3.zoom_x
  4446. end
  4447.  
  4448. #--------------------------------------------------------------------------
  4449. # * Create HP Icon Nummber
  4450. #--------------------------------------------------------------------------
  4451. def create_hp_icon_number(viewport)
  4452. return if !HP_ICON_NUMBER_VISIBLE
  4453. @hp_icon_number_old = [-1,-1]
  4454. @hp_icon_number = Sprite.new
  4455. @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  4456. @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  4457. @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4458. @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  4459. @hp_icon_number.viewport = viewport
  4460. @hp_icon_number.opacity = 0
  4461. end
  4462.  
  4463. #--------------------------------------------------------------------------
  4464. # * Refresh Icon Number HP
  4465. #--------------------------------------------------------------------------
  4466. def refresh_icon_number_hp
  4467. @hp_icon_number_old[0] = @actor.hp
  4468. @hp_icon_number_old[1] = @actor.mhp
  4469. @hp_icon_number.bitmap.clear
  4470. value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  4471. value = 0 if value < 0
  4472. number_value = value.truncate.abs.to_s.split(//)
  4473. for r in 0..number_value.size - 1
  4474. number_value_abs = number_value[r].to_i
  4475. nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  4476. @hp_icon_number.bitmap.blt(@hp_icon_number_cw * r, 0, @hp_icon_number_image, nsrc_rect)
  4477. end
  4478. cx = (number_value.size * @hp_icon_number_cw)
  4479. case HP_ICON_NUMBER_ALIGN_TYPE
  4480. when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4481. when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4482. when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  4483. end
  4484. end
  4485.  
  4486. #--------------------------------------------------------------------------
  4487. # * Can Refresh Icon Number HP
  4488. #--------------------------------------------------------------------------
  4489. def can_refresh_icon_number_hp?
  4490. return true if @hp_icon_number_old[0] != @actor.hp
  4491. return true if @hp_icon_number_old[1] != @actor.mhp
  4492. return false
  4493. end
  4494.  
  4495. #--------------------------------------------------------------------------
  4496. # * Update HP
  4497. #--------------------------------------------------------------------------
  4498. def update_hp
  4499. if @hp_number != nil
  4500. if HP_NUMBER_ANIMATION
  4501. update_number(0,@hp_number_old)
  4502. else
  4503. update_number_fix(0) if @hp_number_old != @actor.hp
  4504. end
  4505. sprite_visible(@hp_number)
  4506. refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  4507. end
  4508. if @hp_number2 != nil
  4509. if HP_NUMBER_ANIMATION
  4510. update_number(3,@hp_number2_old)
  4511. else
  4512. update_number_fix(3) if @hp_number2_old != @actor.mhp
  4513. end
  4514. refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  4515. sprite_visible(@hp_number2)
  4516. end
  4517. if @hp_meter != nil
  4518. sprite_visible(@hp_meter)
  4519. update_flow_hp
  4520. end
  4521. if @hp_icon != nil
  4522. sprite_visible(@hp_icon)
  4523. refresh_hp_icon if @hp_icon_old != @actor.hp
  4524. end
  4525. if @hp_icon3 != nil
  4526. sprite_visible(@hp_icon3)
  4527. update_icon_hp_ex_anime
  4528. end
  4529. if @hp_icon_number != nil
  4530. sprite_visible(@hp_icon_number)
  4531. refresh_icon_number_hp if can_refresh_icon_number_hp?
  4532. end
  4533. end
  4534.  
  4535. end
  4536.  
  4537. #==============================================================================
  4538. #==============================================================================
  4539. # ** Battle Hud EX
  4540. #==============================================================================
  4541. #==============================================================================
  4542. class Battle_Hud_EX
  4543.  
  4544. #--------------------------------------------------------------------------
  4545. # * Create MP Number
  4546. #--------------------------------------------------------------------------
  4547. def create_mp_number(viewport)
  4548. return if !MP_NUMBER_VISIBLE
  4549. @mp_number = Sprite.new
  4550. @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
  4551. @mp_number.z = HUD_Z + MP_NUMBER_Z
  4552. @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4553. @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  4554. @mp_number.viewport = viewport
  4555. @mp_number.opacity = 0
  4556. end
  4557.  
  4558. #--------------------------------------------------------------------------
  4559. # * Create MP Number Max
  4560. #--------------------------------------------------------------------------
  4561. def create_mp_number_max(viewport)
  4562. return if !MP_NUMBER_MAX_VISIBLE
  4563. @mp_number2 = Sprite.new
  4564. @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
  4565. @mp_number2.z = HUD_Z + MP_NUMBER_Z
  4566. @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4567. @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  4568. @mp_number2.viewport = viewport
  4569. @mp_number2.opacity = 0
  4570. end
  4571.  
  4572. #--------------------------------------------------------------------------
  4573. # * Create MP Meter
  4574. #--------------------------------------------------------------------------
  4575. def create_mp_meter(viewport)
  4576. return if !MP_METER_VISIBLE
  4577. @mp_flow_max = @mp_meter_cw * 2
  4578. @mp_flow = rand(@mp_flow_max)
  4579. @mp_meter = Sprite.new
  4580. @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  4581. @mp_meter.z = HUD_Z + MP_METER_Z
  4582. @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  4583. @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  4584. @mp_meter.angle = MP_METER_ANGLE
  4585. @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  4586. @mp_meter.viewport = viewport
  4587. @mp_meter.opacity = 0
  4588. end
  4589.  
  4590. #--------------------------------------------------------------------------
  4591. # ● Update Flow MP
  4592. #--------------------------------------------------------------------------
  4593. def update_flow_mp
  4594. @mp_meter.bitmap.clear
  4595. @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  4596. meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  4597. meter_width = 0 if meter_width == nil
  4598. execute_mp_damage_flow(meter_width)
  4599. meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  4600. @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)
  4601. @mp_flow += 1
  4602. @mp_flow = 0 if @mp_flow >= @mp_flow_max
  4603. end
  4604.  
  4605. #--------------------------------------------------------------------------
  4606. # ● Execute MP Damage Flow
  4607. #--------------------------------------------------------------------------
  4608. def execute_mp_damage_flow(meter_width)
  4609. return if !MP_METER_REDUCTION_ANIMATION
  4610. return if @mp_old_meter == meter_width
  4611. n = (@mp_old_meter - meter_width).abs * 3 / 100
  4612. damage_flow = [[n, 2].min,0.5].max
  4613. @mp_old_meter -= damage_flow
  4614. @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  4615. src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  4616. @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)
  4617. end
  4618.  
  4619. #--------------------------------------------------------------------------
  4620. # * Create MP Icon
  4621. #--------------------------------------------------------------------------
  4622. def create_mp_icon(viewport)
  4623. return if !MP_ICON_VISIBLE
  4624. @mp_icon = Sprite.new
  4625. icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  4626. icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  4627. @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4628. @mp_icon.z = HUD_Z + MP_ICON_Z
  4629. @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  4630. @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  4631. @mp_icon.viewport = viewport
  4632. @mp_icon.opacity = 0
  4633. end
  4634.  
  4635. #--------------------------------------------------------------------------
  4636. # * Refresh MP Icon
  4637. #--------------------------------------------------------------------------
  4638. def refresh_mp_icon
  4639. @mp_icon_old = @actor.mp
  4640. @mp_icon.bitmap.clear
  4641. max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  4642. if @actor.mp > max_value
  4643. icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  4644. else
  4645. icon_max = @actor.mmp
  4646. end
  4647. for i in 0...icon_max
  4648. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4649. rx = (i * (@mp_icon_cw + MP_ICON_SPACE[0]) ) - ((i / @mp_icon_col_max) * (@mp_icon_cw + MP_ICON_SPACE[0]) * @mp_icon_col_max)
  4650. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4651. i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  4652. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4653. end
  4654. icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  4655. rx = 0
  4656. ry = 0
  4657. for i in 0...icon_max
  4658. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4659. rx = (i * (@mp_icon_cw + MP_ICON_SPACE[0]) ) - ((i / @mp_icon_col_max) * (@mp_icon_cw + MP_ICON_SPACE[0]) * @mp_icon_col_max)
  4660. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4661. i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  4662. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4663. end
  4664. refresh_mp_icon_ex(rx,ry)
  4665. end
  4666.  
  4667. #--------------------------------------------------------------------------
  4668. # * Create MP Icon EX
  4669. #--------------------------------------------------------------------------
  4670. def create_mp_icon_ex(viewport)
  4671. return if !MP_ICON_EX_VISIBLE
  4672. @mp_icon3_anime_phase = 0
  4673. @mp_icon3 = Sprite.new
  4674. @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  4675. @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  4676. @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  4677. @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  4678. @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  4679. @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  4680. @mp_icon3.x = @mp_icon3_org[0]
  4681. @mp_icon3.y = @mp_icon3_org[1]
  4682. @mp_icon3.viewport = viewport
  4683. @mp_icon3.opacity = 0
  4684. end
  4685.  
  4686. #--------------------------------------------------------------------------
  4687. # * Refresh MP Icon EX
  4688. #--------------------------------------------------------------------------
  4689. def refresh_mp_icon_ex(rx,ry)
  4690. return if @mp_icon3 == nil
  4691. @mp_icon3.bitmap.clear
  4692. return if @actor.mp == 0
  4693. i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  4694. @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  4695. @mp_icon3.x = @mp_icon3_org[0] + rx
  4696. @mp_icon3.y = @mp_icon3_org[1] + ry
  4697. end
  4698.  
  4699. #--------------------------------------------------------------------------
  4700. # * Update Icon MP EX Anime
  4701. #--------------------------------------------------------------------------
  4702. def update_icon_mp_ex_anime
  4703. return if !MP_ICON_EX_ZOOM_EFFECT
  4704. if @mp_icon3_anime_phase == 0
  4705. @mp_icon3.zoom_x += 0.01
  4706. if @mp_icon3.zoom_x >= 1.30
  4707. @mp_icon3.zoom_x = 1.30
  4708. @mp_icon3_anime_phase = 1
  4709. end
  4710. else
  4711. @mp_icon3.zoom_x -= 0.01
  4712. if @mp_icon3.zoom_x <= 1.05
  4713. @mp_icon3.zoom_x = 1.05
  4714. @mp_icon3_anime_phase = 0
  4715. end
  4716. end
  4717. @mp_icon3.zoom_y = @mp_icon3.zoom_x
  4718. end
  4719.  
  4720. #--------------------------------------------------------------------------
  4721. # * Create MP Icon Number
  4722. #--------------------------------------------------------------------------
  4723. def create_mp_icon_number(viewport)
  4724. return if !MP_ICON_NUMBER_VISIBLE
  4725. @mp_icon_number_old = [-1,-1]
  4726. @mp_icon_number = Sprite.new
  4727. @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  4728. @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  4729. @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4730. @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  4731. @mp_icon_number.viewport = viewport
  4732. @mp_icon_number.opacity = 0
  4733. end
  4734.  
  4735. #--------------------------------------------------------------------------
  4736. # * Refresh Icon Number MP
  4737. #--------------------------------------------------------------------------
  4738. def refresh_icon_number_mp
  4739. @mp_icon_number_old[0] = @actor.mp
  4740. @mp_icon_number_old[1] = @actor.mmp
  4741. @mp_icon_number.bitmap.clear
  4742. value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  4743. value = 0 if value < 0
  4744. number_value = value.truncate.abs.to_s.split(//)
  4745. for r in 0..number_value.size - 1
  4746. number_value_abs = number_value[r].to_i
  4747. nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  4748. @mp_icon_number.bitmap.blt(@mp_icon_number_cw * r, 0, @mp_icon_number_image, nsrc_rect)
  4749. end
  4750. cx = (number_value.size * @mp_icon_number_cw)
  4751. case MP_ICON_NUMBER_ALIGN_TYPE
  4752. when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4753. when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4754. when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  4755. end
  4756. end
  4757.  
  4758. #--------------------------------------------------------------------------
  4759. # * Can Refresh Icon Number MP
  4760. #--------------------------------------------------------------------------
  4761. def can_refresh_icon_number_mp?
  4762. return true if @mp_icon_number_old[0] != @actor.mp
  4763. return true if @mp_icon_number_old[1] != @actor.mmp
  4764. return false
  4765. end
  4766.  
  4767. #--------------------------------------------------------------------------
  4768. # * Update MP
  4769. #--------------------------------------------------------------------------
  4770. def update_mp
  4771. if @mp_number != nil
  4772. sprite_visible(@mp_number)
  4773. if MP_NUMBER_ANIMATION
  4774. update_number(1,@mp_number_old)
  4775. else
  4776. update_number_fix(1) if @mp_number_old != @actor.mp
  4777. end
  4778. refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  4779. end
  4780. if @mp_number2 != nil
  4781. sprite_visible(@mp_number2)
  4782. if MP_NUMBER_ANIMATION
  4783. update_number(4,@mp_number2_old)
  4784. else
  4785. update_number_fix(4) if @mp_number2_old != @actor.mmp
  4786. end
  4787. refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  4788. end
  4789. if @mp_meter != nil
  4790. sprite_visible(@mp_meter)
  4791. update_flow_mp
  4792. end
  4793. if @mp_icon != nil
  4794. sprite_visible(@mp_icon)
  4795. refresh_mp_icon if @mp_icon_old != @actor.mp
  4796. end
  4797. if @mp_icon3 != nil
  4798. sprite_visible(@mp_icon3)
  4799. update_icon_mp_ex_anime
  4800. end
  4801. if @mp_icon_number != nil
  4802. sprite_visible(@mp_icon_number)
  4803. refresh_icon_number_mp if can_refresh_icon_number_mp?
  4804. end
  4805. end
  4806.  
  4807. end
  4808.  
  4809. #==============================================================================
  4810. #==============================================================================
  4811. # ** Battle Hud EX
  4812. #==============================================================================
  4813. #==============================================================================
  4814. class Battle_Hud_EX
  4815.  
  4816. #--------------------------------------------------------------------------
  4817. # * Create TP Number
  4818. #--------------------------------------------------------------------------
  4819. def create_tp_number(viewport)
  4820. return if !TP_NUMBER_VISIBLE
  4821. @tp_number = Sprite.new
  4822. @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
  4823. @tp_number.z = HUD_Z + TP_NUMBER_Z
  4824. @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4825. @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  4826. @tp_number.viewport = viewport
  4827. @tp_number.opacity = 0
  4828. end
  4829.  
  4830. #--------------------------------------------------------------------------
  4831. # * Create TP Number MAX
  4832. #--------------------------------------------------------------------------
  4833. def create_tp_number_max(viewport)
  4834. return if !TP_NUMBER_MAX_VISIBLE
  4835. @tp_number2 = Sprite.new
  4836. @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
  4837. @tp_number2.z = HUD_Z + TP_NUMBER_Z
  4838. @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4839. @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  4840. @tp_number2.viewport = viewport
  4841. @tp_number2.opacity = 0
  4842. end
  4843.  
  4844. #--------------------------------------------------------------------------
  4845. # * Create TP Meter
  4846. #--------------------------------------------------------------------------
  4847. def create_tp_meter(viewport)
  4848. return if !TP_METER_VISIBLE
  4849. @tp_flow_max = @tp_meter_cw * 2
  4850. @tp_flow = rand(@tp_flow_max)
  4851. @tp_meter = Sprite.new
  4852. @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  4853. @tp_meter.z = HUD_Z + TP_METER_Z
  4854. @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  4855. @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  4856. @tp_meter.angle = TP_METER_ANGLE
  4857. @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  4858. @tp_meter.viewport = viewport
  4859. @tp_meter.opacity = 0
  4860. end
  4861.  
  4862. #--------------------------------------------------------------------------
  4863. # ● Update Flow TP
  4864. #--------------------------------------------------------------------------
  4865. def update_flow_tp
  4866. @tp_meter.bitmap.clear
  4867. @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  4868. meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil
  4869. meter_width = 0 if meter_width == nil
  4870. execute_tp_damage_flow(meter_width)
  4871. meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  4872. @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)
  4873. @tp_flow += 1
  4874. @tp_flow = 0 if @tp_flow >= @tp_flow_max
  4875. end
  4876.  
  4877. #--------------------------------------------------------------------------
  4878. # ● Execute TP Damage Flow
  4879. #--------------------------------------------------------------------------
  4880. def execute_tp_damage_flow(meter_width)
  4881. return if !TP_METER_REDUCTION_ANIMATION
  4882. return if @tp_old_meter == meter_width
  4883. n = (@tp_old_meter - meter_width).abs * 3 / 100
  4884. damage_flow = [[n, 2].min,0.5].max
  4885. @tp_old_meter -= damage_flow
  4886. @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  4887. src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  4888. @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)
  4889. end
  4890.  
  4891. #--------------------------------------------------------------------------
  4892. # * Create TP Icon
  4893. #--------------------------------------------------------------------------
  4894. def create_tp_icon(viewport)
  4895. return if !TP_ICON_VISIBLE
  4896. @tp_icon = Sprite.new
  4897. icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  4898. icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  4899. @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4900. @tp_icon.z = HUD_Z + TP_ICON_Z
  4901. @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  4902. @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  4903. @tp_icon.viewport = viewport
  4904. @tp_icon.opacity = 0
  4905. end
  4906.  
  4907. #--------------------------------------------------------------------------
  4908. # * Refresh TP Icon
  4909. #--------------------------------------------------------------------------
  4910. def refresh_tp_icon
  4911. @tp_icon_old = @actor.tp
  4912. @tp_icon.bitmap.clear
  4913. max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  4914. if @actor.mp > max_value
  4915. icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  4916. else
  4917. icon_max = @actor.max_tp
  4918. end
  4919. for i in 0...icon_max
  4920. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4921. rx = (i * (@tp_icon_cw + TP_ICON_SPACE[0]) ) - ((i / @tp_icon_col_max) * (@tp_icon_cw + TP_ICON_SPACE[0]) * @tp_icon_col_max)
  4922. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4923. i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  4924. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4925. end
  4926. icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  4927. rx = 0
  4928. ry = 0
  4929. for i in 0...icon_max
  4930. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4931. rx = (i * (@tp_icon_cw + TP_ICON_SPACE[0]) ) - ((i / @tp_icon_col_max) * (@tp_icon_cw + TP_ICON_SPACE[0]) * @tp_icon_col_max)
  4932. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4933. i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  4934. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4935. end
  4936. refresh_tp_icon_ex(rx,ry)
  4937. end
  4938.  
  4939. #--------------------------------------------------------------------------
  4940. # * Create TP Icon EX
  4941. #--------------------------------------------------------------------------
  4942. def create_tp_icon_ex(viewport)
  4943. return if !TP_ICON_EX_VISIBLE
  4944. @tp_icon3_anime_phase = 0
  4945. @tp_icon3 = Sprite.new
  4946. @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  4947. @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  4948. @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  4949. @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  4950. @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  4951. @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  4952. @tp_icon3.x = @tp_icon3_org[0]
  4953. @tp_icon3.y = @tp_icon3_org[1]
  4954. @tp_icon3.viewport = viewport
  4955. @tp_icon3.opacity = 0
  4956. end
  4957.  
  4958. #--------------------------------------------------------------------------
  4959. # * Refresh TP Icon EX
  4960. #--------------------------------------------------------------------------
  4961. def refresh_tp_icon_ex(rx,ry)
  4962. return if @tp_icon3 == nil
  4963. @tp_icon3.bitmap.clear
  4964. return if @actor.tp == 0
  4965. i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  4966. @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  4967. @tp_icon3.x = @tp_icon3_org[0] + rx
  4968. @tp_icon3.y = @tp_icon3_org[1] + ry
  4969. end
  4970.  
  4971. #--------------------------------------------------------------------------
  4972. # * Update Icon TP EX Anime
  4973. #--------------------------------------------------------------------------
  4974. def update_icon_tp_ex_anime
  4975. return if !MP_ICON_EX_ZOOM_EFFECT
  4976. if @tp_icon3_anime_phase == 0
  4977. @tp_icon3.zoom_x += 0.01
  4978. if @tp_icon3.zoom_x >= 1.30
  4979. @tp_icon3.zoom_x = 1.30
  4980. @tp_icon3_anime_phase = 1
  4981. end
  4982. else
  4983. @tp_icon3.zoom_x -= 0.01
  4984. if @tp_icon3.zoom_x <= 1.05
  4985. @tp_icon3.zoom_x = 1.05
  4986. @tp_icon3_anime_phase = 0
  4987. end
  4988. end
  4989. @tp_icon3.zoom_y = @tp_icon3.zoom_x
  4990. end
  4991.  
  4992. #--------------------------------------------------------------------------
  4993. # * Create HP Icon Number
  4994. #--------------------------------------------------------------------------
  4995. def create_tp_icon_number(viewport)
  4996. return if !TP_ICON_NUMBER_VISIBLE
  4997. @tp_icon_number_old = [-1,-1]
  4998. @tp_icon_number = Sprite.new
  4999. @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  5000. @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  5001. @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5002. @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  5003. @tp_icon_number.viewport = viewport
  5004. @tp_icon_number.opacity = 0
  5005. end
  5006.  
  5007. #--------------------------------------------------------------------------
  5008. # * Refresh Icon Number TP
  5009. #--------------------------------------------------------------------------
  5010. def refresh_icon_number_tp
  5011. @tp_icon_number_old[0] = @actor.tp
  5012. @tp_icon_number_old[1] = @actor.max_tp
  5013. @tp_icon_number.bitmap.clear
  5014. value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  5015. value = 0 if value < 0
  5016. number_value = value.truncate.abs.to_s.split(//)
  5017. for r in 0..number_value.size - 1
  5018. number_value_abs = number_value[r].to_i
  5019. nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  5020. @tp_icon_number.bitmap.blt(@tp_icon_number_cw * r, 0, @tp_icon_number_image, nsrc_rect)
  5021. end
  5022. cx = (number_value.size * @tp_icon_number_cw)
  5023. case TP_ICON_NUMBER_ALIGN_TYPE
  5024. when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5025. when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  5026. when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  5027. end
  5028. end
  5029.  
  5030. #--------------------------------------------------------------------------
  5031. # * Can Refresh Icon Number TP
  5032. #--------------------------------------------------------------------------
  5033. def can_refresh_icon_number_tp?
  5034. return true if @tp_icon_number_old[0] != @actor.tp
  5035. return true if @tp_icon_number_old[1] != @actor.max_tp
  5036. return false
  5037. end
  5038.  
  5039. #--------------------------------------------------------------------------
  5040. # * Update TP
  5041. #--------------------------------------------------------------------------
  5042. def update_tp
  5043. if @tp_number != nil
  5044. sprite_visible(@tp_number)
  5045. if MP_NUMBER_ANIMATION
  5046. update_number(2,@tp_number_old)
  5047. else
  5048. update_number_fix(2) if @tp_number_old != @actor.tp
  5049. end
  5050. refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh
  5051. end
  5052. if @tp_number2 != nil
  5053. sprite_visible(@tp_number2)
  5054. if MP_NUMBER_ANIMATION
  5055. update_number(5,@tp_number2_old)
  5056. else
  5057. update_number_fix(5) if @tp_number2_old != @actor.max_tp
  5058. end
  5059. refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  5060. end
  5061. if @tp_meter != nil
  5062. sprite_visible(@tp_meter)
  5063. update_flow_tp
  5064. end
  5065. if @tp_icon != nil
  5066. sprite_visible(@tp_icon)
  5067. refresh_tp_icon if @tp_icon_old != @actor.tp
  5068. end
  5069. if @tp_icon3 != nil
  5070. sprite_visible(@tp_icon3)
  5071. update_icon_tp_ex_anime
  5072. end
  5073. if @tp_icon_number != nil
  5074. sprite_visible(@tp_icon_number)
  5075. refresh_icon_number_tp if can_refresh_icon_number_tp?
  5076. end
  5077. end
  5078.  
  5079. end
  5080.  
  5081. #==============================================================================
  5082. #==============================================================================
  5083. # ** Battle Hud EX
  5084. #==============================================================================
  5085. #==============================================================================
  5086. class Battle_Hud_EX
  5087.  
  5088. #--------------------------------------------------------------------------
  5089. # * Create AT Number
  5090. #--------------------------------------------------------------------------
  5091. def create_at_number(viewport)
  5092. return if !AT_NUMBER_VISIBLE
  5093. @at_number = Sprite.new
  5094. @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  5095. @at_number.z = HUD_Z + AT_NUMBER_Z
  5096. @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  5097. @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  5098. @at_number.viewport = viewport
  5099. @at_number.opacity = 0
  5100. end
  5101.  
  5102. #--------------------------------------------------------------------------
  5103. # * Create AT Number Max
  5104. #--------------------------------------------------------------------------
  5105. def create_at_number_max(viewport)
  5106. return if !AT_NUMBER_MAX_VISIBLE
  5107. @at_number2 = Sprite.new
  5108. @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  5109. @at_number2.z = HUD_Z + AT_NUMBER_Z
  5110. @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  5111. @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  5112. @at_number2.viewport = viewport
  5113. @at_number2.opacity = 0
  5114. end
  5115.  
  5116. #--------------------------------------------------------------------------
  5117. # * Create AT Meter
  5118. #--------------------------------------------------------------------------
  5119. def create_at_meter(viewport)
  5120. return if !AT_METER_VISIBLE
  5121. @at_flow_max = @at_meter_cw * 2
  5122. @at_flow = rand(@at_flow_max)
  5123. @at_meter = Sprite.new
  5124. @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  5125. @at_meter.z = HUD_Z + AT_METER_Z
  5126. @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  5127. @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  5128. @at_meter.angle = AT_METER_ANGLE
  5129. @at_meter.mirror = AT_METER_MIRROR_EFFECT
  5130. @at_meter.viewport = viewport
  5131. @at_meter.opacity = 0
  5132. end
  5133.  
  5134. #--------------------------------------------------------------------------
  5135. # ● Update Flow AT
  5136. #--------------------------------------------------------------------------
  5137. def update_flow_at
  5138. @at_meter.bitmap.clear
  5139. @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  5140. if actor_cast?
  5141. meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  5142. meter_width = 0 if meter_width == nil
  5143. ch = @at_meter_ch * 2
  5144. else
  5145. meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  5146. meter_width = 0 if meter_width == nil
  5147. ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  5148. end
  5149. meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  5150. @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)
  5151. @at_flow += 1
  5152. @at_flow = 0 if @at_flow >= @at_flow_max
  5153. end
  5154.  
  5155. #--------------------------------------------------------------------------
  5156. # * Update AT
  5157. #--------------------------------------------------------------------------
  5158. def update_at
  5159. if @at_number != nil
  5160. sprite_visible(@at_number)
  5161. if AT_NUMBER_ANIMATION
  5162. update_number(6,@at_number_old)
  5163. else
  5164. update_number_fix(6) if @at_number_old != actor_at
  5165. end
  5166. refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  5167. end
  5168. if @at_number2 != nil
  5169. sprite_visible(@at_number2)
  5170. if AT_NUMBER_ANIMATION
  5171. update_number(7,@at_number2_old)
  5172. else
  5173. update_number_fix(7) if @at_number2_old != actor_max_at
  5174. end
  5175. refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  5176. end
  5177. if @at_meter != nil
  5178. sprite_visible(@at_meter)
  5179. update_flow_at
  5180. end
  5181. end
  5182.  
  5183. end
  5184.  
  5185. #==============================================================================
  5186. #==============================================================================
  5187. # ** Battle Hud EX
  5188. #==============================================================================
  5189. #==============================================================================
  5190. class Battle_Hud_EX
  5191.  
  5192. #--------------------------------------------------------------------------
  5193. # * Create Level Number
  5194. #--------------------------------------------------------------------------
  5195. def create_level_number(viewport)
  5196. return if !LEVEL_NUMBER_VISIBLE
  5197. @old_level = -1
  5198. @lv_number = Sprite.new
  5199. @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  5200. @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  5201. @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5202. @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  5203. @lv_number.viewport = viewport
  5204. @lv_number.opacity = 0
  5205. end
  5206.  
  5207. #--------------------------------------------------------------------------
  5208. # * Refresh Level Number
  5209. #--------------------------------------------------------------------------
  5210. def refresh_level_number
  5211. @lv_number.bitmap.clear
  5212. @old_level = @actor.level
  5213. number_value = @actor.level.abs.to_s.split(//)
  5214. for r in 0..number_value.size - 1
  5215. number_value_abs = number_value[r].to_i
  5216. nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  5217. @lv_number.bitmap.blt(@lv_number_cw * r, 0, @lv_number_image, nsrc_rect)
  5218. end
  5219. cx = (number_value.size * @lv_number_cw)
  5220. case LEVEL_NUMBER_ALIGN_TYPE
  5221. when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5222. when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  5223. when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  5224. end
  5225. end
  5226.  
  5227. #--------------------------------------------------------------------------
  5228. # * Update Level
  5229. #--------------------------------------------------------------------------
  5230. def update_level
  5231. return if @lv_number == nil
  5232. sprite_visible(@lv_number)
  5233. refresh_level_number if @old_level != @actor.level
  5234. end
  5235.  
  5236. end
  5237.  
  5238. #==============================================================================
  5239. #==============================================================================
  5240. # ** Battle Hud EX
  5241. #==============================================================================
  5242. #==============================================================================
  5243. class Battle_Hud_EX
  5244.  
  5245. #--------------------------------------------------------------------------
  5246. # * Create States
  5247. #--------------------------------------------------------------------------
  5248. def create_states(viewport)
  5249. return if !STATES_VISIBLE
  5250. @status_old = nil
  5251. @status_flow = [-24,0]
  5252. @status_size_real = 0
  5253. @status = Sprite.new
  5254. @status.bitmap = Bitmap.new(24,24)
  5255. @status.x = @hud_position[0] + STATES_POSITION[0]
  5256. @status.y = @hud_position[1] + STATES_POSITION[1]
  5257. @status.z = HUD_Z + STATES_Z
  5258. @status.angle = STATE_ANGLE
  5259. @status.viewport = viewport
  5260. @status.opacity = 0
  5261. end
  5262.  
  5263. #--------------------------------------------------------------------------
  5264. # * Refresh States
  5265. #--------------------------------------------------------------------------
  5266. def refresh_states
  5267. check_icon_image
  5268. @status_size_real = set_real_states_size
  5269. @status_old = @actor.states
  5270. @status_flow = [0,0]
  5271. @states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
  5272. @actor_status.dispose if @actor_status != nil
  5273. @actor_status = Bitmap.new(@states_size,24)
  5274. index = 0
  5275. for i in @actor.states
  5276. next if HIDE_STATES_ID.include?(i.id)
  5277. rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  5278. @actor_status.blt(26 * index , 0, @icon_image, rect)
  5279. index += 1
  5280. end
  5281. end
  5282.  
  5283. #--------------------------------------------------------------------------
  5284. # * Set Real States Size
  5285. #--------------------------------------------------------------------------
  5286. def set_real_states_size
  5287. n = 0
  5288. for i in @actor.states
  5289. next if HIDE_STATES_ID.include?(i.id)
  5290. n += 1
  5291. end
  5292. return n
  5293. end
  5294.  
  5295. #--------------------------------------------------------------------------
  5296. # * Flow_Status
  5297. #--------------------------------------------------------------------------
  5298. def flow_states
  5299. return if @actor_status == nil
  5300. @status.bitmap.clear
  5301. return if @actor.states.size == 0
  5302. st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  5303. @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  5304. if STATES_SCROLLING_ANIMATION
  5305. @status_flow[0] += 1
  5306. @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  5307. else
  5308. @status_flow[1] += 1 unless @actor.states.size <= 1
  5309. if @status_flow[1] > 30
  5310. @status_flow[1] = 0
  5311. @status_flow[0] += 26
  5312. @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  5313. end
  5314. end
  5315. end
  5316.  
  5317. #--------------------------------------------------------------------------
  5318. # * Update States
  5319. #--------------------------------------------------------------------------
  5320. def update_states
  5321. return if @status == nil
  5322. sprite_visible(@status)
  5323. refresh_states if @status_old != @actor.states
  5324. flow_states
  5325. end
  5326.  
  5327. end
  5328.  
  5329. #==============================================================================
  5330. #==============================================================================
  5331. # ** Battle Hud EX
  5332. #==============================================================================
  5333. #==============================================================================
  5334. class Battle_Hud_EX
  5335.  
  5336. #--------------------------------------------------------------------------
  5337. # * Create Face
  5338. #--------------------------------------------------------------------------
  5339. def create_face(viewport)
  5340. return if !FACE_VISIBLE
  5341. @face_old_hp = @actor.hp
  5342. @face_old_mp = @actor.mp
  5343. @face_old_tp = @actor.tp
  5344. @face_name = ""
  5345. @face = Sprite.new
  5346. @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  5347. @face.x = @face_org[0]
  5348. @face.y = @face_org[1]
  5349. @face.z = HUD_Z + FACE_Z
  5350. @face.viewport = viewport
  5351. @face.opacity = 0
  5352. refresh_face_name
  5353. end
  5354.  
  5355. #--------------------------------------------------------------------------
  5356. # * Refresh Face Name
  5357. #--------------------------------------------------------------------------
  5358. def refresh_face_name
  5359. @face_image.dispose if @face_image != nil
  5360. @face.bitmap.dispose if @face.bitmap != nil
  5361. return if @actor == nil or @actor.id == nil
  5362. @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5363. @face_image = Bitmap.new(32,32) if @face_image == nil
  5364. @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  5365. @face_ch = @face_image.height
  5366. @face.ox = @face_cw / 2
  5367. @face.oy = @face_ch / 2
  5368. @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  5369. @face_org = [@hud_position[0] + FACE_POSITION[0],
  5370. @hud_position[1] + @face.oy + FACE_POSITION[1]]
  5371. if $game_temp.battler_face_pos[@actor_index] == nil
  5372. $game_temp.battler_face_pos[@actor_index] = []
  5373. end
  5374. @face.x = @face_org[0]
  5375. @face.y = @face_org[1]
  5376. limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  5377. fy = @face_org[1]
  5378. if limit_Y > Graphics.height
  5379. @face.y = Graphics.height - (@face_image.height - @face.oy)
  5380. fy = Graphics.height - 16
  5381. @face_org[1] = @face.y
  5382. end
  5383. $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  5384. $game_temp.battler_face_pos[@actor_index][1] = fy
  5385. $game_temp.battler_face_pos[@actor_index][2] = @face.z
  5386. clear_face_index
  5387. end
  5388.  
  5389. #--------------------------------------------------------------------------
  5390. # * Refresh Face
  5391. #--------------------------------------------------------------------------
  5392. def refresh_face
  5393. @face.mirror = false
  5394. @face.zoom_x = 1.00
  5395. @face.zoom_y = 1.00
  5396. @face_index = @actor.face_animation[1]
  5397. @face.bitmap.clear
  5398. if !FACE_ANIMATION
  5399. f_scr = Rect.new(0,0,@face_cw,@face_ch)
  5400. else
  5401. f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  5402. end
  5403. @face.bitmap.blt(0,0,@face_image,f_scr)
  5404. end
  5405.  
  5406. #--------------------------------------------------------------------------
  5407. # * Update Face Duration
  5408. #--------------------------------------------------------------------------
  5409. def update_face_duration
  5410. return if @actor.face_animation[0] == 0
  5411. @actor.face_animation[0] -= 1
  5412. update_face_shake_effect
  5413. update_face_zoom if @actor.face_animation[1] == 2
  5414. return if @actor.face_animation[0] > 0
  5415. clear_face_index
  5416. end
  5417.  
  5418. #--------------------------------------------------------------------------
  5419. # * Clear Face Index
  5420. #--------------------------------------------------------------------------
  5421. def clear_face_index
  5422. @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  5423. @actor.face_animation[1] = 4 if @actor.dead?
  5424. refresh_face
  5425. end
  5426.  
  5427. #--------------------------------------------------------------------------
  5428. # * Update Face Zoom
  5429. #--------------------------------------------------------------------------
  5430. def update_face_zoom
  5431. return if !FACE_ZOOM_ANIMATION
  5432. case @actor.face_animation[0]
  5433. when 30..60
  5434. @face.zoom_x += 0.01
  5435. @face.zoom_x = 1.30 if @face.zoom_x > 1.30
  5436. @face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
  5437. when 1..29
  5438. @face.zoom_x -= 0.01
  5439. @face.zoom_x = 1.00 if @face.zoom_x < 1.00
  5440. @face.mirror = false
  5441. else
  5442. @face.zoom_x = 1.00
  5443. @face.mirror = false
  5444. end
  5445. @face.zoom_y = @face.zoom_x
  5446. end
  5447.  
  5448. #--------------------------------------------------------------------------
  5449. # * Can Refresh Index MP TP?
  5450. #--------------------------------------------------------------------------
  5451. def can_refresh_index_mp_tp?
  5452. return true if @face_old_mp != @actor.mp
  5453. return false
  5454. end
  5455.  
  5456. #--------------------------------------------------------------------------
  5457. # * Refresh Face Index HP
  5458. #--------------------------------------------------------------------------
  5459. def refresh_face_index_hp
  5460. @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5461. @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  5462. @face_old_hp = @actor.hp
  5463. end
  5464.  
  5465. #--------------------------------------------------------------------------
  5466. # * Refresh Face Index MP TP
  5467. #--------------------------------------------------------------------------
  5468. def refresh_face_index_mp_tp
  5469. if @face_old_mp < @actor.mp
  5470. @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5471. @actor.face_animation[1] = 1
  5472. end
  5473. @face_old_mp = @actor.mp
  5474. @face_old_tp = @actor.tp
  5475. end
  5476.  
  5477. #--------------------------------------------------------------------------
  5478. # * Update Face Shake Effect
  5479. #--------------------------------------------------------------------------
  5480. def update_face_shake_effect
  5481. return if !FACE_SHAKE_EFFECT
  5482. if FACE_ANIMATION
  5483. update_shake_animated_face
  5484. else
  5485. update_shake_still_face
  5486. end
  5487. end
  5488.  
  5489. #--------------------------------------------------------------------------
  5490. # * Update Shake Still Effect Face
  5491. #--------------------------------------------------------------------------
  5492. def update_shake_still_face
  5493. if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  5494. @face.x = @face_org[0] - 4 + rand(8)
  5495. else
  5496. @face.x = @face_org[0]
  5497. end
  5498. end
  5499.  
  5500. #--------------------------------------------------------------------------
  5501. # * Update Shake Animated Face
  5502. #--------------------------------------------------------------------------
  5503. def update_shake_animated_face
  5504. if @actor.face_animation[0] == 0
  5505. @face.x = @face_org[0]
  5506. return
  5507. end
  5508. if @actor.face_animation[1] == 3 and @actor.hp > 0
  5509. @face.x = @face_org[0] - 4 + rand(8)
  5510. else
  5511. @face.x = @face_org[0]
  5512. end
  5513. end
  5514.  
  5515. #--------------------------------------------------------------------------
  5516. # * Update Face
  5517. #--------------------------------------------------------------------------
  5518. def update_face
  5519. return if @face == nil
  5520. sprite_visible(@face)
  5521. refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  5522. update_face_duration
  5523. return if !FACE_ANIMATION
  5524. refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  5525. refresh_face_index_hp if @face_old_hp != @actor.hp
  5526. refresh_face if @face_index != @actor.face_animation[1]
  5527. end
  5528.  
  5529. end
  5530.  
  5531. #==============================================================================
  5532. # ■ Battle Manager
  5533. #==============================================================================
  5534. class << BattleManager
  5535.  
  5536. #--------------------------------------------------------------------------
  5537. # ● Battle End
  5538. #--------------------------------------------------------------------------
  5539. alias mog_battle_hud_battle_process_victory process_victory
  5540. def process_victory
  5541. execute_face_effect_end
  5542. mog_battle_hud_battle_process_victory
  5543. end
  5544.  
  5545. #--------------------------------------------------------------------------
  5546. # ● Execute Face Effect End
  5547. #--------------------------------------------------------------------------
  5548. def execute_face_effect_end
  5549. $game_temp.battle_end = true
  5550. for i in $game_party.members
  5551. i.face_animation = [120,1,0] if i.hp > 0
  5552. end
  5553. end
  5554.  
  5555. #--------------------------------------------------------------------------
  5556. # * Display EXP Earned
  5557. #--------------------------------------------------------------------------
  5558. alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
  5559. def process_defeat
  5560. $game_temp.battle_end = true
  5561. mog_battle_hud_ex_message_battle_process_defeat
  5562. end
  5563.  
  5564. #--------------------------------------------------------------------------
  5565. # * Process Abort
  5566. #--------------------------------------------------------------------------
  5567. alias mog_battle_hud_ex_process_abort process_abort
  5568. def process_abort
  5569. $game_temp.battle_end = true
  5570. mog_battle_hud_ex_process_abort
  5571. end
  5572.  
  5573. end
  5574.  
  5575. #==============================================================================
  5576. # ** Scene Battle
  5577. #==============================================================================
  5578. class Scene_Battle < Scene_Base
  5579.  
  5580. #--------------------------------------------------------------------------
  5581. # * Use Item
  5582. #--------------------------------------------------------------------------
  5583. alias mog_monogatari_use_item use_item
  5584. def use_item
  5585. execute_face_animation
  5586. mog_monogatari_use_item
  5587. end
  5588.  
  5589. #--------------------------------------------------------------------------
  5590. # * Execute Face Animation
  5591. #--------------------------------------------------------------------------
  5592. def execute_face_animation
  5593. return if @subject.is_a?(Game_Enemy)
  5594. @subject.face_animation = [60 ,2,0]
  5595. end
  5596.  
  5597. end
  5598.  
  5599. #==============================================================================
  5600. #==============================================================================
  5601. # ** Battle Hud EX
  5602. #==============================================================================
  5603. #==============================================================================
  5604. class Battle_Hud_EX
  5605.  
  5606. #--------------------------------------------------------------------------
  5607. # * Dispose
  5608. #--------------------------------------------------------------------------
  5609. def dispose
  5610. terminate
  5611. dispose_layout
  5612. dispose_layout_2
  5613. dispose_name
  5614. dispose_face
  5615. dispose_hp_number
  5616. dispose_hp_number_max
  5617. dispose_hp_meter
  5618. dispose_hp_icon
  5619. dispose_hp_icon_ex
  5620. dispose_hp_icon_number
  5621. dispose_mp_number
  5622. dispose_mp_number_max
  5623. dispose_mp_meter
  5624. dispose_mp_icon
  5625. dispose_mp_icon_ex
  5626. dispose_mp_icon_number
  5627. dispose_tp_number
  5628. dispose_tp_number_max
  5629. dispose_tp_meter
  5630. dispose_tp_icon
  5631. dispose_tp_icon_ex
  5632. dispose_tp_icon_number
  5633. dispose_at_number
  5634. dispose_at_number_max
  5635. dispose_at_meter
  5636. dispose_lv_number
  5637. dispose_states
  5638. end
  5639.  
  5640. #--------------------------------------------------------------------------
  5641. # * Dispose Layout
  5642. #--------------------------------------------------------------------------
  5643. def dispose_layout
  5644. return if @layout == nil
  5645. @layout.dispose
  5646. @layout = nil
  5647. end
  5648.  
  5649. #--------------------------------------------------------------------------
  5650. # * Dispose Layout 2
  5651. #--------------------------------------------------------------------------
  5652. def dispose_layout_2
  5653. return if @layout2 == nil
  5654. @layout2.dispose
  5655. @layout2 = nil
  5656. end
  5657.  
  5658. #--------------------------------------------------------------------------
  5659. # * Dispose Name
  5660. #--------------------------------------------------------------------------
  5661. def dispose_name
  5662. return if @name == nil
  5663. @name.bitmap.dispose
  5664. @name.dispose
  5665. @name = nil
  5666. end
  5667.  
  5668. #--------------------------------------------------------------------------
  5669. # * Dispose Face
  5670. #--------------------------------------------------------------------------
  5671. def dispose_face
  5672. return if @face == nil
  5673. @face.bitmap.dispose if @face.bitmap != nil
  5674. @face.dispose
  5675. @face = nil
  5676. @face_image.dispose if @face_image != nil
  5677. end
  5678.  
  5679. #--------------------------------------------------------------------------
  5680. # * Dispose HP Number
  5681. #--------------------------------------------------------------------------
  5682. def dispose_hp_number
  5683. return if @hp_number == nil
  5684. @hp_number.bitmap.dispose
  5685. @hp_number.dispose
  5686. @hp_number = nil
  5687. end
  5688.  
  5689. #--------------------------------------------------------------------------
  5690. # * Dispose HP Number Max
  5691. #--------------------------------------------------------------------------
  5692. def dispose_hp_number_max
  5693. return if @hp_number2 == nil
  5694. @hp_number2.bitmap.dispose
  5695. @hp_number2.dispose
  5696. @hp_number2 = nil
  5697. end
  5698.  
  5699. #--------------------------------------------------------------------------
  5700. # * Dispose HP Meter
  5701. #--------------------------------------------------------------------------
  5702. def dispose_hp_meter
  5703. return if @hp_meter == nil
  5704. @hp_meter.bitmap.dispose
  5705. @hp_meter.dispose
  5706. @hp_meter = nil
  5707. end
  5708.  
  5709. #--------------------------------------------------------------------------
  5710. # * Dispose HP Icon
  5711. #--------------------------------------------------------------------------
  5712. def dispose_hp_icon
  5713. return if @hp_icon == nil
  5714. @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  5715. @hp_icon.dispose
  5716. @hp_icon = nil
  5717. end
  5718.  
  5719. #--------------------------------------------------------------------------
  5720. # * Dispose HP Icon EX
  5721. #--------------------------------------------------------------------------
  5722. def dispose_hp_icon_ex
  5723. return if @hp_icon3 == nil
  5724. @hp_icon3.bitmap.dispose
  5725. @hp_icon3.dispose
  5726. @hp_icon3 = nil
  5727. end
  5728.  
  5729. #--------------------------------------------------------------------------
  5730. # * Dispose HP Icon Number
  5731. #--------------------------------------------------------------------------
  5732. def dispose_hp_icon_number
  5733. return if @hp_icon_number == nil
  5734. @hp_icon_number.bitmap.dispose
  5735. @hp_icon_number.dispose
  5736. @hp_icon_number = nil
  5737. end
  5738.  
  5739. #--------------------------------------------------------------------------
  5740. # * Dispose MP Number
  5741. #--------------------------------------------------------------------------
  5742. def dispose_mp_number
  5743. return if @mp_number == nil
  5744. @mp_number.bitmap.dispose
  5745. @mp_number.dispose
  5746. @mp_number = nil
  5747. end
  5748.  
  5749. #--------------------------------------------------------------------------
  5750. # * Dispose MP Number Max
  5751. #--------------------------------------------------------------------------
  5752. def dispose_mp_number_max
  5753. return if @mp_number2 == nil
  5754. @mp_number2.bitmap.dispose
  5755. @mp_number2.dispose
  5756. @mp_number2 = nil
  5757. end
  5758.  
  5759. #--------------------------------------------------------------------------
  5760. # * Dispose MP Meter
  5761. #--------------------------------------------------------------------------
  5762. def dispose_mp_meter
  5763. return if @mp_meter == nil
  5764. @mp_meter.bitmap.dispose
  5765. @mp_meter.dispose
  5766. @mp_meter = nil
  5767. end
  5768.  
  5769. #--------------------------------------------------------------------------
  5770. # * Dispose MP Icon
  5771. #--------------------------------------------------------------------------
  5772. def dispose_mp_icon
  5773. return if @mp_icon == nil
  5774. @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  5775. @mp_icon.dispose
  5776. @mp_icon = nil
  5777. end
  5778.  
  5779. #--------------------------------------------------------------------------
  5780. # * Dispose MP Icon EX
  5781. #--------------------------------------------------------------------------
  5782. def dispose_mp_icon_ex
  5783. return if @mp_icon3 == nil
  5784. @mp_icon3.bitmap.dispose
  5785. @mp_icon3.dispose
  5786. @mp_icon3 = nil
  5787. end
  5788.  
  5789. #--------------------------------------------------------------------------
  5790. # * Dispose MP Icon Number
  5791. #--------------------------------------------------------------------------
  5792. def dispose_mp_icon_number
  5793. return if @mp_icon_number == nil
  5794. @mp_icon_number.bitmap.dispose
  5795. @mp_icon_number.dispose
  5796. @mp_icon_number = nil
  5797. end
  5798.  
  5799. #--------------------------------------------------------------------------
  5800. # * Dispose TP Number
  5801. #--------------------------------------------------------------------------
  5802. def dispose_tp_number
  5803. return if @tp_number == nil
  5804. @tp_number.bitmap.dispose
  5805. @tp_number.dispose
  5806. @tp_number = nil
  5807. end
  5808.  
  5809. #--------------------------------------------------------------------------
  5810. # * Dispose TP Number Max
  5811. #--------------------------------------------------------------------------
  5812. def dispose_tp_number_max
  5813. return if @tp_number2 == nil
  5814. @tp_number2.bitmap.dispose
  5815. @tp_number2.dispose
  5816. @tp_number2 = nil
  5817. end
  5818.  
  5819. #--------------------------------------------------------------------------
  5820. # * Dispose TP Meter
  5821. #--------------------------------------------------------------------------
  5822. def dispose_tp_meter
  5823. return if @tp_meter == nil
  5824. @tp_meter.bitmap.dispose
  5825. @tp_meter.dispose
  5826. @tp_meter = nil
  5827. end
  5828.  
  5829. #--------------------------------------------------------------------------
  5830. # * Dispose TP Icon
  5831. #--------------------------------------------------------------------------
  5832. def dispose_tp_icon
  5833. return if @tp_icon == nil
  5834. @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  5835. @tp_icon.dispose
  5836. @tp_icon = nil
  5837. end
  5838.  
  5839. #--------------------------------------------------------------------------
  5840. # * Dispose TP Icon EX
  5841. #--------------------------------------------------------------------------
  5842. def dispose_tp_icon_ex
  5843. return if @tp_icon3 == nil
  5844. @tp_icon3.bitmap.dispose
  5845. @tp_icon3.dispose
  5846. @tp_icon3 = nil
  5847. end
  5848.  
  5849. #--------------------------------------------------------------------------
  5850. # * Dispose TP Icon Number
  5851. #--------------------------------------------------------------------------
  5852. def dispose_tp_icon_number
  5853. return if @tp_icon_number == nil
  5854. @tp_icon_number.bitmap.dispose
  5855. @tp_icon_number.dispose
  5856. @tp_icon_numbe = nil
  5857. end
  5858.  
  5859. #--------------------------------------------------------------------------
  5860. # * Dispose AT Number
  5861. #--------------------------------------------------------------------------
  5862. def dispose_at_number
  5863. return if @at_number == nil
  5864. @at_number.bitmap.dispose
  5865. @at_number.dispose
  5866. @at_number = nil
  5867. end
  5868.  
  5869. #--------------------------------------------------------------------------
  5870. # * Dispose AT Number Max
  5871. #--------------------------------------------------------------------------
  5872. def dispose_at_number_max
  5873. return if @at_number2 == nil
  5874. @at_number2.bitmap.dispose
  5875. @at_number2.dispose
  5876. @at_number2 = nil
  5877. end
  5878.  
  5879. #--------------------------------------------------------------------------
  5880. # * Dispose AT Meter
  5881. #--------------------------------------------------------------------------
  5882. def dispose_at_meter
  5883. return if @at_meter == nil
  5884. @at_meter.bitmap.dispose
  5885. @at_meter.dispose
  5886. @at_meter = nil
  5887. end
  5888.  
  5889. #--------------------------------------------------------------------------
  5890. # * Dispose Lv Number
  5891. #--------------------------------------------------------------------------
  5892. def dispose_lv_number
  5893. return if @lv_number == nil
  5894. @lv_number.bitmap.dispose
  5895. @lv_number.dispose
  5896. @lv_number = nil
  5897. end
  5898.  
  5899. #--------------------------------------------------------------------------
  5900. # * Dispose States
  5901. #--------------------------------------------------------------------------
  5902. def dispose_states
  5903. return if @status == nil
  5904. @status.bitmap.dispose if @status.bitmap != nil
  5905. @status.dispose
  5906. @actor_status.dispose if @actor_status != nil
  5907. @status = nil
  5908. end
  5909.  
  5910. end
  5911.  
  5912. #==============================================================================
  5913. #==============================================================================
  5914. # ** Battle Hud EX
  5915. #==============================================================================
  5916. #==============================================================================
  5917. class Battle_Hud_EX
  5918.  
  5919. #--------------------------------------------------------------------------
  5920. # * Refresh Visible
  5921. #--------------------------------------------------------------------------
  5922. def refresh_visible(vis)
  5923. @layout.visible = vis if @layout
  5924. @layout2.visible = vis if @layout2
  5925. @name.visible = vis if @name
  5926. @lv_number.visible = vis if @lv_number
  5927. @status.visible = vis if @status
  5928. @face.visible = vis if @face
  5929. @hp_number.visible = vis if @hp_number
  5930. @hp_number2.visible = vis if @hp_number2
  5931. @hp_meter.visible = vis if @hp_meter
  5932. @hp_icon.visible = vis if @hp_icon
  5933. @hp_icon3.visible = vis if @hp_icon3
  5934. @hp_icon_number.visible = vis if @hp_icon_number
  5935. @mp_number.visible = vis if @mp_number
  5936. @mp_number2.visible = vis if @mp_number2
  5937. @mp_meter.visible = vis if @mp_meter
  5938. @mp_icon.visible = vis if @mp_icon
  5939. @mp_icon3.visible = vis if @mp_icon3
  5940. @mp_icon_number.visible = vis if @mp_icon_number
  5941. @tp_number.visible = vis if @tp_number
  5942. @tp_number2.visible = vis if @tp_number2
  5943. @tp_meter.visible = vis if @tp_meter
  5944. @tp_icon.visible = vis if @tp_icon
  5945. @tp_icon3.visible = vis if @tp_icon3
  5946. @tp_icon_number.visible = vis if @tp_icon_number
  5947. @at_number.visible = vis if @at_number
  5948. @at_number2.visible = vis if @at_number2
  5949. @at_meter.visible = vis if @at_meter
  5950. end
  5951.  
  5952. #--------------------------------------------------------------------------
  5953. # * Update
  5954. #--------------------------------------------------------------------------
  5955. def update
  5956. return if @actor == nil
  5957. @sprite_visible = sprite_visible?
  5958. @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  5959. update_layout ; update_layout_2 ; update_name
  5960. update_face ; update_hp ; update_mp ; update_tp
  5961. update_at ; update_level ; update_states
  5962. end
  5963.  
  5964. end
  5965.  
  5966. #==============================================================================
  5967. # ■ Sprite Battler
  5968. #==============================================================================
  5969. class Sprite_Battler < Sprite_Base
  5970.  
  5971. #--------------------------------------------------------------------------
  5972. # ● Set AV
  5973. #--------------------------------------------------------------------------
  5974. def set_av(a_viewport)
  5975. @viewport_cm = a_viewport
  5976. end
  5977.  
  5978. #--------------------------------------------------------------------------
  5979. # ● Dispose
  5980. #--------------------------------------------------------------------------
  5981. alias mog_bc_dispose dispose
  5982. def dispose
  5983. mog_bc_dispose
  5984. @viewport_cm.dispose if @viewport_cm != nil
  5985. end
  5986.  
  5987. #--------------------------------------------------------------------------
  5988. # ● Maker Animation Sprites
  5989. #--------------------------------------------------------------------------
  5990. alias mog_bc_make_animation_sprites make_animation_sprites
  5991. def make_animation_sprites
  5992. mog_bc_make_animation_sprites
  5993. set_cm_viewport if $imported[:mog_battle_camera]
  5994. end
  5995.  
  5996. #--------------------------------------------------------------------------
  5997. # ● Set CM Viewpor
  5998. #--------------------------------------------------------------------------
  5999. def set_cm_viewport
  6000. return if @viewport_cm == nil
  6001. return if @ani_sprites == nil
  6002. if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  6003. @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
  6004. return
  6005. end
  6006. @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
  6007. end
  6008.  
  6009. end
  6010.  
  6011. #==============================================================================
  6012. # ■ Game Temp
  6013. #==============================================================================
  6014. class Spriteset_Battle
  6015.  
  6016. #--------------------------------------------------------------------------
  6017. # ● Initialize
  6018. #--------------------------------------------------------------------------
  6019. alias mog_bc_sp_initialize initialize
  6020. def initialize
  6021. mog_bc_sp_initialize
  6022. if $imported[:mog_battle_camera] and @viewport_cm != nil
  6023. battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
  6024. end
  6025. end
  6026.  
  6027. #--------------------------------------------------------------------------
  6028. # ● Create Viewports
  6029. #--------------------------------------------------------------------------
  6030. alias mog_bc_create_viewports create_viewports
  6031. def create_viewports
  6032. mog_bc_create_viewports
  6033. if $imported[:mog_battle_camera]
  6034. @viewport_cm = Viewport.new
  6035. @viewport_cm.z = 100
  6036. end
  6037. end
  6038.  
  6039. #--------------------------------------------------------------------------
  6040. # ● Dispose Viewports
  6041. #--------------------------------------------------------------------------
  6042. alias mog_bc_dispose_viewports dispose_viewports
  6043. def dispose_viewports
  6044. mog_bc_dispose_viewports
  6045. @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
  6046. end
  6047.  
  6048. #--------------------------------------------------------------------------
  6049. # ● Update Viewports
  6050. #--------------------------------------------------------------------------
  6051. alias mog_bcf_update_viewports update_viewports
  6052. def update_viewports
  6053. mog_bcf_update_viewports
  6054. update_viewport_cm if $imported[:mog_battle_camera]
  6055. end
  6056.  
  6057. #--------------------------------------------------------------------------
  6058. # ● Update Viewport CM
  6059. #--------------------------------------------------------------------------
  6060. def update_viewport_cm
  6061. return if @viewport_cm == nil
  6062. @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
  6063. @viewport_cm.oy = $game_temp.bc_data[1]
  6064. @viewport_cm.update
  6065. end
  6066.  
  6067. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement