Guest User

Untitled

a guest
Nov 30th, 2014
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 181.52 KB | None | 0 0
  1. #==============================================================================
  2. # +++ MOG - Battle Hud EX (v1.0) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com
  6. #==============================================================================
  7. # Sistema avançado de Hud de batalha, voltado para artistas gráficos e
  8. # usuários avançados.
  9. #
  10. # Compatível com :
  11. #
  12. # - Victor Sant - Animated_battle (1.21)
  13. # - Victor Sant - Active Time Battle (1.05)
  14. # - Yami - Battle Symphony (1.15)
  15. # - Yanfly - Battle Engine (1.09)
  16. # - Yanfly - Visual Battlers (1.01)
  17. # - Kread-EX - Animated Battlers (1.08)
  18. # - Galv - Animated Battlers (1.2)
  19. # - Enu - Tankentai SBS (v1.00)
  20. #
  21. #==============================================================================
  22. # Coloque as imagens da hud na pasta.
  23. #
  24. # Graphics/Huds/Battle/
  25. #
  26. #==============================================================================
  27. module MOG_BATTLE_HUD_EX
  28.  
  29. #============================================================================
  30. #============================================================================
  31. # * HUD SPRITE (GENERAL)
  32. #============================================================================
  33. # Definição da prioridade da hud.
  34. #---------------------------------------------------------------------------
  35. HUD_Z = 150
  36. #---------------------------------------------------------------------------
  37. # Definição da posição geral da hud, influência em todos os sprites da hud.
  38. #---------------------------------------------------------------------------
  39. HUD_POSITION = [40,300]
  40. # Definição do espaço entre os membros do grupo.
  41. # (Use apenas para ajustes)
  42. MEMBERS_SPACE = [-700 ,60]
  43. # Definição fixa da hud se deseja posicionar a hud em lugares
  44. # específicos da tela.
  45. #
  46. # FIXED_POSITION[INDEX_ID] = [X,Y]
  47. #
  48. FIXED_POSITION = []
  49. #FIXED_POSITION[0] = [10,10]
  50. #FIXED_POSITION[1] = [410,10]
  51. #FIXED_POSITION[2] = [10,320]
  52. #FIXED_POSITION[3] = [410,320]
  53. # Definição da posição do comando quando a opção de janelas fixa é ativada.
  54. FIXED_COMMAND_POSITION = [Graphics.width / 2,(Graphics.height / 2) + 96]
  55. # Definição da posição da janela de mensagem.
  56. BATTLE_MESSAGE_POSITION = 0
  57. #---------------------------------------------------------------------------
  58. # Definição da porcentagem do parâmetro baixo, isso influência na cor
  59. # do número dos parâmetros de HP, MP e TP.
  60. #---------------------------------------------------------------------------
  61. LOW_PARAMETER_PERCENTAGE = 25
  62. #============================================================================
  63. #============================================================================
  64.  
  65.  
  66. #============================================================================
  67. #============================================================================
  68. # * NAME
  69. #============================================================================
  70. # Ativar o Sprite do nome do personagem.
  71. #---------------------------------------------------------------------------
  72. NAME_VISIBLE = false
  73. #---------------------------------------------------------------------------
  74. # Definição da prioridade do Sprite.
  75. #---------------------------------------------------------------------------
  76. NAME_Z = 5
  77. #---------------------------------------------------------------------------
  78. # Definição da posição da Face. [X,Y]
  79. #---------------------------------------------------------------------------
  80. NAME_POSITION = [0,0]
  81. #---------------------------------------------------------------------------
  82. # Definição do tipo alinhamento do nome.
  83. #
  84. # 0 - Esquerda
  85. # 1 - Centro
  86. # 2 - Direita
  87. #---------------------------------------------------------------------------
  88. NAME_ALIGN_TYPE = 0
  89. #---------------------------------------------------------------------------
  90. # Definição do nome da fonte.
  91. #---------------------------------------------------------------------------
  92. NAME_FONT_NAME = "Georgia"
  93. #---------------------------------------------------------------------------
  94. # Definição do tamanho da fonte.
  95. #---------------------------------------------------------------------------
  96. NAME_FONT_SIZE = 20
  97. #---------------------------------------------------------------------------
  98. # Ativar Bold.
  99. #---------------------------------------------------------------------------
  100. NAME_FONT_BOLD = true
  101. #---------------------------------------------------------------------------
  102. # Ativar Italic.
  103. #---------------------------------------------------------------------------
  104. NAME_FONT_ITALIC = true
  105. #---------------------------------------------------------------------------
  106. # Definição da cor da fonte
  107. #---------------------------------------------------------------------------
  108. NAME_FONT_COLOR = Color.new(255,255,255,255)
  109. #---------------------------------------------------------------------------
  110. # Ativar Sombra
  111. #---------------------------------------------------------------------------
  112. NAME_FONT_SHADOW = true
  113. #---------------------------------------------------------------------------
  114. # Definição da cor da sombra
  115. #---------------------------------------------------------------------------
  116. NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  117. #---------------------------------------------------------------------------
  118. # Definição da distância da sombra.
  119. #---------------------------------------------------------------------------
  120. NAME_FONT_SHADOW_POSITION = [2,2]
  121. #============================================================================
  122. #============================================================================
  123.  
  124.  
  125. #============================================================================
  126. #============================================================================
  127. # * FACE
  128. #============================================================================
  129. # Ativar a face.
  130. # Será necessário o arquivo.
  131. #
  132. # ACTOR_NAME + _Face.png
  133. #
  134. # Eric_Face.png
  135. #
  136. #---------------------------------------------------------------------------
  137. FACE_VISIBLE = true
  138. # Ativar as Faces representando os battlers.
  139. # Deixe "false" se tiver problemas de compatibilidade com scripts.
  140. FACE_BATTLER = true
  141. #---------------------------------------------------------------------------
  142. # Definição da prioridade do sprite.
  143. #---------------------------------------------------------------------------
  144. FACE_Z = 1
  145. #---------------------------------------------------------------------------
  146. # Definição da posição da Face. [X,Y]
  147. #---------------------------------------------------------------------------
  148. FACE_POSITION = [39,-33]
  149. #---------------------------------------------------------------------------
  150. # Ativar faces animadas.
  151. # Será necessário ter uma imagem de 4 faces do personagem no mesmo arquivo.
  152. #
  153. # FACE1/FACE2/FACE3/FACE4
  154. #
  155. # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
  156. # a imagem será dividida por 1 frame
  157. #---------------------------------------------------------------------------
  158. FACE_ANIMATION = false
  159. # Ativar o efeito de Zoom quando o personagem usar alguma ação.
  160. FACE_ZOOM_ANIMATION = false
  161. #---------------------------------------------------------------------------
  162. # Definição do tempo duração da animação da face.
  163. #---------------------------------------------------------------------------
  164. FACE_ANIMATION_DURATION = 0
  165. #---------------------------------------------------------------------------
  166. # Ativar o efeito tremor da face quando o personagem sofrer dano.
  167. #---------------------------------------------------------------------------
  168. FACE_SHAKE_EFFECT = false
  169. #============================================================================
  170. #============================================================================
  171.  
  172.  
  173. #============================================================================
  174. #============================================================================
  175. # * HP
  176. #============================================================================
  177. # Ativar o número de HP.
  178. # Será necessário o arquivo.
  179. #
  180. # HP_Number.png
  181. #
  182. #---------------------------------------------------------------------------
  183. HP_NUMBER_VISIBLE = true
  184. #---------------------------------------------------------------------------
  185. # Definição da prioridade do Sprite.
  186. #---------------------------------------------------------------------------
  187. HP_NUMBER_Z = 2
  188. #---------------------------------------------------------------------------
  189. # Definição da posição do número de HP. [X,Y]
  190. #---------------------------------------------------------------------------
  191. HP_NUMBER_POSITION = [305,-7]
  192. #---------------------------------------------------------------------------
  193. # Ativar o número de HP Total.
  194. # Será necessário o arquivo.
  195. #
  196. # HP_Number_Max.png
  197. #
  198. #---------------------------------------------------------------------------
  199. HP_NUMBER_MAX_VISIBLE = false
  200. #---------------------------------------------------------------------------
  201. # Definição da posição do número de HP Total. [X,Y]
  202. #---------------------------------------------------------------------------
  203. HP_NUMBER_MAX_POSITION = [165,24]
  204. #---------------------------------------------------------------------------
  205. # Definição do tipo alinhamento do número.
  206. #
  207. # 0 - Esquerda
  208. # 1 - Centro
  209. # 2 - Direita
  210. #---------------------------------------------------------------------------
  211. HP_NUMBER_ALIGN_TYPE = 2
  212. #---------------------------------------------------------------------------
  213. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  214. #---------------------------------------------------------------------------
  215. HP_NUMBER_WAVE_ALIGN_EFFECT = false
  216. #---------------------------------------------------------------------------
  217. # Apresentar os números em porcentagem.
  218. #---------------------------------------------------------------------------
  219. HP_NUMBER_PERCENTAGE = false
  220. #---------------------------------------------------------------------------
  221. # Ativar números animados ("Rolantes").
  222. #---------------------------------------------------------------------------
  223. HP_NUMBER_ANIMATION = true
  224. #---------------------------------------------------------------------------
  225. # Ativar a cor do HP baixo.
  226. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  227. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  228. #
  229. # NORMAL_COLOR
  230. # LOW_PARAMETER_COLOR
  231. #
  232. # Caso definir a função como FALSE a imagem será dividida apenas como
  233. # 1 frame de altura.
  234. #---------------------------------------------------------------------------
  235. HP_NUMBER_LOW_COLOR = true
  236. #---------------------------------------------------------------------------
  237. # Ativar o medidor de HP.
  238. # Será necessário o arquivo.
  239. #
  240. # HP_Meter.png
  241. #
  242. #---------------------------------------------------------------------------
  243. HP_METER_VISIBLE = true
  244. #---------------------------------------------------------------------------
  245. # Definição da prioridade do sprite.
  246. #---------------------------------------------------------------------------
  247. HP_METER_Z = 1
  248. #---------------------------------------------------------------------------
  249. # Definição da posição do medidor de HP. [X,Y]
  250. #---------------------------------------------------------------------------
  251. HP_METER_POSITION = [5.7,16]
  252. #---------------------------------------------------------------------------
  253. # Definição do ângulo do medidor.
  254. #---------------------------------------------------------------------------
  255. HP_METER_ANGLE = 0
  256. #---------------------------------------------------------------------------
  257. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  258. # inverso.
  259. #---------------------------------------------------------------------------
  260. HP_METER_MIRROR_EFFECT = true
  261. #---------------------------------------------------------------------------
  262. # Ativar o efeito animado de dano no medidor.
  263. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  264. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  265. #
  266. # NORMAL_COLOR
  267. # DAMAGE_COLOR
  268. #
  269. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  270. #---------------------------------------------------------------------------
  271. HP_METER_REDUCTION_ANIMATION = true
  272. #---------------------------------------------------------------------------
  273. # Ativar o efeito animado do "medidor fluindo".
  274. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  275. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  276. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  277. #---------------------------------------------------------------------------
  278. HP_METER_GRADIENT_ANIMATION = false
  279. #---------------------------------------------------------------------------
  280. # Ativar HP em ícones.
  281. # Será necessário ter a imagem.
  282. #
  283. # HP_Icon.png
  284. #
  285. #---------------------------------------------------------------------------
  286. HP_ICON_VISIBLE = false
  287. #---------------------------------------------------------------------------
  288. # Definição da prioridade do Sprite.
  289. #---------------------------------------------------------------------------
  290. HP_ICON_Z = 1
  291. #---------------------------------------------------------------------------
  292. # Posição do ícone de HP.
  293. #---------------------------------------------------------------------------
  294. HP_ICON_POSITION = [200,0]
  295. #---------------------------------------------------------------------------
  296. # Ativar o sprite EX do ultimo ícone
  297. # Será necessário ter a imagem.
  298. #
  299. # HP_Icon_EX.png
  300. #
  301. #---------------------------------------------------------------------------
  302. HP_ICON_EX_VISIBLE = false
  303. #---------------------------------------------------------------------------
  304. # Posição do ícone Animado.
  305. #---------------------------------------------------------------------------
  306. HP_ICON_EX_POSITION = [0,0]
  307. #---------------------------------------------------------------------------
  308. # Ativar o efeito de Zoom do Sprite.
  309. #---------------------------------------------------------------------------
  310. HP_ICON_EX_ZOOM_EFFECT = true
  311. #---------------------------------------------------------------------------
  312. # Espaço entre os ícones.
  313. #---------------------------------------------------------------------------
  314. HP_ICON_SPACE = [-10,-10]
  315. #---------------------------------------------------------------------------
  316. # Definição da quantidade maxima de ícones na horizontal.
  317. #---------------------------------------------------------------------------
  318. HP_ICON_COL_MAX = 10
  319. #---------------------------------------------------------------------------
  320. # Definição da quantidade maxima de ícones na vertical.
  321. #---------------------------------------------------------------------------
  322. HP_ICON_ROW_MAX = 2
  323. #---------------------------------------------------------------------------
  324. # Ativar o número de HP de ícones.
  325. # Será necessário ter a imagem.
  326. #
  327. # HP_Icon_Number.png
  328. #
  329. #---------------------------------------------------------------------------
  330. HP_ICON_NUMBER_VISIBLE = false
  331. #---------------------------------------------------------------------------
  332. # Definição da prioridade do sprite.
  333. #---------------------------------------------------------------------------
  334. HP_ICON_NUMBER_Z = 4
  335. #---------------------------------------------------------------------------
  336. # Posição do número do ícone
  337. #---------------------------------------------------------------------------
  338. HP_ICON_NUMBER_POSITION = [0,0]
  339. #---------------------------------------------------------------------------
  340. # Definição do tipo alinhamento do número.
  341. #
  342. # 0 - Esquerda
  343. # 1 - Centro
  344. # 2 - Direita
  345. #---------------------------------------------------------------------------
  346. HP_ICON_NUMBER_ALIGN_TYPE = 0
  347. #============================================================================
  348. #============================================================================
  349.  
  350.  
  351. #============================================================================
  352. #============================================================================
  353. # * MP
  354. #============================================================================
  355. # Ativar o número de MP.
  356. # Será necessário o arquivo.
  357. #
  358. # MP_Number.png
  359. #
  360. #---------------------------------------------------------------------------
  361. MP_NUMBER_VISIBLE = true
  362. #---------------------------------------------------------------------------
  363. # Definição da prioridade do Sprite.
  364. #---------------------------------------------------------------------------
  365. MP_NUMBER_Z = 2
  366. #---------------------------------------------------------------------------
  367. # Definição da posição do número de MP. [X,Y]
  368. #---------------------------------------------------------------------------
  369. MP_NUMBER_POSITION = [216,25]
  370. #---------------------------------------------------------------------------
  371. # Ativar o número de MP Total.
  372. # Será necessário o arquivo.
  373. #
  374. # MP_Number_Max.png
  375. #
  376. #---------------------------------------------------------------------------
  377. MP_NUMBER_MAX_VISIBLE = false
  378. #---------------------------------------------------------------------------
  379. # Definição da posição do número de MP Total. [X,Y]
  380. #---------------------------------------------------------------------------
  381. MP_NUMBER_MAX_POSITION = [120,55]
  382. #---------------------------------------------------------------------------
  383. # Definição do tipo alinhamento do número.
  384. #
  385. # 0 - Esquerda
  386. # 1 - Centro
  387. # 2 - Direita
  388. #---------------------------------------------------------------------------
  389. MP_NUMBER_ALIGN_TYPE = 2
  390. #---------------------------------------------------------------------------
  391. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  392. #---------------------------------------------------------------------------
  393. MP_NUMBER_WAVE_ALIGN_EFFECT = false
  394. #---------------------------------------------------------------------------
  395. # Apresentar os números em porcentagem.
  396. #---------------------------------------------------------------------------
  397. MP_NUMBER_PERCENTAGE = false
  398. #---------------------------------------------------------------------------
  399. # Ativar números animados ("Rolantes").
  400. #---------------------------------------------------------------------------
  401. MP_NUMBER_ANIMATION = true
  402. #---------------------------------------------------------------------------
  403. # Ativar a cor do MP baixo.
  404. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  405. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  406. #
  407. # NORMAL_COLOR
  408. # LOW_PARAMETER_COLOR
  409. #
  410. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  411. #---------------------------------------------------------------------------
  412. MP_NUMBER_LOW_COLOR = true
  413. #---------------------------------------------------------------------------
  414. # Ativar o medidor de MP.
  415. # Será necessário o arquivo.
  416. #
  417. # MP_Meter.png
  418. #
  419. #---------------------------------------------------------------------------
  420. MP_METER_VISIBLE = true
  421. #---------------------------------------------------------------------------
  422. # Definição da prioridade do sprite.
  423. #---------------------------------------------------------------------------
  424. MP_METER_Z = 1
  425. #---------------------------------------------------------------------------
  426. # Definição da posição do medidor de MP. [X,Y]
  427. #---------------------------------------------------------------------------
  428. MP_METER_POSITION = [91,27]
  429. #---------------------------------------------------------------------------
  430. # Definição do ângulo do medidor.
  431. #---------------------------------------------------------------------------
  432. MP_METER_ANGLE = 0
  433. #---------------------------------------------------------------------------
  434. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  435. # inverso.
  436. #---------------------------------------------------------------------------
  437. MP_METER_MIRROR_EFFECT = true
  438. #---------------------------------------------------------------------------
  439. # Ativar o efeito animado de dano no medidor.
  440. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  441. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  442. #
  443. # NORMAL_COLOR
  444. # DAMAGE_COLOR
  445. #
  446. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  447. #---------------------------------------------------------------------------
  448. MP_METER_REDUCTION_ANIMATION = true
  449. #---------------------------------------------------------------------------
  450. # Ativar o efeito animado do "medidor fluindo".
  451. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  452. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  453. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  454. #---------------------------------------------------------------------------
  455. MP_METER_GRADIENT_ANIMATION = false
  456. #---------------------------------------------------------------------------
  457. # Ativar MP em ícones.
  458. # Será necessário ter a imagem.
  459. #
  460. # MP_Icon.png
  461. #
  462. #---------------------------------------------------------------------------
  463. MP_ICON_VISIBLE = false
  464. #---------------------------------------------------------------------------
  465. # Definição da prioridade do Sprite.
  466. #---------------------------------------------------------------------------
  467. MP_ICON_Z = 1
  468. #---------------------------------------------------------------------------
  469. # Posição do ícone de MP.
  470. #---------------------------------------------------------------------------
  471. MP_ICON_POSITION = [200,64]
  472. #---------------------------------------------------------------------------
  473. # Ativar o sprite EX do ultimo ícone
  474. # Será necessário ter a imagem.
  475. #
  476. # MP_Icon_EX.png
  477. #
  478. #---------------------------------------------------------------------------
  479. MP_ICON_EX_VISIBLE = false
  480. #---------------------------------------------------------------------------
  481. # Posição do ícone Animado.
  482. #---------------------------------------------------------------------------
  483. MP_ICON_EX_POSITION = [0,0]
  484. #---------------------------------------------------------------------------
  485. # Ativar o efeito de Zoom do Sprite.
  486. #---------------------------------------------------------------------------
  487. MP_ICON_EX_ZOOM_EFFECT = true
  488. #---------------------------------------------------------------------------
  489. # Espaço entre os ícones.
  490. #---------------------------------------------------------------------------
  491. MP_ICON_SPACE = [-10,-10]
  492. #---------------------------------------------------------------------------
  493. # Definição da quantidade maxima de ícones na horizontal.
  494. #---------------------------------------------------------------------------
  495. MP_ICON_COL_MAX = 10
  496. #---------------------------------------------------------------------------
  497. # Definição da quantidade maxima de ícones na vertical.
  498. #---------------------------------------------------------------------------
  499. MP_ICON_ROW_MAX = 2
  500. #---------------------------------------------------------------------------
  501. # Ativar o número de MP de ícones.
  502. # Será necessário ter a imagem.
  503. #
  504. # MP_Icon_Number.png
  505. #
  506. #---------------------------------------------------------------------------
  507. MP_ICON_NUMBER_VISIBLE = false
  508. #---------------------------------------------------------------------------
  509. # Definição da prioridade do sprite.
  510. #---------------------------------------------------------------------------
  511. MP_ICON_NUMBER_Z = 4
  512. #---------------------------------------------------------------------------
  513. # Posição do número do ícone
  514. #---------------------------------------------------------------------------
  515. MP_ICON_NUMBER_POSITION = [0,64]
  516. #---------------------------------------------------------------------------
  517. # Definição do tipo alinhamento do número.
  518. #
  519. # 0 - Esquerda
  520. # 1 - Centro
  521. # 2 - Direita
  522. #---------------------------------------------------------------------------
  523. MP_ICON_NUMBER_ALIGN_TYPE = 0
  524. #============================================================================
  525. #============================================================================
  526.  
  527.  
  528. #============================================================================
  529. #============================================================================
  530. # * TP
  531. #============================================================================
  532. # Ativar o número de TP.
  533. # Será necessário o arquivo.
  534. #
  535. # TP_Number.png
  536. #
  537. #---------------------------------------------------------------------------
  538. TP_NUMBER_VISIBLE = true
  539. #---------------------------------------------------------------------------
  540. # Definição da prioridade do sprite.
  541. #---------------------------------------------------------------------------
  542. TP_NUMBER_Z = 2
  543. #---------------------------------------------------------------------------
  544. # Definição da posição do número de TP. [X,Y]
  545. #---------------------------------------------------------------------------
  546. TP_NUMBER_POSITION = [297,25]
  547. #---------------------------------------------------------------------------
  548. # Ativar o número de TP Total.
  549. # Será necessário o arquivo.
  550. #
  551. # TP_Number_Max.png
  552. #
  553. #---------------------------------------------------------------------------
  554. TP_NUMBER_MAX_VISIBLE = false
  555. #---------------------------------------------------------------------------
  556. # Definição da posição do número de TP Total. [X,Y]
  557. #---------------------------------------------------------------------------
  558. TP_NUMBER_MAX_POSITION = [280,25]
  559. #---------------------------------------------------------------------------
  560. # Definição do tipo alinhamento do número.
  561. #
  562. # 0 - Esquerda
  563. # 1 - Centro
  564. # 2 - Direita
  565. #---------------------------------------------------------------------------
  566. TP_NUMBER_ALIGN_TYPE = 2
  567. #---------------------------------------------------------------------------
  568. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  569. #---------------------------------------------------------------------------
  570. TP_NUMBER_WAVE_ALIGN_EFFECT = false
  571. #---------------------------------------------------------------------------
  572. # Apresentar os números em porcentagem.
  573. #---------------------------------------------------------------------------
  574. TP_NUMBER_PERCENTAGE = false
  575. #---------------------------------------------------------------------------
  576. # Ativar números animados ("Rolantes").
  577. #---------------------------------------------------------------------------
  578. TP_NUMBER_ANIMATION = true
  579. #---------------------------------------------------------------------------
  580. # Ativar a cor do TP baixo.
  581. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  582. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  583. #
  584. # NORMAL_COLOR
  585. # LOW_PARAMETER_COLOR
  586. #
  587. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  588. #---------------------------------------------------------------------------
  589. TP_NUMBER_LOW_COLOR = true
  590. #---------------------------------------------------------------------------
  591. # Ativar o medidor de TP.
  592. # Será necessário o arquivo.
  593. #
  594. # TP_Meter.png
  595. #
  596. #---------------------------------------------------------------------------
  597. TP_METER_VISIBLE = true
  598. #---------------------------------------------------------------------------
  599. # Definição da prioridade do sprite.
  600. #---------------------------------------------------------------------------
  601. TP_METER_Z = 1
  602. #---------------------------------------------------------------------------
  603. # Definição da posição do medidor de TP. [X,Y]
  604. #---------------------------------------------------------------------------
  605. TP_METER_POSITION = [219,27]
  606. #---------------------------------------------------------------------------
  607. # Definição do ângulo do medidor.
  608. #---------------------------------------------------------------------------
  609. TP_METER_ANGLE = 0
  610. #---------------------------------------------------------------------------
  611. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  612. # inverso.
  613. #---------------------------------------------------------------------------
  614. TP_METER_MIRROR_EFFECT = false
  615. #---------------------------------------------------------------------------
  616. # Ativar o efeito animado de dano no medidor.
  617. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  618. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  619. #
  620. # NORMAL_COLOR
  621. # DAMAGE_COLOR
  622. #
  623. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  624. #---------------------------------------------------------------------------
  625. TP_METER_REDUCTION_ANIMATION = true
  626. #---------------------------------------------------------------------------
  627. # Ativar o efeito animado do "medidor fluindo".
  628. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  629. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  630. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  631. #---------------------------------------------------------------------------
  632. TP_METER_GRADIENT_ANIMATION = false
  633. #---------------------------------------------------------------------------
  634. # Ativar TP em ícones.
  635. # Será necessário ter a imagem.
  636. #
  637. # TP_Icon.png
  638. #
  639. #---------------------------------------------------------------------------
  640. TP_ICON_VISIBLE = false
  641. #---------------------------------------------------------------------------
  642. # Definição da prioridade do sprite.
  643. #---------------------------------------------------------------------------
  644. TP_ICON_Z = 1
  645. #---------------------------------------------------------------------------
  646. # Posição do ícone de TP.
  647. #---------------------------------------------------------------------------
  648. TP_ICON_POSITION = [200,128]
  649. #---------------------------------------------------------------------------
  650. # Ativar o sprite EX do ultimo ícone
  651. # Será necessário ter a imagem.
  652. #
  653. # TP_Icon_EX.png
  654. #
  655. #---------------------------------------------------------------------------
  656. TP_ICON_EX_VISIBLE = false
  657. #---------------------------------------------------------------------------
  658. # Posição do ícone Animado.
  659. #---------------------------------------------------------------------------
  660. TP_ICON_EX_POSITION = [0,0]
  661. #---------------------------------------------------------------------------
  662. # Ativar o efeito de Zoom do Sprite.
  663. #---------------------------------------------------------------------------
  664. TP_ICON_EX_ZOOM_EFFECT = true
  665. #---------------------------------------------------------------------------
  666. # Espaço entre os ícones.
  667. #---------------------------------------------------------------------------
  668. TP_ICON_SPACE = [-10,-10]
  669. #---------------------------------------------------------------------------
  670. # Definição da quantidade maxima de ícones na horizontal.
  671. #---------------------------------------------------------------------------
  672. TP_ICON_COL_MAX = 10
  673. #---------------------------------------------------------------------------
  674. # Definição da quantidade maxima de ícones na vertical.
  675. #---------------------------------------------------------------------------
  676. TP_ICON_ROW_MAX = 2
  677. #---------------------------------------------------------------------------
  678. # Ativar o número de TP de ícones.
  679. # Será necessário ter a imagem.
  680. #
  681. # TP_Icon_Number.png
  682. #
  683. #---------------------------------------------------------------------------
  684. TP_ICON_NUMBER_VISIBLE = false
  685. #---------------------------------------------------------------------------
  686. # Definição da prioridade do sprite.
  687. #---------------------------------------------------------------------------
  688. TP_ICON_NUMBER_Z = 4
  689. #---------------------------------------------------------------------------
  690. # Posição do número do ícone
  691. #---------------------------------------------------------------------------
  692. TP_ICON_NUMBER_POSITION = [0,128]
  693. #---------------------------------------------------------------------------
  694. # Definição do tipo alinhamento do número.
  695. #
  696. # 0 - Esquerda
  697. # 1 - Centro
  698. # 2 - Direita
  699. #---------------------------------------------------------------------------
  700. TP_ICON_NUMBER_ALIGN_TYPE = 0
  701. #============================================================================
  702. #============================================================================
  703.  
  704. #============================================================================
  705. #============================================================================
  706. # * AT
  707. #============================================================================
  708. # Ativar o número de AT.
  709. # Será necessário o arquivo.
  710. #
  711. # AT_Number.png
  712. #
  713. #---------------------------------------------------------------------------
  714. AT_NUMBER_VISIBLE = false
  715. #---------------------------------------------------------------------------
  716. # Definição da prioridade do Sprite.
  717. #---------------------------------------------------------------------------
  718. AT_NUMBER_Z = 2
  719. #---------------------------------------------------------------------------
  720. # Definição da posição do número de AT. [X,Y]
  721. #---------------------------------------------------------------------------
  722. AT_NUMBER_POSITION = [125,-27]
  723. #---------------------------------------------------------------------------
  724. # Ativar o número de AT Total.
  725. # Será necessário o arquivo.
  726. #
  727. # AT_Number_Max.png
  728. #
  729. #---------------------------------------------------------------------------
  730. AT_NUMBER_MAX_VISIBLE = false
  731. #---------------------------------------------------------------------------
  732. # Definição da posição do número de AT Total. [X,Y]
  733. #---------------------------------------------------------------------------
  734. AT_NUMBER_MAX_POSITION = [165,-17]
  735. #---------------------------------------------------------------------------
  736. # Definição do tipo alinhamento do número.
  737. #
  738. # 0 - Esquerda
  739. # 1 - Centro
  740. # 2 - Direita
  741. #---------------------------------------------------------------------------
  742. AT_NUMBER_ALIGN_TYPE = 2
  743. #---------------------------------------------------------------------------
  744. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  745. #---------------------------------------------------------------------------
  746. AT_NUMBER_WAVE_ALIGN_EFFECT = false
  747. #---------------------------------------------------------------------------
  748. # Apresentar os números em porcentagem.
  749. #---------------------------------------------------------------------------
  750. AT_NUMBER_PERCENTAGE = true
  751. #---------------------------------------------------------------------------
  752. # Ativar números animados ("Rolantes").
  753. #---------------------------------------------------------------------------
  754. AT_NUMBER_ANIMATION = false
  755. #---------------------------------------------------------------------------
  756. # Ativar o medidor de AT.
  757. # Será necessário o arquivo.
  758. #
  759. # AT_Meter.png
  760. #
  761. #---------------------------------------------------------------------------
  762. AT_METER_VISIBLE = false
  763. #---------------------------------------------------------------------------
  764. # Definição da prioridade do sprite.
  765. #---------------------------------------------------------------------------
  766. AT_METER_Z = 1
  767. #---------------------------------------------------------------------------
  768. # Definição da posição do medidor de AT. [X,Y]
  769. #---------------------------------------------------------------------------
  770. AT_METER_POSITION = [30,-20]
  771. #---------------------------------------------------------------------------
  772. # Definição do ângulo do medidor.
  773. #---------------------------------------------------------------------------
  774. AT_METER_ANGLE = 0
  775. #---------------------------------------------------------------------------
  776. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  777. # inverso.
  778. #---------------------------------------------------------------------------
  779. AT_METER_MIRROR_EFFECT = false
  780. #---------------------------------------------------------------------------
  781. # Ativar o efeito animado de dano no medidor.
  782. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  783. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  784. #
  785. # NORMAL_COLOR
  786. # DAMAGE_COLOR
  787. #
  788. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  789. #---------------------------------------------------------------------------
  790. AT_METER_REDUCTION_ANIMATION = false
  791. #---------------------------------------------------------------------------
  792. # Ativar o efeito animado do "medidor fluindo".
  793. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  794. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  795. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  796. #---------------------------------------------------------------------------
  797. AT_METER_GRADIENT_ANIMATION = true
  798. #============================================================================
  799.  
  800.  
  801. #============================================================================
  802. #============================================================================
  803. # * LEVEL
  804. #============================================================================
  805. # Ativar o número de Level.
  806. # Será necessário o arquivo.
  807. #
  808. # LV_Number.png
  809. #
  810. #---------------------------------------------------------------------------
  811. LEVEL_NUMBER_VISIBLE = true
  812. #---------------------------------------------------------------------------
  813. # Definição da prioridade do Sprite.
  814. #---------------------------------------------------------------------------
  815. LEVEL_NUMBER_Z = 2
  816. #---------------------------------------------------------------------------
  817. # Definição da posição do número do Level. [X,Y]
  818. #---------------------------------------------------------------------------
  819. LEVEL_NUMBER_POSITION = [98,-4]
  820. #---------------------------------------------------------------------------
  821. # Definição do tipo alinhamento do número.
  822. #
  823. # 0 - Esquerda
  824. # 1 - Centro
  825. # 2 - Direita
  826. #---------------------------------------------------------------------------
  827. LEVEL_NUMBER_ALIGN_TYPE = 0
  828. #============================================================================
  829. #============================================================================
  830.  
  831.  
  832. #============================================================================
  833. #============================================================================
  834. # * STATE
  835. #============================================================================
  836. # Ativar as condições.
  837. #---------------------------------------------------------------------------
  838. STATES_VISIBLE = true
  839. #---------------------------------------------------------------------------
  840. # Definição da prioridade do sprite.
  841. #---------------------------------------------------------------------------
  842. STATES_Z = 1
  843. #---------------------------------------------------------------------------
  844. # Definição da posição das condições. [X,Y]
  845. #---------------------------------------------------------------------------
  846. STATES_POSITION = [-20,11]
  847. #---------------------------------------------------------------------------
  848. # Ativar o efeito animado das condições deslizando.
  849. #---------------------------------------------------------------------------
  850. STATES_SCROLLING_ANIMATION = false
  851. #---------------------------------------------------------------------------
  852. # Definição do ângulo do sprite.
  853. #---------------------------------------------------------------------------
  854. STATE_ANGLE = 0
  855. #============================================================================
  856. #============================================================================
  857.  
  858. #============================================================================
  859. #============================================================================
  860. # * SECOND LAYOUT (Overlayer)
  861. #============================================================================
  862. # Ativar a segunda camada de Layout
  863. # Será necessário o arquivo.
  864. #
  865. # Layout_2.png
  866. #
  867. #============================================================================
  868. SECOND_LAYOUT = false
  869. #---------------------------------------------------------------------------
  870. # Definição da prioridade do sprite.
  871. #---------------------------------------------------------------------------
  872. SECOND_LAYOUT_Z = 10
  873. #---------------------------------------------------------------------------
  874. # Definição da posição do sprite.
  875. #---------------------------------------------------------------------------
  876. SECOND_LAYOUT_POSITION = [0,0]
  877. #============================================================================
  878. #============================================================================
  879.  
  880. end
  881.  
  882. #============================================================================
  883. #============================================================================
  884. # * CUSTOM WINDOWS (GENERAL)
  885. #============================================================================
  886. module MOG_BATTLE_HUD_EX
  887.  
  888. #============================================================================
  889. # * Ativar Janelas Customizadas.
  890. #============================================================================
  891. ENABLE_CUSTOM_WINDOWS = true
  892.  
  893. #============================================================================
  894. # * SKILL WINDOW
  895. #============================================================================
  896. #Definição do tamanho da janela.
  897. SKILL_WINDOW_SIZE = [Graphics.width, 120]
  898. #Definição da posição da janela.
  899. SKILL_WINDOW_POSITION = [0,0]
  900. #Definição da transparência da janela.
  901. SKILL_WINDOW_OPACITY = 255
  902. #Ativar a imagem de Layout. ("Layout_Skill.png")
  903. SKILL_WINDOW_LAYOUT = false
  904. #Definição do layout.
  905. SKILL_WINDOW_LAYOUT_POSITION = [0,-33]
  906. #============================================================================
  907.  
  908. #============================================================================
  909. # * ITEM WINDOW
  910. #============================================================================
  911. #Definição do tamanho da janela.
  912. ITEM_WINDOW_SIZE = [Graphics.width, 120]
  913. #Definição da posição da janela.
  914. ITEM_WINDOW_POSITION = [0,0]
  915. #Definição da transparência da janela.
  916. ITEM_WINDOW_OPACITY = 255
  917. #Ativar a imagem de Layout. ("Layout_Item.png")
  918. ITEM_WINDOW_LAYOUT = false
  919. #Definição do layout.
  920. ITEM_WINDOW_LAYOUT_POSITION = [0,-33]
  921. #============================================================================
  922.  
  923. #============================================================================
  924. # * COMMAND WINDOW
  925. #============================================================================
  926. #Ajustar automáticamente
  927. AUTO_ADJUST_ACTOR_COMMAND = true
  928. #Definição da posição da janela. (Apenas para Ajustes)
  929. ACTOR_COMMAND_POSITION = [0,-16]
  930. #Definição da transparência da janela.
  931. ACTOR_COMMAND_OPACITY = 0
  932. #Ativar a imagem de Layout. ("Layout_Command.png")
  933. ACTOR_COMMAND_LAYOUT = true
  934. #Definição do layout.
  935. ACTOR_COMMAND_LAYOUT_POSITION = [0,0]
  936. #============================================================================
  937.  
  938. #============================================================================
  939. # * HELP WINDOW
  940. #============================================================================
  941. #Definição do tamanho da janela.
  942. HELP_WINDOW_SIZE = [Graphics.width, 72]
  943. #Definição do tamanho da janela.
  944. HELP_WINDOW_POSITION = [Graphics.width / 2, 0]
  945. #Definição da transparência da janela.
  946. HELP_WINDOW_OPACITY = 255
  947. #Ativar a imagem de Layout. ("Layout_Help.png")
  948. HELP_WINDOW_LAYOUT = false
  949. #Definição do layout.
  950. HELP_WINDOW_LAYOUT_POSITION = [0,0]
  951. #============================================================================
  952.  
  953. #============================================================================
  954. # * TARGET ACTOR WINDOW
  955. #============================================================================
  956. #Definição do tamanho da janela.
  957. ACTOR_WINDOW_SIZE = [Graphics.width, 120]
  958. #Definição do tamanho da janela.
  959. ACTOR_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  960. #Definição da transparência da janela.
  961. ACTOR_WINDOW_OPACITY = 255
  962. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  963. ACTOR_WINDOW_LAYOUT = false
  964. #Definição do layout.
  965. ACTOR_WINDOW_LAYOUT_POSITION = [0,0]
  966. #============================================================================
  967.  
  968. #============================================================================
  969. # * TARGET ENEMY WINDOW
  970. #============================================================================
  971. #Definição do tamanho da janela.
  972. ENEMY_WINDOW_SIZE = [Graphics.width, 120]
  973. #Definição do tamanho da janela.
  974. ENEMY_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
  975. #Definição da transparência da janela.
  976. ENEMY_WINDOW_OPACITY = 255
  977. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  978. ENEMY_WINDOW_LAYOUT = false
  979. #Definição do layout.
  980. ENEMY_WINDOW_LAYOUT_POSITION = [0,0]
  981. #============================================================================
  982.  
  983. #============================================================================
  984. # * PARTY WINDOW (Fight/Escape)
  985. #============================================================================
  986. #Definição do tamanho da janela.
  987. PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
  988. #Definição da transparência da janela.
  989. PARTY_COMMAND_OPACITY = 0
  990. #Ativar a imagem de Layout. ("Layout_Party.png")
  991. PARTY_COMMAND_LAYOUT = true
  992. #Definição do layout.
  993. PARTY_COMMAND_LAYOUT_POSITION = [0,0]
  994. #============================================================================
  995.  
  996. end
  997. $imported = {} if $imported.nil?
  998. $imported[:mog_battle_hud_ex] = true
  999.  
  1000. #==============================================================================
  1001. # ** SceneManager
  1002. #==============================================================================
  1003. module SceneManager
  1004.  
  1005. #--------------------------------------------------------------------------
  1006. # * Face Battler
  1007. #--------------------------------------------------------------------------
  1008. def self.face_battler?
  1009. return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
  1010. return false if $imported[:ve_animated_battle]
  1011. return false if $imported[:ve_actor_battlers]
  1012. return false if $imported["YEA-VisualBattlers"]
  1013. return false if $imported["Galv_Animated_Battlers"]
  1014. return false if $imported[:jet][:AnimatedBattlers] rescue nil
  1015. return false if $imported['KRX-AnimatedBattlers']
  1016. return true
  1017. end
  1018.  
  1019. end
  1020.  
  1021. if SceneManager.face_battler?
  1022. #==============================================================================
  1023. # ■ Game_Actor
  1024. #==============================================================================
  1025. class Game_Actor < Game_Battler
  1026.  
  1027. attr_accessor :screen_x
  1028. attr_accessor :screen_y
  1029. attr_accessor :screen_z
  1030.  
  1031.  
  1032. #--------------------------------------------------------------------------
  1033. # ● Use Sprite?
  1034. #--------------------------------------------------------------------------
  1035. def use_sprite?
  1036. return true
  1037. end
  1038.  
  1039. end
  1040. end
  1041.  
  1042. if $imported["YEA-BattleEngine"]
  1043.  
  1044. #==============================================================================
  1045. # ** Window_BattleStatusAid
  1046. #==============================================================================
  1047. class Window_BattleStatusAid < Window_BattleStatus
  1048.  
  1049. #--------------------------------------------------------------------------
  1050. # * Refresh
  1051. #--------------------------------------------------------------------------
  1052. def refresh
  1053. contents.clear
  1054. self.visible = false
  1055. end
  1056.  
  1057. end
  1058.  
  1059. #==============================================================================
  1060. # ** Window_BattleStatus
  1061. #==============================================================================
  1062. class Window_BattleStatus < Window_Selectable
  1063.  
  1064. #--------------------------------------------------------------------------
  1065. # * Update
  1066. #--------------------------------------------------------------------------
  1067. alias mog_monogatari_bhud_yf_update update
  1068. def update
  1069. mog_monogatari_bhud_yf_update
  1070. self.visible = self.active
  1071. end
  1072.  
  1073. end
  1074.  
  1075. #==============================================================================
  1076. # ** Scene Battle
  1077. #==============================================================================
  1078. class Scene_Battle < Scene_Base
  1079.  
  1080. #--------------------------------------------------------------------------
  1081. # * Update
  1082. #--------------------------------------------------------------------------
  1083. alias mog_monogatari_yf_sb_update update
  1084. def update
  1085. mog_monogatari_yf_sb_update
  1086. @actor_window.visible = @actor_window.active
  1087. @status_window.visible = stw_can_visible?
  1088. @status_window.opacity = @actor_window.opacity
  1089. end
  1090.  
  1091. #--------------------------------------------------------------------------
  1092. # * STW Can Visible
  1093. #--------------------------------------------------------------------------
  1094. def stw_can_visible?
  1095. return true if @actor_window.visible
  1096. return false
  1097. end
  1098.  
  1099. end
  1100.  
  1101. end
  1102.  
  1103. #==============================================================================
  1104. # ** Window_BattleStatus
  1105. #==============================================================================
  1106. class Window_BattleStatus < Window_Selectable
  1107. include MOG_BATTLE_HUD_EX
  1108.  
  1109. #--------------------------------------------------------------------------
  1110. # * Get Window Width
  1111. #--------------------------------------------------------------------------
  1112. def window_width
  1113. ACTOR_WINDOW_SIZE[0]
  1114. end
  1115.  
  1116. #--------------------------------------------------------------------------
  1117. # * Refresh
  1118. #--------------------------------------------------------------------------
  1119. alias mog_monogatari_refresh refresh
  1120. def refresh
  1121. mog_monogatari_refresh
  1122. self.visible = false
  1123. end
  1124.  
  1125. end
  1126.  
  1127. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1128.  
  1129. #==============================================================================
  1130. # ** Window Actor Command
  1131. #==============================================================================
  1132. class Window_ActorCommand < Window_Command
  1133.  
  1134. include MOG_BATTLE_HUD_EX
  1135.  
  1136. #--------------------------------------------------------------------------
  1137. # * Initialize
  1138. #--------------------------------------------------------------------------
  1139. alias mog_monogatari_initialize initialize
  1140. def initialize
  1141. mog_monogatari_initialize
  1142. create_layout
  1143. end
  1144.  
  1145. #--------------------------------------------------------------------------
  1146. # * Dispose
  1147. #--------------------------------------------------------------------------
  1148. alias mog_monogatari_actor_command_dispose dispose
  1149. def dispose
  1150. mog_monogatari_actor_command_dispose
  1151. dispose_layout
  1152. end
  1153.  
  1154. #--------------------------------------------------------------------------
  1155. # * Create Layout
  1156. #--------------------------------------------------------------------------
  1157. def create_layout
  1158. return if @layout != nil
  1159. return if !ACTOR_COMMAND_LAYOUT
  1160. return if $game_temp.mbhud_window[0]
  1161. $game_temp.mbhud_window[0] = true
  1162. @layout = Sprite.new
  1163. @layout.bitmap = Cache.battle_hud("Layout_Command")
  1164. @layout.z = self.z - 1
  1165. @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1166. @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1167. @layout.visible = false
  1168. end
  1169.  
  1170. #--------------------------------------------------------------------------
  1171. # * Dispose Layout
  1172. #--------------------------------------------------------------------------
  1173. def dispose_layout
  1174. return if @layout == nil
  1175. @layout.dispose
  1176. @layout = nil
  1177. end
  1178.  
  1179. #--------------------------------------------------------------------------
  1180. # * Refresh Layout
  1181. #--------------------------------------------------------------------------
  1182. def refresh_layout
  1183. return if @layout == nil
  1184. @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1185. @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1186. @layout.visible = self.active
  1187. end
  1188.  
  1189. #--------------------------------------------------------------------------
  1190. # * Select
  1191. #--------------------------------------------------------------------------
  1192. alias mog_monogatari_select_actor_command select
  1193. def select(index)
  1194. mog_monogatari_select_actor_command(index)
  1195. set_command_position
  1196. end
  1197.  
  1198. #--------------------------------------------------------------------------
  1199. # * Set Command Position
  1200. #--------------------------------------------------------------------------
  1201. def set_command_position
  1202. self.viewport = nil
  1203. self.opacity = ACTOR_COMMAND_OPACITY
  1204. if @actor != nil and $game_temp.hud_pos[@actor.id] != nil
  1205. if !AUTO_ADJUST_ACTOR_COMMAND
  1206. self.x = ACTOR_COMMAND_POSITION[0]
  1207. self.y = ACTOR_COMMAND_POSITION[1]
  1208. else
  1209. self.x = ACTOR_COMMAND_POSITION[0] + $game_temp.hud_pos[@actor.id][0] - (self.width / 2)
  1210. self.x = Graphics.width - self.width if self.x + self.width > Graphics.width
  1211. self.x = 0 if self.x < 0
  1212. self.y = ACTOR_COMMAND_POSITION[1] + $game_temp.hud_pos[@actor.id][1] - self.height
  1213. end
  1214. end
  1215. refresh_layout
  1216. end
  1217.  
  1218. #--------------------------------------------------------------------------
  1219. # * Update
  1220. #--------------------------------------------------------------------------
  1221. alias mog_monogatari_actor_commnand_update update
  1222. def update
  1223. mog_monogatari_actor_commnand_update
  1224. self.visible = self.active
  1225. if @layout.visible != nil
  1226. refresh_layout if @layout.visible != self.visible
  1227. end
  1228. end
  1229.  
  1230. end
  1231.  
  1232. #==============================================================================
  1233. # ** Window_PartyCommand
  1234. #==============================================================================
  1235. class Window_PartyCommand < Window_Command
  1236.  
  1237. include MOG_BATTLE_HUD_EX
  1238.  
  1239. #--------------------------------------------------------------------------
  1240. # * Initialize
  1241. #--------------------------------------------------------------------------
  1242. alias mog_monogatari_party_initialize initialize
  1243. def initialize
  1244. mog_monogatari_party_initialize
  1245. create_layout
  1246. end
  1247.  
  1248. #--------------------------------------------------------------------------
  1249. # * Dispose
  1250. #--------------------------------------------------------------------------
  1251. alias mog_monogatari_party_window_dispose dispose
  1252. def dispose
  1253. mog_monogatari_party_window_dispose
  1254. dispose_layout
  1255. end
  1256.  
  1257. #--------------------------------------------------------------------------
  1258. # * Create Layout
  1259. #--------------------------------------------------------------------------
  1260. def create_layout
  1261. return if @layout != nil
  1262. return if !PARTY_COMMAND_LAYOUT
  1263. return if $game_temp.mbhud_window[1]
  1264. $game_temp.mbhud_window[1] = true
  1265. @layout = Sprite.new
  1266. @layout.bitmap = Cache.battle_hud("Layout_Party")
  1267. @layout.z = self.z - 1
  1268. refresh_layout
  1269. @layout.visible = false
  1270. end
  1271.  
  1272. #--------------------------------------------------------------------------
  1273. # * Dispose Layout
  1274. #--------------------------------------------------------------------------
  1275. def dispose_layout
  1276. return if @layout == nil
  1277. @layout.dispose
  1278. @layout = nil
  1279. end
  1280.  
  1281. #--------------------------------------------------------------------------
  1282. # * Refresh Layout
  1283. #--------------------------------------------------------------------------
  1284. def refresh_layout
  1285. return if @layout == nil
  1286. @layout.x = self.x + PARTY_COMMAND_LAYOUT_POSITION[0]
  1287. @layout.y = self.y + PARTY_COMMAND_LAYOUT_POSITION[1]
  1288. @layout.visible = self.visible
  1289. end
  1290.  
  1291. #--------------------------------------------------------------------------
  1292. # * Select
  1293. #--------------------------------------------------------------------------
  1294. alias mog_monogatari_select_partycommand select
  1295. def select(index)
  1296. mog_monogatari_select_partycommand(index)
  1297. self.viewport = nil
  1298. self.x = PARTY_COMMAND_POSITION[0] - (self.width / 2)
  1299. self.y = PARTY_COMMAND_POSITION[1] - (self.height / 2)
  1300. self.opacity = PARTY_COMMAND_OPACITY
  1301. end
  1302.  
  1303. #--------------------------------------------------------------------------
  1304. # * Update
  1305. #--------------------------------------------------------------------------
  1306. alias mog_monogatari_party_window_update update
  1307. def update
  1308. mog_monogatari_party_window_update
  1309. self.visible = self.active
  1310. if @layout != nil and @layout.visible != self.visible
  1311. refresh_layout
  1312. end
  1313. end
  1314.  
  1315. end
  1316.  
  1317. #==============================================================================
  1318. # ** Window_Help
  1319. #==============================================================================
  1320. class Window_Help < Window_Base
  1321.  
  1322. include MOG_BATTLE_HUD_EX
  1323.  
  1324. #--------------------------------------------------------------------------
  1325. # * Object Initialization
  1326. #--------------------------------------------------------------------------
  1327. alias mog_monogatari_battle_help_initialize initialize
  1328. def initialize(line_number = 2)
  1329. @battle_phase = false
  1330. mog_monogatari_battle_help_initialize(line_number)
  1331. if SceneManager.scene_is?(Scene_Battle)
  1332. @battle_phase = true
  1333. self.width = HELP_WINDOW_SIZE[0]
  1334. self.height = HELP_WINDOW_SIZE[1]
  1335. @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
  1336. HELP_WINDOW_POSITION[1]]
  1337. self.x = @org_position[0]
  1338. self.y = @org_position[1]
  1339. self.opacity = HELP_WINDOW_OPACITY
  1340. create_layout
  1341. end
  1342. end
  1343.  
  1344. #--------------------------------------------------------------------------
  1345. # * Dispose
  1346. #--------------------------------------------------------------------------
  1347. alias mog_monogatari_help_window_dispose dispose
  1348. def dispose
  1349. mog_monogatari_help_window_dispose
  1350. dispose_layout
  1351. end
  1352.  
  1353. #--------------------------------------------------------------------------
  1354. # * Create Layout
  1355. #--------------------------------------------------------------------------
  1356. def create_layout
  1357. return if @layout != nil
  1358. return if !HELP_WINDOW_LAYOUT
  1359. return if $game_temp.mbhud_window[2]
  1360. return if !SceneManager.scene_is?(Scene_Battle)
  1361. $game_temp.mbhud_window[2] = true
  1362. @layout = Sprite.new
  1363. @layout.bitmap = Cache.battle_hud("Layout_Help")
  1364. @layout.z = self.z - 1
  1365. refresh_layout
  1366. @layout.visible = false
  1367. end
  1368.  
  1369. #--------------------------------------------------------------------------
  1370. # * Dispose Layout
  1371. #--------------------------------------------------------------------------
  1372. def dispose_layout
  1373. return if @layout == nil
  1374. @layout.dispose
  1375. @layout = nil
  1376. end
  1377.  
  1378. #--------------------------------------------------------------------------
  1379. # * Refresh Layout
  1380. #--------------------------------------------------------------------------
  1381. def refresh_layout
  1382. return if @layout == nil
  1383. @layout.x = self.x + HELP_WINDOW_LAYOUT_POSITION[0]
  1384. @layout.y = self.y + HELP_WINDOW_LAYOUT_POSITION[1]
  1385. @layout.visible = self.visible
  1386. end
  1387.  
  1388. #--------------------------------------------------------------------------
  1389. # * Refresh
  1390. #--------------------------------------------------------------------------
  1391. alias mog_monogatari_battle_help_refresh refresh
  1392. def refresh
  1393. mog_monogatari_battle_help_refresh
  1394. if @battle_phase
  1395. self.x = @org_position[0]
  1396. self.y = @org_position[1]
  1397. self.opacity = HELP_WINDOW_OPACITY
  1398. end
  1399. end
  1400.  
  1401. #--------------------------------------------------------------------------
  1402. # * Update
  1403. #--------------------------------------------------------------------------
  1404. alias mog_monogatari_help_window_update update
  1405. def update
  1406. mog_monogatari_help_window_update
  1407. if @layout != nil
  1408. refresh_layout if @layout.visible != self.visible
  1409. @layout.visible = self.visible
  1410. end
  1411. end
  1412.  
  1413. end
  1414.  
  1415. #==============================================================================
  1416. # ** Window_BattleActor
  1417. #==============================================================================
  1418. class Window_BattleActor < Window_BattleStatus
  1419.  
  1420. include MOG_BATTLE_HUD_EX
  1421.  
  1422. #--------------------------------------------------------------------------
  1423. # * Initialize
  1424. #--------------------------------------------------------------------------
  1425. alias mog_monogatari_battle_actor_initialize initialize
  1426. def initialize(info_viewport)
  1427. mog_monogatari_battle_actor_initialize(info_viewport)
  1428. self.width = ACTOR_WINDOW_SIZE[0]
  1429. self.height = ACTOR_WINDOW_SIZE[1]
  1430. @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
  1431. ACTOR_WINDOW_POSITION[1] - self.height]
  1432. self.x = @org_position[0]
  1433. self.y = @org_position[1]
  1434. self.opacity = ACTOR_WINDOW_OPACITY
  1435. self.z += 1
  1436. self.viewport = nil
  1437. create_layout
  1438. end
  1439.  
  1440. #--------------------------------------------------------------------------
  1441. # * Dispose
  1442. #--------------------------------------------------------------------------
  1443. alias mog_monogatari_actor_window_dispose dispose
  1444. def dispose
  1445. mog_monogatari_actor_window_dispose
  1446. dispose_layout
  1447. end
  1448.  
  1449. #--------------------------------------------------------------------------
  1450. # * Create Layout
  1451. #--------------------------------------------------------------------------
  1452. def create_layout
  1453. return if @layout != nil
  1454. return if !ACTOR_WINDOW_LAYOUT
  1455. return if $game_temp.mbhud_window[3]
  1456. $game_temp.mbhud_window[3] = true
  1457. @layout = Sprite.new
  1458. @layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
  1459. @layout.z = self.z - 1
  1460. refresh_layout
  1461. @layout.visible = false
  1462. end
  1463.  
  1464. #--------------------------------------------------------------------------
  1465. # * Dispose Layout
  1466. #--------------------------------------------------------------------------
  1467. def dispose_layout
  1468. return if @layout == nil
  1469. @layout.dispose
  1470. @layout = nil
  1471. end
  1472.  
  1473. #--------------------------------------------------------------------------
  1474. # * Refresh Layout
  1475. #--------------------------------------------------------------------------
  1476. def refresh_layout
  1477. return if @layout == nil
  1478. @layout.x = self.x + ACTOR_WINDOW_LAYOUT_POSITION[0]
  1479. @layout.y = self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]
  1480. @layout.visible = self.visible
  1481. end
  1482.  
  1483. #--------------------------------------------------------------------------
  1484. # * Select
  1485. #--------------------------------------------------------------------------
  1486. alias mog_monogatari_select_actor select
  1487. def select(index)
  1488. mog_monogatari_select_actor(index)
  1489. self.viewport = nil
  1490. self.visible = true
  1491. self.x = @org_position[0]
  1492. self.y = @org_position[1]
  1493. self.opacity = ACTOR_WINDOW_OPACITY
  1494. end
  1495.  
  1496. #--------------------------------------------------------------------------
  1497. # * Update
  1498. #--------------------------------------------------------------------------
  1499. alias mog_monogatari_actor_window_update update
  1500. def update
  1501. mog_monogatari_actor_window_update
  1502. self.visible = self.active
  1503. if @layout != nil
  1504. refresh_layout if @layout.visible != self.visible
  1505. end
  1506. end
  1507.  
  1508. end
  1509.  
  1510. #==============================================================================
  1511. # ** Window_BattleEnemy
  1512. #==============================================================================
  1513. class Window_BattleEnemy < Window_Selectable
  1514.  
  1515. include MOG_BATTLE_HUD_EX
  1516.  
  1517. #--------------------------------------------------------------------------
  1518. # * Initialize
  1519. #--------------------------------------------------------------------------
  1520. alias mog_monogatari_battle_enemy_initialize initialize
  1521. def initialize(info_viewport)
  1522. mog_monogatari_battle_enemy_initialize(info_viewport)
  1523. self.width = ENEMY_WINDOW_SIZE[0]
  1524. self.height = ENEMY_WINDOW_SIZE[1]
  1525. @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
  1526. ENEMY_WINDOW_POSITION[1] - self.height]
  1527. self.x = @org_position[0]
  1528. self.y = @org_position[1]
  1529. self.opacity = ENEMY_WINDOW_OPACITY
  1530. self.z += 1
  1531. create_layout
  1532. end
  1533.  
  1534. #--------------------------------------------------------------------------
  1535. # * Dispose
  1536. #--------------------------------------------------------------------------
  1537. alias mog_monogatari_enemy_window_dispose dispose
  1538. def dispose
  1539. mog_monogatari_enemy_window_dispose
  1540. dispose_layout
  1541. end
  1542.  
  1543. #--------------------------------------------------------------------------
  1544. # * Create Layout
  1545. #--------------------------------------------------------------------------
  1546. def create_layout
  1547. return if @layout != nil
  1548. return if !ENEMY_WINDOW_LAYOUT
  1549. return if $game_temp.mbhud_window[4]
  1550. $game_temp.mbhud_window[4] = true
  1551. @layout = Sprite.new
  1552. @layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
  1553. @layout.z = self.z - 1
  1554. refresh_layout
  1555. @layout.visible = false
  1556. end
  1557.  
  1558. #--------------------------------------------------------------------------
  1559. # * Dispose Layout
  1560. #--------------------------------------------------------------------------
  1561. def dispose_layout
  1562. return if @layout == nil
  1563. @layout.dispose
  1564. @layout = nil
  1565. end
  1566.  
  1567. #--------------------------------------------------------------------------
  1568. # * Refresh Layout
  1569. #--------------------------------------------------------------------------
  1570. def refresh_layout
  1571. return if @layout == nil
  1572. @layout.x = self.x + ENEMY_WINDOW_LAYOUT_POSITION[0]
  1573. @layout.y = self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]
  1574. @layout.visible = self.visible
  1575. end
  1576.  
  1577. #--------------------------------------------------------------------------
  1578. # * Select
  1579. #--------------------------------------------------------------------------
  1580. alias mog_monogatari_select_enemy select
  1581. def select(index)
  1582. mog_monogatari_select_enemy(index)
  1583. self.viewport = nil
  1584. self.visible = true
  1585. self.x = @org_position[0]
  1586. self.y = @org_position[1]
  1587. self.opacity = ENEMY_WINDOW_OPACITY
  1588. end
  1589.  
  1590. #--------------------------------------------------------------------------
  1591. # * Update
  1592. #--------------------------------------------------------------------------
  1593. alias mog_monogatari_enemy_window_update update
  1594. def update
  1595. mog_monogatari_enemy_window_update
  1596. if @layout != nil and @layout.visible != self.visible
  1597. refresh_layout
  1598. end
  1599. end
  1600.  
  1601. if $imported["YEA-BattleEngine"]
  1602. #--------------------------------------------------------------------------
  1603. # * Draw Item
  1604. #--------------------------------------------------------------------------
  1605. def draw_item(index)
  1606. change_color(normal_color)
  1607. name = $game_troop.alive_members[index].name
  1608. draw_text(item_rect_for_text(index), name)
  1609. end
  1610. end
  1611.  
  1612. end
  1613.  
  1614. #==============================================================================
  1615. # ** Window_BattleSkill
  1616. #==============================================================================
  1617. class Window_BattleSkill < Window_SkillList
  1618. include MOG_BATTLE_HUD_EX
  1619.  
  1620. #--------------------------------------------------------------------------
  1621. # * Initialize
  1622. #--------------------------------------------------------------------------
  1623. alias mog_monogatari_battle_skill_initialize initialize
  1624. def initialize(help_window, info_viewport)
  1625. mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  1626. self.width = SKILL_WINDOW_SIZE[0]
  1627. self.height = SKILL_WINDOW_SIZE[1]
  1628. @org_position = [SKILL_WINDOW_POSITION[0],
  1629. Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  1630. self.x = @org_position[0]
  1631. self.y = @org_position[1]
  1632. self.opacity = SKILL_WINDOW_OPACITY
  1633. self.viewport = nil
  1634. create_layout
  1635. end
  1636.  
  1637. #--------------------------------------------------------------------------
  1638. # * Dispose
  1639. #--------------------------------------------------------------------------
  1640. alias mog_monogatari_skill_window_dispose dispose
  1641. def dispose
  1642. mog_monogatari_skill_window_dispose
  1643. dispose_layout
  1644. end
  1645.  
  1646. #--------------------------------------------------------------------------
  1647. # * Create Layout
  1648. #--------------------------------------------------------------------------
  1649. def create_layout
  1650. return if @layout != nil
  1651. return if !SKILL_WINDOW_LAYOUT
  1652. return if $game_temp.mbhud_window[5]
  1653. $game_temp.mbhud_window[5] = true
  1654. @layout = Sprite.new
  1655. @layout.bitmap = Cache.battle_hud("Layout_Skill")
  1656. @layout.z = self.z - 1
  1657. refresh_layout
  1658. @layout.visible = false
  1659. end
  1660.  
  1661. #--------------------------------------------------------------------------
  1662. # * Dispose Layout
  1663. #--------------------------------------------------------------------------
  1664. def dispose_layout
  1665. return if @layout == nil
  1666. @layout.dispose
  1667. @layout = nil
  1668. end
  1669.  
  1670. #--------------------------------------------------------------------------
  1671. # * Refresh Layout
  1672. #--------------------------------------------------------------------------
  1673. def refresh_layout
  1674. return if @layout == nil
  1675. @layout.x = self.x + SKILL_WINDOW_LAYOUT_POSITION[0]
  1676. @layout.y = self.y + SKILL_WINDOW_LAYOUT_POSITION[1]
  1677. @layout.visible = self.visible
  1678. end
  1679.  
  1680. #--------------------------------------------------------------------------
  1681. # * Select
  1682. #--------------------------------------------------------------------------
  1683. alias mog_monogatari_select_battle_skill select
  1684. def select(index)
  1685. mog_monogatari_select_battle_skill(index)
  1686. self.x = @org_position[0]
  1687. self.y = @org_position[1]
  1688. self.opacity = SKILL_WINDOW_OPACITY
  1689. end
  1690.  
  1691. #--------------------------------------------------------------------------
  1692. # * Update
  1693. #--------------------------------------------------------------------------
  1694. alias mog_monogatari_skill_window_update update
  1695. def update
  1696. mog_monogatari_skill_window_update
  1697. if @layout != nil and @layout.visible != self.visible
  1698. refresh_layout
  1699. end
  1700. end
  1701.  
  1702. end
  1703.  
  1704. #==============================================================================
  1705. # ** Window_BattleItem
  1706. #==============================================================================
  1707. class Window_BattleItem < Window_ItemList
  1708. include MOG_BATTLE_HUD_EX
  1709.  
  1710. #--------------------------------------------------------------------------
  1711. # * Initialize
  1712. #--------------------------------------------------------------------------
  1713. alias mog_monogatari_battle_item_initialize initialize
  1714. def initialize(help_window, info_viewport)
  1715. mog_monogatari_battle_item_initialize(help_window, info_viewport)
  1716. self.width = ITEM_WINDOW_SIZE[0]
  1717. self.height = ITEM_WINDOW_SIZE[1]
  1718. @org_position = [ITEM_WINDOW_POSITION[0],
  1719. Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  1720. self.x = @org_position[0]
  1721. self.y = @org_position[1]
  1722. self.viewport = nil
  1723. self.opacity = ITEM_WINDOW_OPACITY
  1724. create_layout
  1725. end
  1726.  
  1727. #--------------------------------------------------------------------------
  1728. # * Dispose
  1729. #--------------------------------------------------------------------------
  1730. alias mog_monogatari_item_window_dispose dispose
  1731. def dispose
  1732. mog_monogatari_item_window_dispose
  1733. dispose_layout
  1734. end
  1735.  
  1736. #--------------------------------------------------------------------------
  1737. # * Create Layout
  1738. #--------------------------------------------------------------------------
  1739. def create_layout
  1740. return if @layout != nil
  1741. return if !ITEM_WINDOW_LAYOUT
  1742. return if $game_temp.mbhud_window[6]
  1743. $game_temp.mbhud_window[6] = true
  1744. @layout = Sprite.new
  1745. @layout.bitmap = Cache.battle_hud("Layout_Item")
  1746. @layout.z = self.z - 1
  1747. refresh_layout
  1748. @layout.visible = false
  1749. end
  1750.  
  1751. #--------------------------------------------------------------------------
  1752. # * Dispose Layout
  1753. #--------------------------------------------------------------------------
  1754. def dispose_layout
  1755. return if @layout == nil
  1756. @layout.dispose
  1757. @layout = nil
  1758. end
  1759.  
  1760. #--------------------------------------------------------------------------
  1761. # * Refresh Layout
  1762. #--------------------------------------------------------------------------
  1763. def refresh_layout
  1764. return if @layout == nil
  1765. @layout.x = self.x + ITEM_WINDOW_LAYOUT_POSITION[0]
  1766. @layout.y = self.y + ITEM_WINDOW_LAYOUT_POSITION[1]
  1767. @layout.visible = self.visible
  1768. end
  1769.  
  1770. #--------------------------------------------------------------------------
  1771. # * Select
  1772. #--------------------------------------------------------------------------
  1773. alias mog_monogatari_select_battle_item select
  1774. def select(index)
  1775. mog_monogatari_select_battle_item(index)
  1776. self.x = @org_position[0]
  1777. self.y = @org_position[1]
  1778. self.opacity = ITEM_WINDOW_OPACITY
  1779. end
  1780.  
  1781. #--------------------------------------------------------------------------
  1782. # * Update
  1783. #--------------------------------------------------------------------------
  1784. alias mog_monogatari_item_window_update update
  1785. def update
  1786. mog_monogatari_item_window_update
  1787. if @layout != nil
  1788. refresh_layout if @layout.visible != self.visible
  1789. end
  1790. end
  1791.  
  1792. end
  1793.  
  1794. end
  1795.  
  1796. #==============================================================================
  1797. # ** Game Actor
  1798. #==============================================================================
  1799. class Game_Actor < Game_Battler
  1800. attr_accessor :face_animation
  1801.  
  1802. #--------------------------------------------------------------------------
  1803. # * Setup
  1804. #--------------------------------------------------------------------------
  1805. alias mog_monogatari_face_animation setup
  1806. def setup(actor_id)
  1807. mog_monogatari_face_animation(actor_id)
  1808. @face_animation = [0,0,0]
  1809. end
  1810.  
  1811. end
  1812.  
  1813. #==============================================================================
  1814. # ** Game Temp
  1815. #==============================================================================
  1816. class Game_Temp
  1817.  
  1818. attr_accessor :battler_face_pos
  1819. attr_accessor :hud_pos
  1820. attr_accessor :mbhud_force_refresh
  1821. attr_accessor :mbhud_window
  1822.  
  1823. #--------------------------------------------------------------------------
  1824. # * Initialize
  1825. #--------------------------------------------------------------------------
  1826. alias mog_monogatari_bhud_initialize initialize
  1827. def initialize
  1828. #Graphics.resize_screen(640,480)
  1829. @battler_face_pos = []
  1830. @hud_pos = []
  1831. @mbhud_force_refresh = false
  1832. @mbhud_window = [false,false,false,false,false,false,false]
  1833. mog_monogatari_bhud_initialize
  1834. end
  1835.  
  1836. #--------------------------------------------------------------------------
  1837. # * Check Screen Xyz
  1838. #--------------------------------------------------------------------------
  1839. def check_screen_xyz_nil
  1840. return if !SceneManager.face_battler?
  1841. for actor in $game_party.battle_members
  1842. actor.screen_x = 0 if actor.screen_x == nil
  1843. actor.screen_y = 0 if actor.screen_y == nil
  1844. actor.screen_z = 0 if actor.screen_z == nil
  1845. end
  1846. end
  1847.  
  1848. end
  1849.  
  1850. #==============================================================================
  1851. # ** Game Interpreter
  1852. #==============================================================================
  1853. class Game_Interpreter
  1854.  
  1855. #--------------------------------------------------------------------------
  1856. # * Command_129
  1857. #--------------------------------------------------------------------------
  1858. alias mog_monogatari_bhud_command_129 command_129
  1859. def command_129
  1860. mog_monogatari_bhud_command_129
  1861. $game_temp.check_screen_xyz_nil rescue nil
  1862. $game_temp.mbhud_force_refresh = true if SceneManager.scene_is?(Scene_Battle)
  1863. end
  1864.  
  1865. end
  1866.  
  1867. #==============================================================================
  1868. # ** Cache
  1869. #==============================================================================
  1870. module Cache
  1871.  
  1872. #--------------------------------------------------------------------------
  1873. # * Hud
  1874. #--------------------------------------------------------------------------
  1875. def self.battle_hud(filename)
  1876. load_bitmap("Graphics/Huds/Battle/", filename)
  1877. end
  1878.  
  1879. end
  1880.  
  1881. #==============================================================================
  1882. # ** Game Actor
  1883. #==============================================================================
  1884. class Game_Actor < Game_Battler
  1885.  
  1886. #--------------------------------------------------------------------------
  1887. # ● Real Next Level
  1888. #--------------------------------------------------------------------------
  1889. def real_next_level
  1890. next_level_exp - exp_for_level(level)
  1891. end
  1892.  
  1893. #--------------------------------------------------------------------------
  1894. # ● Remain Exp
  1895. #--------------------------------------------------------------------------
  1896. def remain_exp
  1897. exp - exp_for_level(level)
  1898. end
  1899.  
  1900. #--------------------------------------------------------------------------
  1901. # ● Gain Exp Test
  1902. #--------------------------------------------------------------------------
  1903. def gain_exp_test
  1904. exp_r = rand(next_level_exp)
  1905. change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1906. end
  1907.  
  1908. #--------------------------------------------------------------------------
  1909. # ● Low HP?
  1910. #--------------------------------------------------------------------------
  1911. def low_hp?
  1912. hp <= (mhp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1913. end
  1914.  
  1915. #--------------------------------------------------------------------------
  1916. # ● Low MP?
  1917. #--------------------------------------------------------------------------
  1918. def low_mp?
  1919. mp <= (mmp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1920. end
  1921.  
  1922. #--------------------------------------------------------------------------
  1923. # ● Low TP?
  1924. #--------------------------------------------------------------------------
  1925. def low_tp?
  1926. tp <= (max_tp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1927. end
  1928.  
  1929. end
  1930.  
  1931. #==============================================================================
  1932. # ** Spriteset_Battle
  1933. #==============================================================================
  1934. class Spriteset_Battle
  1935.  
  1936. #--------------------------------------------------------------------------
  1937. # * Initialize
  1938. #--------------------------------------------------------------------------
  1939. alias mog_battle_hud_ex_initialize initialize
  1940. def initialize
  1941. check_screen_xyz_nil rescue nil
  1942. mog_battle_hud_ex_initialize
  1943. create_battle_hud_ex
  1944. end
  1945.  
  1946. #--------------------------------------------------------------------------
  1947. # * Check Screen Xyz
  1948. #--------------------------------------------------------------------------
  1949. def check_screen_xyz_nil
  1950. return if !SceneManager.face_battler?
  1951. for actor in $game_party.battle_members
  1952. actor.screen_x = 0 if actor.screen_x == nil
  1953. actor.screen_y = 0 if actor.screen_y == nil
  1954. actor.screen_z = 0 if actor.screen_z == nil
  1955. end
  1956. end
  1957.  
  1958. #--------------------------------------------------------------------------
  1959. # * Check Screen Xyz after
  1960. #--------------------------------------------------------------------------
  1961. def check_screen_xyz_after
  1962. return if !SceneManager.face_battler?
  1963. index = 0
  1964. for actor in $game_party.battle_members
  1965. actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  1966. actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  1967. actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  1968. index += 1
  1969. end
  1970. end
  1971.  
  1972. #--------------------------------------------------------------------------
  1973. # * Dispose
  1974. #--------------------------------------------------------------------------
  1975. alias mog_battle_hud_ex_dispose dispose
  1976. def dispose
  1977. dispose_battle_hud_ex
  1978. mog_battle_hud_ex_dispose
  1979. end
  1980.  
  1981. #--------------------------------------------------------------------------
  1982. # * Update
  1983. #--------------------------------------------------------------------------
  1984. alias mog_battle_hud_ex_update update
  1985. def update
  1986. mog_battle_hud_ex_update
  1987. update_battle_hud_ex
  1988. end
  1989.  
  1990. #--------------------------------------------------------------------------
  1991. # * Create Battle Hud EX
  1992. #--------------------------------------------------------------------------
  1993. def create_battle_hud_ex
  1994. return if @battle_hud_ex != nil
  1995. @battle_hud_ex = Monogatari_Bhud.new(@viewport1)
  1996. check_screen_xyz_after
  1997. end
  1998.  
  1999. #--------------------------------------------------------------------------
  2000. # * Dispose Battle Hud EX
  2001. #--------------------------------------------------------------------------
  2002. def dispose_battle_hud_ex
  2003. return if @battle_hud_ex == nil
  2004. @battle_hud_ex.dispose
  2005. @battle_hud_ex = nil
  2006. $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  2007. end
  2008.  
  2009. #--------------------------------------------------------------------------
  2010. # * Update Battle Hud EX
  2011. #--------------------------------------------------------------------------
  2012. def update_battle_hud_ex
  2013. refresh_battle_hud if $game_temp.mbhud_force_refresh
  2014. return if @battle_hud_ex == nil
  2015. @battle_hud_ex.update
  2016. end
  2017.  
  2018. #--------------------------------------------------------------------------
  2019. # * Refresh Battle Hud
  2020. #--------------------------------------------------------------------------
  2021. def refresh_battle_hud
  2022. $game_temp.mbhud_force_refresh = false
  2023. check_screen_xyz_nil rescue nil
  2024. dispose_battle_hud_ex
  2025. create_battle_hud_ex
  2026. end
  2027.  
  2028. end
  2029.  
  2030. #==============================================================================
  2031. # ** Monogatari Bhud
  2032. #==============================================================================
  2033. class Monogatari_Bhud
  2034.  
  2035. #--------------------------------------------------------------------------
  2036. # * Initialize
  2037. #--------------------------------------------------------------------------
  2038. def initialize(viewport)
  2039. @pre_message_position = $game_message.position
  2040. $game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
  2041. @battle_hud = []
  2042. index = 0
  2043. for actor in $game_party.battle_members
  2044. @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,viewport))
  2045. index += 1
  2046. end
  2047. end
  2048.  
  2049. #--------------------------------------------------------------------------
  2050. # * Max members
  2051. #--------------------------------------------------------------------------
  2052. def max_members
  2053. if $game_party.members.size > $game_party.max_battle_members
  2054. return $game_party.max_battle_members
  2055. end
  2056. return $game_party.members.size
  2057. end
  2058.  
  2059. #--------------------------------------------------------------------------
  2060. # * Dispose
  2061. #--------------------------------------------------------------------------
  2062. def dispose
  2063. @battle_hud.each {|sprite| sprite.dispose }
  2064. $game_message.position = @pre_message_position
  2065. end
  2066.  
  2067. #--------------------------------------------------------------------------
  2068. # * Update
  2069. #--------------------------------------------------------------------------
  2070. def update
  2071. @battle_hud.each {|sprite| sprite.update }
  2072. end
  2073.  
  2074. end
  2075.  
  2076. #==============================================================================
  2077. #==============================================================================
  2078. # ** Battle Hud EX
  2079. #==============================================================================
  2080. #==============================================================================
  2081. class Battle_Hud_EX
  2082. include MOG_BATTLE_HUD_EX
  2083.  
  2084. #--------------------------------------------------------------------------
  2085. # * Initialize
  2086. #--------------------------------------------------------------------------
  2087. def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  2088. pre_cache
  2089. setup(actor,index,max_members)
  2090. create_sprites(viewport)
  2091. end
  2092.  
  2093. #--------------------------------------------------------------------------
  2094. # * Setup
  2095. #--------------------------------------------------------------------------
  2096. def setup(actor,index,max_members)
  2097. @actor = actor
  2098. @actor_index = index
  2099. @max_members = max_members
  2100. @actor.face_animation = [0,0,0]
  2101. @hp_icon_max = -1
  2102. @hp_icon_old = -1
  2103. @hp_icon_col_max = HP_ICON_COL_MAX
  2104. @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  2105. @hp_icon_row_max = HP_ICON_ROW_MAX
  2106. @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  2107. @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  2108. @mp_icon_max = -1
  2109. @mp_icon_old = -1
  2110. @mp_icon_col_max = MP_ICON_COL_MAX
  2111. @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  2112. @mp_icon_row_max = MP_ICON_ROW_MAX
  2113. @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  2114. @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  2115. @tp_icon_max = -1
  2116. @tp_icon_old = -1
  2117. @tp_icon_col_max = TP_ICON_COL_MAX
  2118. @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  2119. @tp_icon_row_max = TP_ICON_ROW_MAX
  2120. @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  2121. @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  2122. setup_actor
  2123. setup_position
  2124. end
  2125.  
  2126. #--------------------------------------------------------------------------
  2127. # * Setup Actor
  2128. #--------------------------------------------------------------------------
  2129. def setup_actor
  2130. return if @actor == nil
  2131. @hp_number_refresh = true
  2132. @hp_number2_refresh = true
  2133. @hp_number_old = @actor.hp
  2134. @hp_number2_old = @actor.mhp
  2135. @hp_old_meter = 0
  2136. @mp_number_refresh = true
  2137. @mp_number2_refresh = true
  2138. @mp_number_old = @actor.mp
  2139. @mp_number2_old = @actor.mmp
  2140. @mp_old_meter = 0
  2141. @tp_number_refresh = true
  2142. @tp_number2_refresh = true
  2143. @tp_number_old = @actor.tp
  2144. @tp_number2_old = @actor.max_tp
  2145. @tp_old_meter = 0
  2146. @at_number_refresh = true
  2147. @at_number2_refresh = true
  2148. @at_number_old = actor_at
  2149. @at_number2_old = actor_max_at
  2150. @at_old_meter = 0
  2151. end
  2152.  
  2153. #--------------------------------------------------------------------------
  2154. # * Terminate
  2155. #--------------------------------------------------------------------------
  2156. def terminate
  2157. if $imported[:ve_active_time_battle]
  2158. @actor.atb = 0 rescue nil
  2159. end
  2160. end
  2161.  
  2162. #--------------------------------------------------------------------------
  2163. # * AT
  2164. #--------------------------------------------------------------------------
  2165. def actor_at
  2166. return @actor.at if $imported[:mog_atb_system]
  2167. return @actor.atb if $imported[:ve_active_time_battle]
  2168. return 0
  2169. end
  2170.  
  2171. #--------------------------------------------------------------------------
  2172. # * Max AT
  2173. #--------------------------------------------------------------------------
  2174. def actor_max_at
  2175. return $game_system.at_max if $imported[:mog_atb_system]
  2176. return @actor.max_atb if $imported[:ve_active_time_battle]
  2177. return 1
  2178. end
  2179.  
  2180. #--------------------------------------------------------------------------
  2181. # ● Actor Cast
  2182. #--------------------------------------------------------------------------
  2183. def actor_cast
  2184. return @actor.at_cast[1] if $imported[:mog_atb_system]
  2185. return @actor.atb if $imported[:ve_active_time_battle]
  2186. return 0
  2187. end
  2188.  
  2189. #--------------------------------------------------------------------------
  2190. # ● Actor Max Cast
  2191. #--------------------------------------------------------------------------
  2192. def actor_max_cast
  2193. return @actor.at_cast[0].speed.abs if $imported[:mog_atb_system]
  2194. return @actor.max_atb if $imported[:ve_active_time_battle]
  2195. return 1
  2196. end
  2197.  
  2198. #--------------------------------------------------------------------------
  2199. # ● Actor Cast?
  2200. #--------------------------------------------------------------------------
  2201. def actor_cast?
  2202. if $imported[:mog_atb_system]
  2203. return true if [email protected]_cast.empty?
  2204. end
  2205. if $imported[:ve_active_time_battle]
  2206. return true if @actor.cast_action?
  2207. end
  2208. return false
  2209. end
  2210.  
  2211. #--------------------------------------------------------------------------
  2212. # * Create Sprites
  2213. #--------------------------------------------------------------------------
  2214. def create_sprites(viewport)
  2215. dispose
  2216. return if @actor == nil
  2217. create_layout(viewport)
  2218. create_layout_2(viewport)
  2219. create_name(viewport)
  2220. create_face(viewport)
  2221. create_hp_number(viewport)
  2222. create_hp_number_max(viewport)
  2223. create_hp_meter(viewport)
  2224. create_hp_icon(viewport)
  2225. create_hp_icon_ex(viewport)
  2226. create_hp_icon_number(viewport)
  2227. create_mp_number(viewport)
  2228. create_mp_number_max(viewport)
  2229. create_mp_meter(viewport)
  2230. create_mp_icon(viewport)
  2231. create_mp_icon_ex(viewport)
  2232. create_mp_icon_number(viewport)
  2233. create_tp_number(viewport)
  2234. create_tp_number_max(viewport)
  2235. create_tp_meter(viewport)
  2236. create_tp_icon(viewport)
  2237. create_tp_icon_ex(viewport)
  2238. create_tp_icon_number(viewport)
  2239. create_at_number(viewport)
  2240. create_at_number_max(viewport)
  2241. create_at_meter(viewport)
  2242. create_level_number(viewport)
  2243. create_states(viewport)
  2244. update
  2245. end
  2246.  
  2247. end
  2248.  
  2249. #==============================================================================
  2250. #==============================================================================
  2251. # ** Battle Hud EX
  2252. #==============================================================================
  2253. #==============================================================================
  2254. class Battle_Hud_EX
  2255.  
  2256. #--------------------------------------------------------------------------
  2257. # * Setup Position
  2258. #--------------------------------------------------------------------------
  2259. def setup_position
  2260. sprite_width = (Graphics.width - 64 ) / $game_party.max_battle_members
  2261. sprite_center = sprite_width / 2
  2262. space_x = MEMBERS_SPACE[0]
  2263. space_y = MEMBERS_SPACE[1]
  2264. center = Graphics.width / 2
  2265. members_space = (Graphics.width + space_x) / @max_members
  2266. members_space2 = (members_space * @actor_index)
  2267. members_space3 = ((members_space / 2) * (@max_members - 1))
  2268. members_space_y = space_y * @actor_index
  2269. x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  2270. screen_resize_y = 0
  2271. screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  2272. y = HUD_POSITION[1] + members_space_y + screen_resize_y
  2273. @hud_position = [x,y]
  2274. x2 = x + sprite_center
  2275. $game_temp.hud_pos[@actor.id] = [] if $game_temp.hud_pos[@actor.id] == nil
  2276. $game_temp.hud_pos[@actor.id] = [x2,y]
  2277. if FIXED_POSITION[@actor_index] != nil
  2278. @hud_position = [FIXED_POSITION[@actor_index][0],FIXED_POSITION[@actor_index][1]]
  2279. $game_temp.hud_pos[@actor.id] = [] if $game_temp.hud_pos[@actor.id] == nil
  2280. x = FIXED_COMMAND_POSITION[0]
  2281. y = FIXED_COMMAND_POSITION[1]
  2282. $game_temp.hud_pos[@actor.id] = [x,y]
  2283. end
  2284. end
  2285.  
  2286. end
  2287.  
  2288. #==============================================================================
  2289. # ** Battle Hud EX
  2290. #==============================================================================
  2291. class Game_Temp
  2292.  
  2293. attr_accessor :cache_bhud_sprites
  2294.  
  2295. #--------------------------------------------------------------------------
  2296. # * Cache Battle Hud
  2297. #--------------------------------------------------------------------------
  2298. def cache_battle_hud
  2299. execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  2300. end
  2301.  
  2302. #--------------------------------------------------------------------------
  2303. # * Execute Cache Bhud Sprites
  2304. #--------------------------------------------------------------------------
  2305. def execute_cache_bhud_sprites
  2306. @cache_bhud_sprites = []
  2307. windows = ["Layout_Command","Layout_Party","Layout_Help",
  2308. "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  2309. "Layout_Item"]
  2310. for s in windows
  2311. @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  2312. end
  2313. sprites = ["Layout","Layout_2",
  2314. "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  2315. "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",
  2316. "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",
  2317. "LV_Number","Iconset"
  2318. ]
  2319. for s in sprites
  2320. @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  2321. end
  2322. end
  2323.  
  2324. end
  2325.  
  2326. #==============================================================================
  2327. # ** Spriteset_Map
  2328. #==============================================================================
  2329. class Spriteset_Map
  2330.  
  2331. #--------------------------------------------------------------------------
  2332. # * Initialize
  2333. #--------------------------------------------------------------------------
  2334. alias mog_monogatari_bhud_initialize initialize
  2335. def initialize
  2336. $game_temp.cache_battle_hud
  2337. mog_monogatari_bhud_initialize
  2338. end
  2339.  
  2340. end
  2341.  
  2342. #==============================================================================
  2343. #==============================================================================
  2344. # ** Battle Hud EX
  2345. #==============================================================================
  2346. #==============================================================================
  2347. class Battle_Hud_EX
  2348.  
  2349. #--------------------------------------------------------------------------
  2350. # * Pre Cache
  2351. #--------------------------------------------------------------------------
  2352. def pre_cache
  2353. $game_temp.cache_battle_hud
  2354. @force_hide = false
  2355. @force_hide_time = 0
  2356. @fade_hud = false
  2357. @fade_hud_gold = false
  2358. @fade_hud_equip = false
  2359. @layout_image = Cache.battle_hud("Layout")
  2360. @layout_cw = @layout_image.width
  2361. @layout_ch = @layout_image.height
  2362. @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  2363. @layout2_cw = @layout2_image.width if @layout2_image != nil
  2364. @layout2_ch = @layout2_image.height if @layout2_image != nil
  2365. @layout2_cw = 0 if @layout2_cw == nil
  2366. #------------------------------------------------
  2367. # HP
  2368. #------------------------------------------------
  2369. if HP_NUMBER_VISIBLE
  2370. @hp_number_image = Cache.battle_hud("HP_Number")
  2371. @hp_number_cw = @hp_number_image.width / 10
  2372. if HP_NUMBER_LOW_COLOR
  2373. @hp_number_ch = @hp_number_image.height / 2
  2374. else
  2375. @hp_number_ch = @hp_number_image.height
  2376. end
  2377. @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  2378. @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number
  2379. end
  2380. if HP_NUMBER_MAX_VISIBLE
  2381. @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  2382. @hp_number2_cw = @hp_number2_image.width / 10
  2383. @hp_number2_ch = @hp_number2_image.height
  2384. end
  2385. if HP_METER_VISIBLE
  2386. @hp_meter_image = Cache.battle_hud("HP_Meter")
  2387. if HP_METER_GRADIENT_ANIMATION
  2388. @hp_meter_cw = @hp_meter_image.width / 3
  2389. else
  2390. @hp_meter_cw = @hp_meter_image.width
  2391. end
  2392. if HP_METER_REDUCTION_ANIMATION
  2393. @hp_meter_ch = @hp_meter_image.height / 2
  2394. else
  2395. @hp_meter_ch = @hp_meter_image.height
  2396. end
  2397. end
  2398. if HP_ICON_VISIBLE
  2399. @hp_icon_image = Cache.battle_hud("HP_Icon")
  2400. @hp_icon_cw = @hp_icon_image.width / 2
  2401. @hp_icon_ch = @hp_icon_image.height
  2402. end
  2403. if HP_ICON_EX_VISIBLE
  2404. @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  2405. @hp_icon2_cw = @hp_icon2_image.width
  2406. @hp_icon2_ch = @hp_icon2_image.height
  2407. end
  2408. if HP_ICON_NUMBER_VISIBLE
  2409. @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  2410. @hp_icon_number_cw = @hp_icon_number_image.width / 10
  2411. @hp_icon_number_ch = @hp_icon_number_image.height
  2412. end
  2413. #------------------------------------------------
  2414. # MP
  2415. #------------------------------------------------
  2416. if MP_NUMBER_VISIBLE
  2417. @mp_number_image = Cache.battle_hud("MP_Number")
  2418. @mp_number_cw = @mp_number_image.width / 10
  2419. if MP_NUMBER_LOW_COLOR
  2420. @mp_number_ch = @mp_number_image.height / 2
  2421. else
  2422. @mp_number_ch = @mp_number_image.height
  2423. end
  2424. @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  2425. @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  2426. end
  2427. if MP_NUMBER_MAX_VISIBLE
  2428. @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  2429. @mp_number2_cw = @mp_number2_image.width / 10
  2430. @mp_number2_ch = @mp_number2_image.height
  2431. end
  2432. if MP_METER_VISIBLE
  2433. @mp_meter_image = Cache.battle_hud("MP_Meter")
  2434. if MP_METER_GRADIENT_ANIMATION
  2435. @mp_meter_cw = @mp_meter_image.width / 3
  2436. else
  2437. @mp_meter_cw = @mp_meter_image.width
  2438. end
  2439. if MP_METER_REDUCTION_ANIMATION
  2440. @mp_meter_ch = @mp_meter_image.height / 2
  2441. else
  2442. @mp_meter_ch = @mp_meter_image.height
  2443. end
  2444. end
  2445. if MP_ICON_VISIBLE
  2446. @mp_icon_image = Cache.battle_hud("MP_Icon")
  2447. @mp_icon_cw = @mp_icon_image.width / 2
  2448. @mp_icon_ch = @mp_icon_image.height
  2449. end
  2450. if MP_ICON_EX_VISIBLE
  2451. @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  2452. @mp_icon2_cw = @mp_icon2_image.width
  2453. @mp_icon2_ch = @mp_icon2_image.height
  2454. end
  2455. if MP_ICON_NUMBER_VISIBLE
  2456. @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  2457. @mp_icon_number_cw = @mp_icon_number_image.width / 10
  2458. @mp_icon_number_ch = @mp_icon_number_image.height
  2459. end
  2460. #------------------------------------------------
  2461. # TP
  2462. #------------------------------------------------
  2463. if TP_NUMBER_VISIBLE
  2464. @tp_number_image = Cache.battle_hud("TP_Number")
  2465. @tp_number_cw = @tp_number_image.width / 10
  2466. if TP_NUMBER_LOW_COLOR
  2467. @tp_number_ch = @tp_number_image.height / 2
  2468. else
  2469. @tp_number_ch = @tp_number_image.height
  2470. end
  2471. @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  2472. @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number
  2473. end
  2474. if TP_NUMBER_MAX_VISIBLE
  2475. @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  2476. @tp_number2_cw = @tp_number2_image.width / 10
  2477. @tp_number2_ch = @tp_number2_image.height
  2478. end
  2479. if TP_METER_VISIBLE
  2480. @tp_meter_image = Cache.battle_hud("TP_Meter")
  2481. if TP_METER_GRADIENT_ANIMATION
  2482. @tp_meter_cw = @tp_meter_image.width / 3
  2483. else
  2484. @tp_meter_cw = @tp_meter_image.width
  2485. end
  2486. if TP_METER_REDUCTION_ANIMATION
  2487. @tp_meter_ch = @tp_meter_image.height / 2
  2488. else
  2489. @tp_meter_ch = @tp_meter_image.height
  2490. end
  2491. end
  2492. if TP_ICON_VISIBLE
  2493. @tp_icon_image = Cache.battle_hud("TP_Icon")
  2494. @tp_icon_cw = @tp_icon_image.width / 2
  2495. @tp_icon_ch = @tp_icon_image.height
  2496. end
  2497. if TP_ICON_EX_VISIBLE
  2498. @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  2499. @tp_icon2_cw = @tp_icon2_image.width
  2500. @tp_icon2_ch = @tp_icon2_image.height
  2501. end
  2502. if TP_ICON_NUMBER_VISIBLE
  2503. @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  2504. @tp_icon_number_cw = @tp_icon_number_image.width / 10
  2505. @tp_icon_number_ch = @tp_icon_number_image.height
  2506. end
  2507. #------------------------------------------------
  2508. # AT
  2509. #------------------------------------------------
  2510. if AT_NUMBER_VISIBLE
  2511. @at_number_image = Cache.battle_hud("AT_Number")
  2512. @at_number_cw = @at_number_image.width / 10
  2513. @at_number_ch = @at_number_image.height
  2514. @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  2515. @at_number_ch += (@at_number_ch / 2) if @at_wave_number
  2516. end
  2517. if AT_NUMBER_MAX_VISIBLE
  2518. @at_number2_image = Cache.battle_hud("Max_AT_Number")
  2519. @at_number2_cw = @at_number2_image.width / 10
  2520. @at_number2_ch = @at_number2_image.height
  2521. end
  2522. if AT_METER_VISIBLE
  2523. @at_meter_image = Cache.battle_hud("AT_Meter")
  2524. if AT_METER_GRADIENT_ANIMATION
  2525. @at_meter_cw = @at_meter_image.width / 3
  2526. else
  2527. @at_meter_cw = @at_meter_image.width
  2528. end
  2529. @at_meter_ch = @at_meter_image.height / 3
  2530. end
  2531. #------------------------------------------------
  2532. # LV
  2533. #------------------------------------------------
  2534. if LEVEL_NUMBER_VISIBLE
  2535. @lv_number_image = Cache.battle_hud("LV_Number")
  2536. @lv_number_cw = @lv_number_image.width / 10
  2537. @lv_number_ch = @lv_number_image.height
  2538. end
  2539. #------------------------------------------------
  2540. # ICON
  2541. #------------------------------------------------
  2542. if STATES_VISIBLE or EQUIPMENT_VISIBLE
  2543. @icon_image = Cache.system("Iconset")
  2544. end
  2545. end
  2546.  
  2547. #--------------------------------------------------------------------------
  2548. # * Check Icon Image
  2549. #--------------------------------------------------------------------------
  2550. def check_icon_image
  2551. if @icon_image == nil or @icon_image.disposed?
  2552. @icon_image = Cache.system("Iconset")
  2553. end
  2554. end
  2555.  
  2556. end
  2557.  
  2558. #==============================================================================
  2559. #==============================================================================
  2560. # ** Battle Hud EX
  2561. #==============================================================================
  2562. #==============================================================================
  2563. class Battle_Hud_EX
  2564.  
  2565. #--------------------------------------------------------------------------
  2566. # * Update Number
  2567. #--------------------------------------------------------------------------
  2568. def update_number(type,value)
  2569. actor_value = @actor.hp if type == 0
  2570. actor_value = @actor.mp if type == 1
  2571. actor_value = @actor.tp if type == 2
  2572. actor_value = @actor.mhp if type == 3
  2573. actor_value = @actor.mmp if type == 4
  2574. actor_value = @actor.max_tp if type == 5
  2575. actor_value = actor_at if type == 6
  2576. actor_value = actor_max_at if type == 7
  2577. if value < actor_value
  2578. value += number_refresh_speed(actor_value,value)
  2579. value = actor_value if value >= actor_value
  2580. refresh_sprite_number(type,value)
  2581. elsif value > actor_value
  2582. value -= number_refresh_speed(actor_value,value)
  2583. value = actor_value if value <= actor_value
  2584. refresh_sprite_number(type,value)
  2585. end
  2586. end
  2587.  
  2588. #--------------------------------------------------------------------------
  2589. # * Number Refresh Speed
  2590. #--------------------------------------------------------------------------
  2591. def number_refresh_speed(actor_value,value)
  2592. n = 1 * (actor_value - value).abs / 10
  2593. return [[n, 99999999].min,1].max
  2594. end
  2595.  
  2596. #--------------------------------------------------------------------------
  2597. # * Update Number Fix
  2598. #--------------------------------------------------------------------------
  2599. def update_number_fix(type)
  2600. if type == 0
  2601. @hp_number_old = @actor.hp
  2602. @hp_number_refresh = true
  2603. elsif type == 1
  2604. @mp_number_old = @actor.mp
  2605. @mp_number_refresh = true
  2606. elsif type == 2
  2607. @tp_number_old = @actor.tp
  2608. @tp_number_refresh = true
  2609. elsif type == 3
  2610. @hp_number2_old = @actor.mhp
  2611. @hp_number2_refresh = true
  2612. elsif type == 4
  2613. @mp_number2_old = @actor.mmp
  2614. @mp_number2_refresh = true
  2615. elsif type == 5
  2616. @tp_number2_old = @actor.max_tp
  2617. @tp_number2_refresh = true
  2618. elsif type == 6
  2619. @at_number_old = actor_at
  2620. @at_number_refresh = true
  2621. elsif type == 7
  2622. @at_number2_old = actor_max_at
  2623. @at_number2_refresh = true
  2624. end
  2625. end
  2626.  
  2627. #--------------------------------------------------------------------------
  2628. # * Refresh Sprite Number
  2629. #--------------------------------------------------------------------------
  2630. def refresh_sprite_number(type,value)
  2631. @hp_number_refresh = true if type == 0
  2632. @hp_number_old = value if type == 0
  2633. @mp_number_refresh = true if type == 1
  2634. @mp_number_old = value if type == 1
  2635. @tp_number_refresh = true if type == 2
  2636. @tp_number_old = value if type == 2
  2637. @hp_number2_refresh = true if type == 3
  2638. @hp_number2_old = value if type == 3
  2639. @mp_number2_refresh = true if type == 4
  2640. @mp_number2_old = value if type == 4
  2641. @tp_number2_refresh = true if type == 5
  2642. @tp_number2_old = value if type == 5
  2643. @at_number_refresh = true if type == 6
  2644. @at_number_old = value if type == 6
  2645. @at_number2_refresh = true if type == 7
  2646. @at_number2_old = value if type == 7
  2647. end
  2648.  
  2649. #--------------------------------------------------------------------------
  2650. # * Refresh Number
  2651. #--------------------------------------------------------------------------
  2652. def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  2653. sprite.bitmap.clear
  2654. clear_number_refresh(type)
  2655. number_color = low_number_color(type,number_ch)
  2656. if type == 0 and HP_NUMBER_PERCENTAGE
  2657. value_max = @actor.mhp
  2658. value = value.to_f / value_max.to_f * 100
  2659. value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  2660. elsif type == 1 and MP_NUMBER_PERCENTAGE
  2661. value_max = @actor.mmp
  2662. value = value.to_f / value_max.to_f * 100
  2663. elsif type == 2 and TP_NUMBER_PERCENTAGE
  2664. value_max = @actor.max_tp
  2665. value = value.to_f / value_max.to_f * 100
  2666. elsif type == 3 and HP_NUMBER_PERCENTAGE
  2667. value = 100
  2668. elsif type == 4 and MP_NUMBER_PERCENTAGE
  2669. value = 100
  2670. elsif type == 5 and TP_NUMBER_PERCENTAGE
  2671. value = 100
  2672. elsif type == 6 and AT_NUMBER_PERCENTAGE
  2673. value_max = actor_max_at
  2674. value = value.to_f / value_max.to_f * 100
  2675. elsif type == 7 and AT_NUMBER_PERCENTAGE
  2676. value = 100
  2677. end
  2678. value = 9999999 if value > 9999999
  2679. number_value = value.truncate.abs.to_s.split(//)
  2680. wave_h = 0
  2681. wave_h2 = wave_number ? (number_ch / 3) : 0
  2682. wave_h3 = number_color != 0 ? wave_h2 : 0
  2683. for r in 0..number_value.size - 1
  2684. number_value_abs = number_value[r].to_i
  2685. wh = wave_h2 * wave_h
  2686. wh2 = wave_h == 0 ? wave_h2 : 0
  2687. nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  2688. sprite.bitmap.blt(number_cw * r, wh, image, nsrc_rect)
  2689. wave_h = wave_h == 0 ? 1 : 0
  2690. end
  2691. refresh_number_position(type,number_value.size,number_cw)
  2692. end
  2693.  
  2694. #--------------------------------------------------------------------------
  2695. # * Refresh Number
  2696. #--------------------------------------------------------------------------
  2697. def refresh_number_position(type,number_value,number_cw)
  2698. cx = number_value * number_cw
  2699. if type == 0
  2700. case HP_NUMBER_ALIGN_TYPE
  2701. when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  2702. when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  2703. when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  2704. end
  2705. elsif type == 1
  2706. case MP_NUMBER_ALIGN_TYPE
  2707. when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  2708. when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  2709. when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  2710. end
  2711. elsif type == 2
  2712. case TP_NUMBER_ALIGN_TYPE
  2713. when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  2714. when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  2715. when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  2716. end
  2717. elsif type == 3
  2718. case HP_NUMBER_ALIGN_TYPE
  2719. when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  2720. when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  2721. when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  2722. end
  2723. elsif type == 4
  2724. case MP_NUMBER_ALIGN_TYPE
  2725. when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  2726. when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  2727. when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  2728. end
  2729. elsif type == 5
  2730. case TP_NUMBER_ALIGN_TYPE
  2731. when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  2732. when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  2733. when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  2734. end
  2735. elsif type == 6
  2736. case MP_NUMBER_ALIGN_TYPE
  2737. when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  2738. when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  2739. when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  2740. end
  2741. elsif type == 7
  2742. case AT_NUMBER_ALIGN_TYPE
  2743. when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  2744. when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  2745. when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  2746. end
  2747. end
  2748. end
  2749.  
  2750. #--------------------------------------------------------------------------
  2751. # * Low Number Color
  2752. #--------------------------------------------------------------------------
  2753. def low_number_color(type,number_ch)
  2754. if type == 0
  2755. if HP_NUMBER_LOW_COLOR
  2756. return @actor.low_hp? ? number_ch : 0
  2757. else
  2758. return 0
  2759. end
  2760. elsif type == 1
  2761. if MP_NUMBER_LOW_COLOR
  2762. return @actor.low_mp? ? number_ch : 0
  2763. else
  2764. return 0
  2765. end
  2766. elsif type == 2
  2767. if TP_NUMBER_LOW_COLOR
  2768. return @actor.low_tp? ? number_ch : 0
  2769. else
  2770. return 0
  2771. end
  2772. else
  2773. return 0
  2774. end
  2775. end
  2776.  
  2777. #--------------------------------------------------------------------------
  2778. # * Clear Number Refresh
  2779. #--------------------------------------------------------------------------
  2780. def clear_number_refresh(type)
  2781. @hp_number_refresh = false if type == 0
  2782. @mp_number_refresh = false if type == 1
  2783. @tp_number_refresh = false if type == 2
  2784. @hp_number2_refresh = false if type == 3
  2785. @mp_number2_refresh = false if type == 4
  2786. @tp_number2_refresh = false if type == 5
  2787. @at_number_refresh = false if type == 6
  2788. @at_number2_refresh = false if type == 7
  2789. end
  2790.  
  2791. #--------------------------------------------------------------------------
  2792. # * Icon Limit
  2793. #--------------------------------------------------------------------------
  2794. def icon_limit(value,value_max)
  2795. n1 = value / value_max
  2796. n2 = value - (n1 * value_max)
  2797. n2 = value_max if (n2 == 0 and value > 0)
  2798. return n2
  2799. end
  2800.  
  2801. end
  2802.  
  2803. #==============================================================================
  2804. #==============================================================================
  2805. # ** Battle Hud EX
  2806. #==============================================================================
  2807. #==============================================================================
  2808. class Battle_Hud_EX
  2809.  
  2810. #--------------------------------------------------------------------------
  2811. # * Create Layout
  2812. #--------------------------------------------------------------------------
  2813. def create_layout(viewport)
  2814. @layout = Sprite.new
  2815. @layout.bitmap = @layout_image
  2816. @layout.z = HUD_Z
  2817. @layout.x = @hud_position[0]
  2818. @layout.y = @hud_position[1]
  2819. @layout.viewport = viewport
  2820. end
  2821.  
  2822. #--------------------------------------------------------------------------
  2823. # * Update Layout
  2824. #--------------------------------------------------------------------------
  2825. def update_layout
  2826. return if @layout == nil
  2827.  
  2828. end
  2829.  
  2830. #--------------------------------------------------------------------------
  2831. # * Create Layout
  2832. #--------------------------------------------------------------------------
  2833. def create_layout_2(viewport)
  2834. return if !SECOND_LAYOUT
  2835. @layout2 = Sprite.new
  2836. @layout2.bitmap = @layout2_image
  2837. @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  2838. @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  2839. @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  2840. @layout2.viewport = viewport
  2841. end
  2842.  
  2843. #--------------------------------------------------------------------------
  2844. # * Update Layout
  2845. #--------------------------------------------------------------------------
  2846. def update_layout_2
  2847. return if @layout2 == nil
  2848.  
  2849. end
  2850.  
  2851. end
  2852.  
  2853. #==============================================================================
  2854. #==============================================================================
  2855. # ** Battle Hud EX
  2856. #==============================================================================
  2857. #==============================================================================
  2858. class Battle_Hud_EX
  2859.  
  2860. #--------------------------------------------------------------------------
  2861. # * Create Name
  2862. #--------------------------------------------------------------------------
  2863. def create_name(viewport)
  2864. return if !NAME_VISIBLE
  2865. @name = Sprite.new
  2866. @name.bitmap = Bitmap.new(160,32)
  2867. @name.bitmap.font.name = NAME_FONT_NAME
  2868. @name.bitmap.font.size = NAME_FONT_SIZE
  2869. @name.bitmap.font.bold = NAME_FONT_BOLD
  2870. @name.bitmap.font.italic = NAME_FONT_ITALIC
  2871. @name.bitmap.font.color = NAME_FONT_COLOR
  2872. @name.z = HUD_Z + NAME_Z
  2873. @name.x = @hud_position[0] + NAME_POSITION[0]
  2874. @name.y = @hud_position[1] + NAME_POSITION[1]
  2875. @name.viewport = viewport
  2876. refresh_name
  2877. end
  2878.  
  2879. #--------------------------------------------------------------------------
  2880. # * Refresh Name
  2881. #--------------------------------------------------------------------------
  2882. def refresh_name
  2883. return if @name == nil
  2884. @name.bitmap.clear
  2885. if NAME_FONT_SHADOW
  2886. @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  2887. @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  2888. @name.bitmap.font.color = NAME_FONT_COLOR
  2889. end
  2890. @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  2891. end
  2892.  
  2893. #--------------------------------------------------------------------------
  2894. # * Update Name
  2895. #--------------------------------------------------------------------------
  2896. def update_name
  2897. return if @name == nil
  2898.  
  2899. end
  2900.  
  2901. end
  2902.  
  2903. #==============================================================================
  2904. #==============================================================================
  2905. # ** Battle Hud EX
  2906. #==============================================================================
  2907. #==============================================================================
  2908. class Battle_Hud_EX
  2909.  
  2910. #--------------------------------------------------------------------------
  2911. # * Create HP Number
  2912. #--------------------------------------------------------------------------
  2913. def create_hp_number(viewport)
  2914. return if !HP_NUMBER_VISIBLE
  2915. @hp_number = Sprite.new
  2916. @hp_number.bitmap = Bitmap.new(@hp_number_cw * 4,@hp_number_ch)
  2917. @hp_number.z = HUD_Z + HP_NUMBER_Z
  2918. @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  2919. @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  2920. @hp_number.viewport = viewport
  2921. end
  2922.  
  2923. #--------------------------------------------------------------------------
  2924. # * Create HP Number Max
  2925. #--------------------------------------------------------------------------
  2926. def create_hp_number_max(viewport)
  2927. return if !HP_NUMBER_MAX_VISIBLE
  2928. @hp_number2 = Sprite.new
  2929. @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 4,@hp_number2_ch)
  2930. @hp_number2.z = HUD_Z + HP_NUMBER_Z
  2931. @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  2932. @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  2933. @hp_number2.viewport = viewport
  2934. end
  2935.  
  2936. #--------------------------------------------------------------------------
  2937. # * Create HP Meter
  2938. #--------------------------------------------------------------------------
  2939. def create_hp_meter(viewport)
  2940. return if !HP_METER_VISIBLE
  2941. @hp_flow_max = @hp_meter_cw * 2
  2942. @hp_flow = rand(@hp_flow_max)
  2943. @hp_meter = Sprite.new
  2944. @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  2945. @hp_meter.z = HUD_Z + HP_METER_Z
  2946. @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  2947. @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  2948. @hp_meter.angle = HP_METER_ANGLE
  2949. @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  2950. @hp_meter.viewport = viewport
  2951. end
  2952.  
  2953. #--------------------------------------------------------------------------
  2954. # ● Update Flow HP
  2955. #--------------------------------------------------------------------------
  2956. def update_flow_hp
  2957. @hp_meter.bitmap.clear
  2958. @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  2959. meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  2960. meter_width = 0 if meter_width == nil
  2961. execute_hp_damage_flow(meter_width)
  2962. meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  2963. @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)
  2964. @hp_flow += 2
  2965. @hp_flow = 0 if @hp_flow >= @hp_flow_max
  2966. end
  2967.  
  2968. #--------------------------------------------------------------------------
  2969. # ● Execute HP Damage Flow
  2970. #--------------------------------------------------------------------------
  2971. def execute_hp_damage_flow(meter_width)
  2972. return if !HP_METER_REDUCTION_ANIMATION
  2973. return if @hp_old_meter == meter_width
  2974. n = (@hp_old_meter - meter_width).abs * 3 / 100
  2975. damage_flow = [[n, 2].min,0.5].max
  2976. @hp_old_meter -= damage_flow
  2977. @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  2978. src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  2979. @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)
  2980. end
  2981.  
  2982. #--------------------------------------------------------------------------
  2983. # * Create HP Icon
  2984. #--------------------------------------------------------------------------
  2985. def create_hp_icon(viewport)
  2986. return if !HP_ICON_VISIBLE
  2987. @hp_icon = Sprite.new
  2988. icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  2989. icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  2990. @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  2991. @hp_icon.z = HUD_Z + HP_ICON_Z
  2992. @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  2993. @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  2994. @hp_icon.viewport = viewport
  2995. end
  2996.  
  2997. #--------------------------------------------------------------------------
  2998. # * Refresh HP Icon
  2999. #--------------------------------------------------------------------------
  3000. def refresh_hp_icon
  3001. @hp_icon_old = @actor.hp
  3002. @hp_icon.bitmap.clear
  3003. max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  3004. if @actor.hp > max_value
  3005. icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  3006. else
  3007. icon_max = @actor.mhp
  3008. end
  3009. for i in 0...icon_max
  3010. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  3011. 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)
  3012. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  3013. i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  3014. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  3015. end
  3016. icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  3017. rx = 0
  3018. ry = 0
  3019. for i in 0...icon_max
  3020. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  3021. 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)
  3022. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  3023. i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  3024. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  3025. end
  3026. refresh_hp_icon_ex(rx,ry)
  3027. end
  3028.  
  3029. #--------------------------------------------------------------------------
  3030. # * Create HP Icon EX
  3031. #--------------------------------------------------------------------------
  3032. def create_hp_icon_ex(viewport)
  3033. return if !HP_ICON_EX_VISIBLE
  3034. @hp_icon3_anime_phase = 0
  3035. @hp_icon3 = Sprite.new
  3036. @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  3037. @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  3038. @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  3039. @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  3040. @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  3041. @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  3042. @hp_icon3.x = @hp_icon3_org[0]
  3043. @hp_icon3.y = @hp_icon3_org[1]
  3044. @hp_icon3.viewport = viewport
  3045. end
  3046.  
  3047. #--------------------------------------------------------------------------
  3048. # * Refresh HP Icon EX
  3049. #--------------------------------------------------------------------------
  3050. def refresh_hp_icon_ex(rx,ry)
  3051. return if @hp_icon3 == nil
  3052. @hp_icon3.bitmap.clear
  3053. return if @actor.hp == 0
  3054. i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  3055. @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  3056. @hp_icon3.x = @hp_icon3_org[0] + rx
  3057. @hp_icon3.y = @hp_icon3_org[1] + ry
  3058. end
  3059.  
  3060. #--------------------------------------------------------------------------
  3061. # * Update Icon HP EX Anime
  3062. #--------------------------------------------------------------------------
  3063. def update_icon_hp_ex_anime
  3064. return if !HP_ICON_EX_ZOOM_EFFECT
  3065. if @hp_icon3_anime_phase == 0
  3066. @hp_icon3.zoom_x += 0.01
  3067. if @hp_icon3.zoom_x >= 1.30
  3068. @hp_icon3.zoom_x = 1.30
  3069. @hp_icon3_anime_phase = 1
  3070. end
  3071. else
  3072. @hp_icon3.zoom_x -= 0.01
  3073. if @hp_icon3.zoom_x <= 1.05
  3074. @hp_icon3.zoom_x = 1.05
  3075. @hp_icon3_anime_phase = 0
  3076. end
  3077. end
  3078. @hp_icon3.zoom_y = @hp_icon3.zoom_x
  3079. end
  3080.  
  3081. #--------------------------------------------------------------------------
  3082. # * Create HP Icon Nummber
  3083. #--------------------------------------------------------------------------
  3084. def create_hp_icon_number(viewport)
  3085. return if !HP_ICON_NUMBER_VISIBLE
  3086. @hp_icon_number_old = [-1,-1]
  3087. @hp_icon_number = Sprite.new
  3088. @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  3089. @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  3090. @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  3091. @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  3092. @hp_icon_number.viewport = viewport
  3093. end
  3094.  
  3095. #--------------------------------------------------------------------------
  3096. # * Refresh Icon Number HP
  3097. #--------------------------------------------------------------------------
  3098. def refresh_icon_number_hp
  3099. @hp_icon_number_old[0] = @actor.hp
  3100. @hp_icon_number_old[1] = @actor.mhp
  3101. @hp_icon_number.bitmap.clear
  3102. value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  3103. value = 0 if value < 0
  3104. number_value = value.truncate.abs.to_s.split(//)
  3105. for r in 0..number_value.size - 1
  3106. number_value_abs = number_value[r].to_i
  3107. nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  3108. @hp_icon_number.bitmap.blt(@hp_icon_number_cw * r, 0, @hp_icon_number_image, nsrc_rect)
  3109. end
  3110. cx = (number_value.size * @hp_icon_number_cw)
  3111. case HP_ICON_NUMBER_ALIGN_TYPE
  3112. when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  3113. when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  3114. when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  3115. end
  3116. end
  3117.  
  3118. #--------------------------------------------------------------------------
  3119. # * Can Refresh Icon Number HP
  3120. #--------------------------------------------------------------------------
  3121. def can_refresh_icon_number_hp?
  3122. return true if @hp_icon_number_old[0] != @actor.hp
  3123. return true if @hp_icon_number_old[1] != @actor.mhp
  3124. return false
  3125. end
  3126.  
  3127. #--------------------------------------------------------------------------
  3128. # * Update HP
  3129. #--------------------------------------------------------------------------
  3130. def update_hp
  3131. if @hp_number != nil
  3132. if HP_NUMBER_ANIMATION
  3133. update_number(0,@hp_number_old)
  3134. else
  3135. update_number_fix(0) if @hp_number_old != @actor.hp
  3136. end
  3137. refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  3138. end
  3139. if @hp_number2 != nil
  3140. if HP_NUMBER_ANIMATION
  3141. update_number(3,@hp_number2_old)
  3142. else
  3143. update_number_fix(3) if @hp_number2_old != @actor.mhp
  3144. end
  3145. refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  3146. end
  3147. if @hp_meter != nil
  3148. update_flow_hp
  3149. end
  3150. if @hp_icon != nil
  3151. refresh_hp_icon if @hp_icon_old != @actor.hp
  3152. end
  3153. if @hp_icon3 != nil
  3154. update_icon_hp_ex_anime
  3155. end
  3156. if @hp_icon_number != nil
  3157. refresh_icon_number_hp if can_refresh_icon_number_hp?
  3158. end
  3159. end
  3160.  
  3161. end
  3162.  
  3163. #==============================================================================
  3164. #==============================================================================
  3165. # ** Battle Hud EX
  3166. #==============================================================================
  3167. #==============================================================================
  3168. class Battle_Hud_EX
  3169.  
  3170. #--------------------------------------------------------------------------
  3171. # * Create MP Number
  3172. #--------------------------------------------------------------------------
  3173. def create_mp_number(viewport)
  3174. return if !MP_NUMBER_VISIBLE
  3175. @mp_number = Sprite.new
  3176. @mp_number.bitmap = Bitmap.new(@mp_number_cw * 4, @mp_number_ch)
  3177. @mp_number.z = HUD_Z + MP_NUMBER_Z
  3178. @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  3179. @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  3180. @mp_number.viewport = viewport
  3181. end
  3182.  
  3183. #--------------------------------------------------------------------------
  3184. # * Create MP Number Max
  3185. #--------------------------------------------------------------------------
  3186. def create_mp_number_max(viewport)
  3187. return if !MP_NUMBER_MAX_VISIBLE
  3188. @mp_number2 = Sprite.new
  3189. @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 4, @mp_number2_ch)
  3190. @mp_number2.z = HUD_Z + MP_NUMBER_Z
  3191. @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  3192. @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  3193. @mp_number2.viewport = viewport
  3194. end
  3195.  
  3196. #--------------------------------------------------------------------------
  3197. # * Create MP Meter
  3198. #--------------------------------------------------------------------------
  3199. def create_mp_meter(viewport)
  3200. return if !MP_METER_VISIBLE
  3201. @mp_flow_max = @mp_meter_cw * 2
  3202. @mp_flow = rand(@mp_flow_max)
  3203. @mp_meter = Sprite.new
  3204. @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  3205. @mp_meter.z = HUD_Z + MP_METER_Z
  3206. @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  3207. @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  3208. @mp_meter.angle = MP_METER_ANGLE
  3209. @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  3210. @mp_meter.viewport = viewport
  3211. end
  3212.  
  3213. #--------------------------------------------------------------------------
  3214. # ● Update Flow MP
  3215. #--------------------------------------------------------------------------
  3216. def update_flow_mp
  3217. @mp_meter.bitmap.clear
  3218. @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  3219. meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  3220. meter_width = 0 if meter_width == nil
  3221. execute_mp_damage_flow(meter_width)
  3222. meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  3223. @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)
  3224. @mp_flow += 2
  3225. @mp_flow = 0 if @mp_flow >= @mp_flow_max
  3226. end
  3227.  
  3228. #--------------------------------------------------------------------------
  3229. # ● Execute MP Damage Flow
  3230. #--------------------------------------------------------------------------
  3231. def execute_mp_damage_flow(meter_width)
  3232. return if !MP_METER_REDUCTION_ANIMATION
  3233. return if @mp_old_meter == meter_width
  3234. n = (@mp_old_meter - meter_width).abs * 3 / 100
  3235. damage_flow = [[n, 2].min,0.5].max
  3236. @mp_old_meter -= damage_flow
  3237. @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  3238. src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  3239. @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)
  3240. end
  3241.  
  3242. #--------------------------------------------------------------------------
  3243. # * Create MP Icon
  3244. #--------------------------------------------------------------------------
  3245. def create_mp_icon(viewport)
  3246. return if !MP_ICON_VISIBLE
  3247. @mp_icon = Sprite.new
  3248. icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  3249. icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  3250. @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  3251. @mp_icon.z = HUD_Z + MP_ICON_Z
  3252. @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  3253. @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  3254. @mp_icon.viewport = viewport
  3255. end
  3256.  
  3257. #--------------------------------------------------------------------------
  3258. # * Refresh MP Icon
  3259. #--------------------------------------------------------------------------
  3260. def refresh_mp_icon
  3261. @mp_icon_old = @actor.mp
  3262. @mp_icon.bitmap.clear
  3263. max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  3264. if @actor.mp > max_value
  3265. icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  3266. else
  3267. icon_max = @actor.mmp
  3268. end
  3269. for i in 0...icon_max
  3270. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  3271. 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)
  3272. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  3273. i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  3274. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  3275. end
  3276. icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  3277. rx = 0
  3278. ry = 0
  3279. for i in 0...icon_max
  3280. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  3281. 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)
  3282. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  3283. i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  3284. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  3285. end
  3286. refresh_mp_icon_ex(rx,ry)
  3287. end
  3288.  
  3289. #--------------------------------------------------------------------------
  3290. # * Create MP Icon EX
  3291. #--------------------------------------------------------------------------
  3292. def create_mp_icon_ex(viewport)
  3293. return if !MP_ICON_EX_VISIBLE
  3294. @mp_icon3_anime_phase = 0
  3295. @mp_icon3 = Sprite.new
  3296. @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  3297. @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  3298. @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  3299. @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  3300. @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  3301. @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  3302. @mp_icon3.x = @mp_icon3_org[0]
  3303. @mp_icon3.y = @mp_icon3_org[1]
  3304. @mp_icon3.viewport = viewport
  3305. end
  3306.  
  3307. #--------------------------------------------------------------------------
  3308. # * Refresh MP Icon EX
  3309. #--------------------------------------------------------------------------
  3310. def refresh_mp_icon_ex(rx,ry)
  3311. return if @mp_icon3 == nil
  3312. @mp_icon3.bitmap.clear
  3313. return if @actor.mp == 0
  3314. i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  3315. @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  3316. @mp_icon3.x = @mp_icon3_org[0] + rx
  3317. @mp_icon3.y = @mp_icon3_org[1] + ry
  3318. end
  3319.  
  3320. #--------------------------------------------------------------------------
  3321. # * Update Icon MP EX Anime
  3322. #--------------------------------------------------------------------------
  3323. def update_icon_mp_ex_anime
  3324. return if !MP_ICON_EX_ZOOM_EFFECT
  3325. if @mp_icon3_anime_phase == 0
  3326. @mp_icon3.zoom_x += 0.01
  3327. if @mp_icon3.zoom_x >= 1.30
  3328. @mp_icon3.zoom_x = 1.30
  3329. @mp_icon3_anime_phase = 1
  3330. end
  3331. else
  3332. @mp_icon3.zoom_x -= 0.01
  3333. if @mp_icon3.zoom_x <= 1.05
  3334. @mp_icon3.zoom_x = 1.05
  3335. @mp_icon3_anime_phase = 0
  3336. end
  3337. end
  3338. @mp_icon3.zoom_y = @mp_icon3.zoom_x
  3339. end
  3340.  
  3341. #--------------------------------------------------------------------------
  3342. # * Create MP Icon Number
  3343. #--------------------------------------------------------------------------
  3344. def create_mp_icon_number(viewport)
  3345. return if !MP_ICON_NUMBER_VISIBLE
  3346. @mp_icon_number_old = [-1,-1]
  3347. @mp_icon_number = Sprite.new
  3348. @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  3349. @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  3350. @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  3351. @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  3352. @mp_icon_number.viewport = viewport
  3353. end
  3354.  
  3355. #--------------------------------------------------------------------------
  3356. # * Refresh Icon Number MP
  3357. #--------------------------------------------------------------------------
  3358. def refresh_icon_number_mp
  3359. @mp_icon_number_old[0] = @actor.mp
  3360. @mp_icon_number_old[1] = @actor.mmp
  3361. @mp_icon_number.bitmap.clear
  3362. value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  3363. value = 0 if value < 0
  3364. number_value = value.truncate.abs.to_s.split(//)
  3365. for r in 0..number_value.size - 1
  3366. number_value_abs = number_value[r].to_i
  3367. nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  3368. @mp_icon_number.bitmap.blt(@mp_icon_number_cw * r, 0, @mp_icon_number_image, nsrc_rect)
  3369. end
  3370. cx = (number_value.size * @mp_icon_number_cw)
  3371. case MP_ICON_NUMBER_ALIGN_TYPE
  3372. when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  3373. when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  3374. when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  3375. end
  3376. end
  3377.  
  3378. #--------------------------------------------------------------------------
  3379. # * Can Refresh Icon Number MP
  3380. #--------------------------------------------------------------------------
  3381. def can_refresh_icon_number_mp?
  3382. return true if @mp_icon_number_old[0] != @actor.mp
  3383. return true if @mp_icon_number_old[1] != @actor.mmp
  3384. return false
  3385. end
  3386.  
  3387. #--------------------------------------------------------------------------
  3388. # * Update MP
  3389. #--------------------------------------------------------------------------
  3390. def update_mp
  3391. if @mp_number != nil
  3392. if MP_NUMBER_ANIMATION
  3393. update_number(1,@mp_number_old)
  3394. else
  3395. update_number_fix(1) if @mp_number_old != @actor.mp
  3396. end
  3397. refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  3398. end
  3399. if @mp_number2 != nil
  3400. if MP_NUMBER_ANIMATION
  3401. update_number(4,@mp_number2_old)
  3402. else
  3403. update_number_fix(4) if @mp_number2_old != @actor.mmp
  3404. end
  3405. refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  3406. end
  3407. if @mp_meter != nil
  3408. update_flow_mp
  3409. end
  3410. if @mp_icon != nil
  3411. refresh_mp_icon if @mp_icon_old != @actor.mp
  3412. end
  3413. if @mp_icon3 != nil
  3414. update_icon_mp_ex_anime
  3415. end
  3416. if @mp_icon_number != nil
  3417. refresh_icon_number_mp if can_refresh_icon_number_mp?
  3418. end
  3419. end
  3420.  
  3421. end
  3422.  
  3423. #==============================================================================
  3424. #==============================================================================
  3425. # ** Battle Hud EX
  3426. #==============================================================================
  3427. #==============================================================================
  3428. class Battle_Hud_EX
  3429.  
  3430. #--------------------------------------------------------------------------
  3431. # * Create TP Number
  3432. #--------------------------------------------------------------------------
  3433. def create_tp_number(viewport)
  3434. return if !TP_NUMBER_VISIBLE
  3435. @tp_number = Sprite.new
  3436. @tp_number.bitmap = Bitmap.new(@tp_number_cw * 3, @tp_number_ch)
  3437. @tp_number.z = HUD_Z + TP_NUMBER_Z
  3438. @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  3439. @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  3440. @tp_number.viewport = viewport
  3441. end
  3442.  
  3443. #--------------------------------------------------------------------------
  3444. # * Create TP Number MAX
  3445. #--------------------------------------------------------------------------
  3446. def create_tp_number_max(viewport)
  3447. return if !TP_NUMBER_MAX_VISIBLE
  3448. @tp_number2 = Sprite.new
  3449. @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 3, @tp_number2_ch)
  3450. @tp_number2.z = HUD_Z + TP_NUMBER_Z
  3451. @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  3452. @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  3453. @tp_number2.viewport = viewport
  3454. end
  3455.  
  3456. #--------------------------------------------------------------------------
  3457. # * Create TP Meter
  3458. #--------------------------------------------------------------------------
  3459. def create_tp_meter(viewport)
  3460. return if !TP_METER_VISIBLE
  3461. @tp_flow_max = @tp_meter_cw * 2
  3462. @tp_flow = rand(@tp_flow_max)
  3463. @tp_meter = Sprite.new
  3464. @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  3465. @tp_meter.z = HUD_Z + TP_METER_Z
  3466. @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  3467. @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  3468. @tp_meter.angle = TP_METER_ANGLE
  3469. @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  3470. @tp_meter.viewport = viewport
  3471. end
  3472.  
  3473. #--------------------------------------------------------------------------
  3474. # ● Update Flow TP
  3475. #--------------------------------------------------------------------------
  3476. def update_flow_tp
  3477. @tp_meter.bitmap.clear
  3478. @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  3479. meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil
  3480. meter_width = 0 if meter_width == nil
  3481. execute_tp_damage_flow(meter_width)
  3482. meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  3483. @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)
  3484. @tp_flow += 2
  3485. @tp_flow = 0 if @tp_flow >= @tp_flow_max
  3486. end
  3487.  
  3488. #--------------------------------------------------------------------------
  3489. # ● Execute TP Damage Flow
  3490. #--------------------------------------------------------------------------
  3491. def execute_tp_damage_flow(meter_width)
  3492. return if !TP_METER_REDUCTION_ANIMATION
  3493. return if @tp_old_meter == meter_width
  3494. n = (@tp_old_meter - meter_width).abs * 3 / 100
  3495. damage_flow = [[n, 2].min,0.5].max
  3496. @tp_old_meter -= damage_flow
  3497. @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  3498. src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  3499. @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)
  3500. end
  3501.  
  3502. #--------------------------------------------------------------------------
  3503. # * Create TP Icon
  3504. #--------------------------------------------------------------------------
  3505. def create_tp_icon(viewport)
  3506. return if !TP_ICON_VISIBLE
  3507. @tp_icon = Sprite.new
  3508. icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  3509. icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  3510. @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  3511. @tp_icon.z = HUD_Z + TP_ICON_Z
  3512. @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  3513. @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  3514. @tp_icon.viewport = viewport
  3515. end
  3516.  
  3517. #--------------------------------------------------------------------------
  3518. # * Refresh TP Icon
  3519. #--------------------------------------------------------------------------
  3520. def refresh_tp_icon
  3521. @tp_icon_old = @actor.tp
  3522. @tp_icon.bitmap.clear
  3523. max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  3524. if @actor.mp > max_value
  3525. icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  3526. else
  3527. icon_max = @actor.max_tp
  3528. end
  3529. for i in 0...icon_max
  3530. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  3531. 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)
  3532. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  3533. i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  3534. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  3535. end
  3536. icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  3537. rx = 0
  3538. ry = 0
  3539. for i in 0...icon_max
  3540. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  3541. 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)
  3542. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  3543. i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  3544. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  3545. end
  3546. refresh_tp_icon_ex(rx,ry)
  3547. end
  3548.  
  3549. #--------------------------------------------------------------------------
  3550. # * Create TP Icon EX
  3551. #--------------------------------------------------------------------------
  3552. def create_tp_icon_ex(viewport)
  3553. return if !TP_ICON_EX_VISIBLE
  3554. @tp_icon3_anime_phase = 0
  3555. @tp_icon3 = Sprite.new
  3556. @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  3557. @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  3558. @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  3559. @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  3560. @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  3561. @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  3562. @tp_icon3.x = @tp_icon3_org[0]
  3563. @tp_icon3.y = @tp_icon3_org[1]
  3564. @tp_icon3.viewport = viewport
  3565. end
  3566.  
  3567. #--------------------------------------------------------------------------
  3568. # * Refresh TP Icon EX
  3569. #--------------------------------------------------------------------------
  3570. def refresh_tp_icon_ex(rx,ry)
  3571. return if @tp_icon3 == nil
  3572. @tp_icon3.bitmap.clear
  3573. return if @actor.tp == 0
  3574. i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  3575. @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  3576. @tp_icon3.x = @tp_icon3_org[0] + rx
  3577. @tp_icon3.y = @tp_icon3_org[1] + ry
  3578. end
  3579.  
  3580. #--------------------------------------------------------------------------
  3581. # * Update Icon TP EX Anime
  3582. #--------------------------------------------------------------------------
  3583. def update_icon_tp_ex_anime
  3584. return if !MP_ICON_EX_ZOOM_EFFECT
  3585. if @tp_icon3_anime_phase == 0
  3586. @tp_icon3.zoom_x += 0.01
  3587. if @tp_icon3.zoom_x >= 1.30
  3588. @tp_icon3.zoom_x = 1.30
  3589. @tp_icon3_anime_phase = 1
  3590. end
  3591. else
  3592. @tp_icon3.zoom_x -= 0.01
  3593. if @tp_icon3.zoom_x <= 1.05
  3594. @tp_icon3.zoom_x = 1.05
  3595. @tp_icon3_anime_phase = 0
  3596. end
  3597. end
  3598. @tp_icon3.zoom_y = @tp_icon3.zoom_x
  3599. end
  3600.  
  3601. #--------------------------------------------------------------------------
  3602. # * Create HP Icon Number
  3603. #--------------------------------------------------------------------------
  3604. def create_tp_icon_number(viewport)
  3605. return if !TP_ICON_NUMBER_VISIBLE
  3606. @tp_icon_number_old = [-1,-1]
  3607. @tp_icon_number = Sprite.new
  3608. @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  3609. @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  3610. @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  3611. @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  3612. @tp_icon_number.viewport = viewport
  3613. end
  3614.  
  3615. #--------------------------------------------------------------------------
  3616. # * Refresh Icon Number TP
  3617. #--------------------------------------------------------------------------
  3618. def refresh_icon_number_tp
  3619. @tp_icon_number_old[0] = @actor.tp
  3620. @tp_icon_number_old[1] = @actor.max_tp
  3621. @tp_icon_number.bitmap.clear
  3622. value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  3623. value = 0 if value < 0
  3624. number_value = value.truncate.abs.to_s.split(//)
  3625. for r in 0..number_value.size - 1
  3626. number_value_abs = number_value[r].to_i
  3627. nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  3628. @tp_icon_number.bitmap.blt(@tp_icon_number_cw * r, 0, @tp_icon_number_image, nsrc_rect)
  3629. end
  3630. cx = (number_value.size * @tp_icon_number_cw)
  3631. case TP_ICON_NUMBER_ALIGN_TYPE
  3632. when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  3633. when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  3634. when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  3635. end
  3636. end
  3637.  
  3638. #--------------------------------------------------------------------------
  3639. # * Can Refresh Icon Number TP
  3640. #--------------------------------------------------------------------------
  3641. def can_refresh_icon_number_tp?
  3642. return true if @tp_icon_number_old[0] != @actor.tp
  3643. return true if @tp_icon_number_old[1] != @actor.max_tp
  3644. return false
  3645. end
  3646.  
  3647. #--------------------------------------------------------------------------
  3648. # * Update TP
  3649. #--------------------------------------------------------------------------
  3650. def update_tp
  3651. if @tp_number != nil
  3652. if MP_NUMBER_ANIMATION
  3653. update_number(2,@tp_number_old)
  3654. else
  3655. update_number_fix(2) if @tp_number_old != @actor.tp
  3656. end
  3657. refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh
  3658. end
  3659. if @tp_number2 != nil
  3660. if MP_NUMBER_ANIMATION
  3661. update_number(5,@tp_number2_old)
  3662. else
  3663. update_number_fix(5) if @tp_number2_old != @actor.max_tp
  3664. end
  3665. refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  3666. end
  3667. if @tp_meter != nil
  3668. update_flow_tp
  3669. end
  3670. if @tp_icon != nil
  3671. refresh_tp_icon if @tp_icon_old != @actor.tp
  3672. end
  3673. if @tp_icon3 != nil
  3674. update_icon_tp_ex_anime
  3675. end
  3676. if @tp_icon_number != nil
  3677. refresh_icon_number_tp if can_refresh_icon_number_tp?
  3678. end
  3679. end
  3680.  
  3681. end
  3682.  
  3683. #==============================================================================
  3684. #==============================================================================
  3685. # ** Battle Hud EX
  3686. #==============================================================================
  3687. #==============================================================================
  3688. class Battle_Hud_EX
  3689.  
  3690. #--------------------------------------------------------------------------
  3691. # * Create AT Number
  3692. #--------------------------------------------------------------------------
  3693. def create_at_number(viewport)
  3694. return if !AT_NUMBER_VISIBLE
  3695. @at_number = Sprite.new
  3696. @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  3697. @at_number.z = HUD_Z + AT_NUMBER_Z
  3698. @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  3699. @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  3700. @at_number.viewport = viewport
  3701. end
  3702.  
  3703. #--------------------------------------------------------------------------
  3704. # * Create AT Number Max
  3705. #--------------------------------------------------------------------------
  3706. def create_at_number_max(viewport)
  3707. return if !AT_NUMBER_MAX_VISIBLE
  3708. @at_number2 = Sprite.new
  3709. @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  3710. @at_number2.z = HUD_Z + AT_NUMBER_Z
  3711. @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  3712. @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  3713. @at_number2.viewport = viewport
  3714. end
  3715.  
  3716. #--------------------------------------------------------------------------
  3717. # * Create AT Meter
  3718. #--------------------------------------------------------------------------
  3719. def create_at_meter(viewport)
  3720. return if !AT_METER_VISIBLE
  3721. @at_flow_max = @at_meter_cw * 2
  3722. @at_flow = rand(@at_flow_max)
  3723. @at_meter = Sprite.new
  3724. @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  3725. @at_meter.z = HUD_Z + AT_METER_Z
  3726. @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  3727. @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  3728. @at_meter.angle = AT_METER_ANGLE
  3729. @at_meter.mirror = AT_METER_MIRROR_EFFECT
  3730. @at_meter.viewport = viewport
  3731. end
  3732.  
  3733. #--------------------------------------------------------------------------
  3734. # ● Update Flow AT
  3735. #--------------------------------------------------------------------------
  3736. def update_flow_at
  3737. @at_meter.bitmap.clear
  3738. @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  3739. if actor_cast?
  3740. meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  3741. meter_width = 0 if meter_width == nil
  3742. ch = @at_meter_ch * 2
  3743. else
  3744. meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  3745. meter_width = 0 if meter_width == nil
  3746. ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  3747. end
  3748. meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  3749. @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)
  3750. @at_flow += 2
  3751. @at_flow = 0 if @at_flow >= @at_flow_max
  3752. end
  3753.  
  3754. #--------------------------------------------------------------------------
  3755. # * Update AT
  3756. #--------------------------------------------------------------------------
  3757. def update_at
  3758. if @at_number != nil
  3759. if AT_NUMBER_ANIMATION
  3760. update_number(6,@at_number_old)
  3761. else
  3762. update_number_fix(6) if @at_number_old != actor_at
  3763. end
  3764. refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  3765. end
  3766. if @at_number2 != nil
  3767. if AT_NUMBER_ANIMATION
  3768. update_number(7,@at_number2_old)
  3769. else
  3770. update_number_fix(7) if @at_number2_old != actor_max_at
  3771. end
  3772. refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  3773. end
  3774. if @at_meter != nil
  3775. update_flow_at
  3776. end
  3777. end
  3778.  
  3779. end
  3780.  
  3781. #==============================================================================
  3782. #==============================================================================
  3783. # ** Battle Hud EX
  3784. #==============================================================================
  3785. #==============================================================================
  3786. class Battle_Hud_EX
  3787.  
  3788. #--------------------------------------------------------------------------
  3789. # * Create Level Number
  3790. #--------------------------------------------------------------------------
  3791. def create_level_number(viewport)
  3792. return if !LEVEL_NUMBER_VISIBLE
  3793. @old_level = -1
  3794. @lv_number = Sprite.new
  3795. @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  3796. @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  3797. @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  3798. @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  3799. @lv_number.viewport = viewport
  3800. end
  3801.  
  3802. #--------------------------------------------------------------------------
  3803. # * Refresh Level Number
  3804. #--------------------------------------------------------------------------
  3805. def refresh_level_number
  3806. @lv_number.bitmap.clear
  3807. @old_level = @actor.level
  3808. number_value = @actor.level.abs.to_s.split(//)
  3809. for r in 0..number_value.size - 1
  3810. number_value_abs = number_value[r].to_i
  3811. nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  3812. @lv_number.bitmap.blt(@lv_number_cw * r, 0, @lv_number_image, nsrc_rect)
  3813. end
  3814. cx = (number_value.size * @lv_number_cw)
  3815. case LEVEL_NUMBER_ALIGN_TYPE
  3816. when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  3817. when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  3818. when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  3819. end
  3820. end
  3821.  
  3822. #--------------------------------------------------------------------------
  3823. # * Update Level
  3824. #--------------------------------------------------------------------------
  3825. def update_level
  3826. if @lv_number != nil
  3827. refresh_level_number if @old_level != @actor.level
  3828. end
  3829. end
  3830.  
  3831. end
  3832.  
  3833. #==============================================================================
  3834. #==============================================================================
  3835. # ** Battle Hud EX
  3836. #==============================================================================
  3837. #==============================================================================
  3838. class Battle_Hud_EX
  3839.  
  3840. #--------------------------------------------------------------------------
  3841. # * Create States
  3842. #--------------------------------------------------------------------------
  3843. def create_states(viewport)
  3844. return if !STATES_VISIBLE
  3845. @status_old = nil
  3846. @status_flow = [-24,0]
  3847. @status = Sprite.new
  3848. @status.bitmap = Bitmap.new(24,24)
  3849. @status.x = @hud_position[0] + STATES_POSITION[0]
  3850. @status.y = @hud_position[1] + STATES_POSITION[1]
  3851. @status.z = HUD_Z + STATES_Z
  3852. @status.angle = STATE_ANGLE
  3853. @status.viewport = viewport
  3854. end
  3855.  
  3856. #--------------------------------------------------------------------------
  3857. # * Refresh States
  3858. #--------------------------------------------------------------------------
  3859. def refresh_states
  3860. check_icon_image
  3861. @status_old = @actor.states
  3862. @status_flow = [0,0]
  3863. @actor_status.dispose if @actor_status != nil
  3864. @states_size = @actor.states.size > 0 ? (26 * @actor.states.size) : 24
  3865. @actor_status = Bitmap.new(@states_size,24)
  3866. index = 0
  3867. for i in @actor.states
  3868. rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  3869. @actor_status.blt(26 * index , 0, @icon_image, rect)
  3870. @status.x = @hud_position[0] + STATES_POSITION[0] - 24
  3871. index += 1
  3872. end
  3873. end
  3874.  
  3875. #--------------------------------------------------------------------------
  3876. # * Flow_Status
  3877. #--------------------------------------------------------------------------
  3878. def flow_states
  3879. return if @actor_status == nil
  3880. @status.bitmap.clear
  3881. return if @actor.states.size == 0
  3882. st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  3883. @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  3884. if STATES_SCROLLING_ANIMATION
  3885. @status_flow[0] += 1
  3886. @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  3887. else
  3888. @status_flow[1] += 1 unless @actor.states.size <= 1
  3889. if @status_flow[1] > 30
  3890. @status_flow[1] = 0
  3891. @status_flow[0] += 26
  3892. @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  3893. end
  3894. end
  3895. end
  3896.  
  3897. #--------------------------------------------------------------------------
  3898. # * Update States
  3899. #--------------------------------------------------------------------------
  3900. def update_states
  3901. return if @status == nil
  3902. refresh_states if @status_old != @actor.states
  3903. flow_states
  3904. end
  3905.  
  3906. end
  3907.  
  3908. #==============================================================================
  3909. #==============================================================================
  3910. # ** Battle Hud EX
  3911. #==============================================================================
  3912. #==============================================================================
  3913. class Battle_Hud_EX
  3914.  
  3915. #--------------------------------------------------------------------------
  3916. # * Create Face
  3917. #--------------------------------------------------------------------------
  3918. def create_face(viewport)
  3919. return if !FACE_VISIBLE
  3920. @face_old_hp = @actor.hp
  3921. @face_old_mp = @actor.mp
  3922. @face_old_tp = @actor.tp
  3923. @face_name = ""
  3924. @face = Sprite.new
  3925. @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  3926. @face.x = @face_org[0]
  3927. @face.y = @face_org[1]
  3928. @face.z = HUD_Z + FACE_Z
  3929. @face.viewport = viewport
  3930. refresh_face_name
  3931. end
  3932.  
  3933. #--------------------------------------------------------------------------
  3934. # * Refresh Face Name
  3935. #--------------------------------------------------------------------------
  3936. def refresh_face_name
  3937. @face_name = @actor.name
  3938. @face_image.dispose if @face_image != nil
  3939. @face.bitmap.dispose if @face.bitmap != nil
  3940. return if @actor.name == nil or @actor.name == ""
  3941. @face_image = Cache.battle_hud(@actor.name + "_Face") rescue nil
  3942. @face_image = Bitmap.new(32,32) if @face_image == nil
  3943. @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  3944. @face_ch = @face_image.height
  3945. @face.ox = @face_cw / 2
  3946. @face.oy = @face_ch / 2
  3947. @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  3948. @face_org = [@hud_position[0] + FACE_POSITION[0],
  3949. @hud_position[1] + @face.oy + FACE_POSITION[1]]
  3950. if $game_temp.battler_face_pos[@actor_index] == nil
  3951. $game_temp.battler_face_pos[@actor_index] = []
  3952. end
  3953. @face.x = @face_org[0]
  3954. @face.y = @face_org[1]
  3955. limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  3956. @face.y = Graphics.height - (@face_image.height - @face.oy) if limit_Y > Graphics.height
  3957. $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  3958. $game_temp.battler_face_pos[@actor_index][1] = @face_org[1]
  3959. $game_temp.battler_face_pos[@actor_index][2] = @face.z
  3960. clear_face_index
  3961. end
  3962.  
  3963. #--------------------------------------------------------------------------
  3964. # * Refresh Face
  3965. #--------------------------------------------------------------------------
  3966. def refresh_face
  3967. @face.mirror = false
  3968. @face.zoom_x = 1.00
  3969. @face.zoom_y = 1.00
  3970. @face_index = @actor.face_animation[1]
  3971. @face_index = 0 if !FACE_ANIMATION
  3972. @face.bitmap.clear
  3973. f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  3974. @face.bitmap.blt(0,0,@face_image,f_scr)
  3975. end
  3976.  
  3977. #--------------------------------------------------------------------------
  3978. # * Update Face Duration
  3979. #--------------------------------------------------------------------------
  3980. def update_face_duration
  3981. return if @actor.face_animation[0] == 0
  3982. @actor.face_animation[0] -= 1
  3983. update_face_shake_effect
  3984. update_face_zoom if @actor.face_animation[1] == 2
  3985. return if @actor.face_animation[0] > 0
  3986. clear_face_index
  3987. end
  3988.  
  3989. #--------------------------------------------------------------------------
  3990. # * Clear Face Index
  3991. #--------------------------------------------------------------------------
  3992. def clear_face_index
  3993. @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  3994. @actor.face_animation[1] = 4 if @actor.dead?
  3995. refresh_face
  3996. end
  3997.  
  3998. #--------------------------------------------------------------------------
  3999. # * Update Face Zoom
  4000. #--------------------------------------------------------------------------
  4001. def update_face_zoom
  4002. return if !FACE_ZOOM_ANIMATION
  4003. case @actor.face_animation[0]
  4004. when 30..60
  4005. @face.zoom_x += 0.01
  4006. @face.mirror = true unless !FACE_ANIMATION
  4007. when 1..29
  4008. @face.zoom_x -= 0.01
  4009. @face.mirror = false
  4010. else
  4011. @face.zoom_x = 1.00
  4012. @face.mirror = false
  4013. end
  4014. @face.zoom_y = @face.zoom_x
  4015. end
  4016.  
  4017. #--------------------------------------------------------------------------
  4018. # * Can Refresh Index MP TP?
  4019. #--------------------------------------------------------------------------
  4020. def can_refresh_index_mp_tp?
  4021. return true if @face_old_mp != @actor.mp
  4022. return false
  4023. end
  4024.  
  4025. #--------------------------------------------------------------------------
  4026. # * Refresh Face Index HP
  4027. #--------------------------------------------------------------------------
  4028. def refresh_face_index_hp
  4029. @actor.face_animation[0] = FACE_ANIMATION_DURATION
  4030. @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  4031. @face_old_hp = @actor.hp
  4032. end
  4033.  
  4034. #--------------------------------------------------------------------------
  4035. # * Refresh Face Index MP TP
  4036. #--------------------------------------------------------------------------
  4037. def refresh_face_index_mp_tp
  4038. @actor.face_animation[0] = FACE_ANIMATION_DURATION
  4039. @actor.face_animation[1] = 1 if @face_old_mp < @actor.mp
  4040. @face_old_mp = @actor.mp
  4041. @face_old_tp = @actor.tp
  4042. end
  4043.  
  4044. #--------------------------------------------------------------------------
  4045. # * Update Face Shake Effect
  4046. #--------------------------------------------------------------------------
  4047. def update_face_shake_effect
  4048. return if !FACE_SHAKE_EFFECT
  4049. if FACE_ANIMATION
  4050. update_shake_animated_face
  4051. else
  4052. update_shake_still_face
  4053. end
  4054. end
  4055.  
  4056. #--------------------------------------------------------------------------
  4057. # * Update Shake Still Effect Face
  4058. #--------------------------------------------------------------------------
  4059. def update_shake_still_face
  4060. if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  4061. @face.x = @face_org[0] - 4 + rand(8)
  4062. else
  4063. @face.x = @face_org[0]
  4064. end
  4065. end
  4066.  
  4067. #--------------------------------------------------------------------------
  4068. # * Update Shake Animated Face
  4069. #--------------------------------------------------------------------------
  4070. def update_shake_animated_face
  4071. if @actor.face_animation[0] == 0
  4072. @face.x = @face_org[0]
  4073. return
  4074. end
  4075. if @actor.face_animation[1] == 3 and @actor.hp > 0
  4076. @face.x = @face_org[0] - 4 + rand(8)
  4077. else
  4078. @face.x = @face_org[0]
  4079. end
  4080. end
  4081.  
  4082. #--------------------------------------------------------------------------
  4083. # * Update Face
  4084. #--------------------------------------------------------------------------
  4085. def update_face
  4086. return if @face == nil
  4087. refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  4088. update_face_duration
  4089. return if !FACE_ANIMATION
  4090. refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  4091. refresh_face_index_hp if @face_old_hp != @actor.hp
  4092. refresh_face if @face_index != @actor.face_animation[1]
  4093. end
  4094.  
  4095. end
  4096.  
  4097. #==============================================================================
  4098. # ■ Battle Manager
  4099. #==============================================================================
  4100. class << BattleManager
  4101.  
  4102. #--------------------------------------------------------------------------
  4103. # ● Battle End
  4104. #--------------------------------------------------------------------------
  4105. alias mog_battle_hud_battle_process_victory process_victory
  4106. def process_victory
  4107. execute_face_effect
  4108. mog_battle_hud_battle_process_victory
  4109. end
  4110.  
  4111. #--------------------------------------------------------------------------
  4112. # ● Prepare
  4113. #--------------------------------------------------------------------------
  4114. def execute_face_effect
  4115. $game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
  4116. for i in $game_party.members
  4117. i.face_animation = [120,1,0] if i.hp > 0
  4118. end
  4119. end
  4120.  
  4121. end
  4122.  
  4123. #==============================================================================
  4124. # ** Scene Battle
  4125. #==============================================================================
  4126. class Scene_Battle < Scene_Base
  4127.  
  4128. #--------------------------------------------------------------------------
  4129. # * Use Item
  4130. #--------------------------------------------------------------------------
  4131. alias mog_monogatari_use_item use_item
  4132. def use_item
  4133. execute_face_animation
  4134. mog_monogatari_use_item
  4135. end
  4136.  
  4137. #--------------------------------------------------------------------------
  4138. # * Execute Face Animation
  4139. #--------------------------------------------------------------------------
  4140. def execute_face_animation
  4141. return if @subject.is_a?(Game_Enemy)
  4142. @subject.face_animation = [60 ,2,0]
  4143. end
  4144.  
  4145. end
  4146.  
  4147. #==============================================================================
  4148. #==============================================================================
  4149. # ** Battle Hud EX
  4150. #==============================================================================
  4151. #==============================================================================
  4152. class Battle_Hud_EX
  4153.  
  4154. #--------------------------------------------------------------------------
  4155. # * Dispose
  4156. #--------------------------------------------------------------------------
  4157. def dispose
  4158. terminate
  4159. dispose_layout
  4160. dispose_layout_2
  4161. dispose_name
  4162. dispose_face
  4163. dispose_hp_number
  4164. dispose_hp_number_max
  4165. dispose_hp_meter
  4166. dispose_hp_icon
  4167. dispose_hp_icon_ex
  4168. dispose_hp_icon_number
  4169. dispose_mp_number
  4170. dispose_mp_number_max
  4171. dispose_mp_meter
  4172. dispose_mp_icon
  4173. dispose_mp_icon_ex
  4174. dispose_mp_icon_number
  4175. dispose_tp_number
  4176. dispose_tp_number_max
  4177. dispose_tp_meter
  4178. dispose_tp_icon
  4179. dispose_tp_icon_ex
  4180. dispose_tp_icon_number
  4181. dispose_at_number
  4182. dispose_at_number_max
  4183. dispose_at_meter
  4184. dispose_lv_number
  4185. dispose_states
  4186. end
  4187.  
  4188. #--------------------------------------------------------------------------
  4189. # * Dispose Layout
  4190. #--------------------------------------------------------------------------
  4191. def dispose_layout
  4192. return if @layout == nil
  4193. @layout.dispose
  4194. @layout = nil
  4195. end
  4196.  
  4197. #--------------------------------------------------------------------------
  4198. # * Dispose Layout 2
  4199. #--------------------------------------------------------------------------
  4200. def dispose_layout_2
  4201. return if @layout2 == nil
  4202. @layout2.dispose
  4203. @layout2 = nil
  4204. end
  4205.  
  4206. #--------------------------------------------------------------------------
  4207. # * Dispose Name
  4208. #--------------------------------------------------------------------------
  4209. def dispose_name
  4210. return if @name == nil
  4211. @name.bitmap.dispose
  4212. @name.dispose
  4213. @name = nil
  4214. end
  4215.  
  4216. #--------------------------------------------------------------------------
  4217. # * Dispose Face
  4218. #--------------------------------------------------------------------------
  4219. def dispose_face
  4220. return if @face == nil
  4221. @face.bitmap.dispose if @face.bitmap != nil
  4222. @face.dispose
  4223. @face = nil
  4224. @face_image.dispose if @face_image != nil
  4225. end
  4226.  
  4227. #--------------------------------------------------------------------------
  4228. # * Dispose HP Number
  4229. #--------------------------------------------------------------------------
  4230. def dispose_hp_number
  4231. return if @hp_number == nil
  4232. @hp_number.bitmap.dispose
  4233. @hp_number.dispose
  4234. @hp_number = nil
  4235. end
  4236.  
  4237. #--------------------------------------------------------------------------
  4238. # * Dispose HP Number Max
  4239. #--------------------------------------------------------------------------
  4240. def dispose_hp_number_max
  4241. return if @hp_number2 == nil
  4242. @hp_number2.bitmap.dispose
  4243. @hp_number2.dispose
  4244. @hp_number2 = nil
  4245. end
  4246.  
  4247. #--------------------------------------------------------------------------
  4248. # * Dispose HP Meter
  4249. #--------------------------------------------------------------------------
  4250. def dispose_hp_meter
  4251. return if @hp_meter == nil
  4252. @hp_meter.bitmap.dispose
  4253. @hp_meter.dispose
  4254. @hp_meter = nil
  4255. end
  4256.  
  4257. #--------------------------------------------------------------------------
  4258. # * Dispose HP Icon
  4259. #--------------------------------------------------------------------------
  4260. def dispose_hp_icon
  4261. return if @hp_icon == nil
  4262. @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  4263. @hp_icon.dispose
  4264. @hp_icon = nil
  4265. end
  4266.  
  4267. #--------------------------------------------------------------------------
  4268. # * Dispose HP Icon EX
  4269. #--------------------------------------------------------------------------
  4270. def dispose_hp_icon_ex
  4271. return if @hp_icon3 == nil
  4272. @hp_icon3.bitmap.dispose
  4273. @hp_icon3.dispose
  4274. @hp_icon3 = nil
  4275. end
  4276.  
  4277. #--------------------------------------------------------------------------
  4278. # * Dispose HP Icon Number
  4279. #--------------------------------------------------------------------------
  4280. def dispose_hp_icon_number
  4281. return if @hp_icon_number == nil
  4282. @hp_icon_number.bitmap.dispose
  4283. @hp_icon_number.dispose
  4284. @hp_icon_number = nil
  4285. end
  4286.  
  4287. #--------------------------------------------------------------------------
  4288. # * Dispose MP Number
  4289. #--------------------------------------------------------------------------
  4290. def dispose_mp_number
  4291. return if @mp_number == nil
  4292. @mp_number.bitmap.dispose
  4293. @mp_number.dispose
  4294. @mp_number = nil
  4295. end
  4296.  
  4297. #--------------------------------------------------------------------------
  4298. # * Dispose MP Number Max
  4299. #--------------------------------------------------------------------------
  4300. def dispose_mp_number_max
  4301. return if @mp_number2 == nil
  4302. @mp_number2.bitmap.dispose
  4303. @mp_number2.dispose
  4304. @mp_number2 = nil
  4305. end
  4306.  
  4307. #--------------------------------------------------------------------------
  4308. # * Dispose MP Meter
  4309. #--------------------------------------------------------------------------
  4310. def dispose_mp_meter
  4311. return if @mp_meter == nil
  4312. @mp_meter.bitmap.dispose
  4313. @mp_meter.dispose
  4314. @mp_meter = nil
  4315. end
  4316.  
  4317. #--------------------------------------------------------------------------
  4318. # * Dispose MP Icon
  4319. #--------------------------------------------------------------------------
  4320. def dispose_mp_icon
  4321. return if @mp_icon == nil
  4322. @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  4323. @mp_icon.dispose
  4324. @mp_icon = nil
  4325. end
  4326.  
  4327. #--------------------------------------------------------------------------
  4328. # * Dispose MP Icon EX
  4329. #--------------------------------------------------------------------------
  4330. def dispose_mp_icon_ex
  4331. return if @mp_icon3 == nil
  4332. @mp_icon3.bitmap.dispose
  4333. @mp_icon3.dispose
  4334. @mp_icon3 = nil
  4335. end
  4336.  
  4337. #--------------------------------------------------------------------------
  4338. # * Dispose MP Icon Number
  4339. #--------------------------------------------------------------------------
  4340. def dispose_mp_icon_number
  4341. return if @mp_icon_number == nil
  4342. @mp_icon_number.bitmap.dispose
  4343. @mp_icon_number.dispose
  4344. @mp_icon_number = nil
  4345. end
  4346.  
  4347. #--------------------------------------------------------------------------
  4348. # * Dispose TP Number
  4349. #--------------------------------------------------------------------------
  4350. def dispose_tp_number
  4351. return if @tp_number == nil
  4352. @tp_number.bitmap.dispose
  4353. @tp_number.dispose
  4354. @tp_number = nil
  4355. end
  4356.  
  4357. #--------------------------------------------------------------------------
  4358. # * Dispose TP Number Max
  4359. #--------------------------------------------------------------------------
  4360. def dispose_tp_number_max
  4361. return if @tp_number2 == nil
  4362. @tp_number2.bitmap.dispose
  4363. @tp_number2.dispose
  4364. @tp_number2 = nil
  4365. end
  4366.  
  4367. #--------------------------------------------------------------------------
  4368. # * Dispose TP Meter
  4369. #--------------------------------------------------------------------------
  4370. def dispose_tp_meter
  4371. return if @tp_meter == nil
  4372. @tp_meter.bitmap.dispose
  4373. @tp_meter.dispose
  4374. @tp_meter = nil
  4375. end
  4376.  
  4377. #--------------------------------------------------------------------------
  4378. # * Dispose TP Icon
  4379. #--------------------------------------------------------------------------
  4380. def dispose_tp_icon
  4381. return if @tp_icon == nil
  4382. @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  4383. @tp_icon.dispose
  4384. @tp_icon = nil
  4385. end
  4386.  
  4387. #--------------------------------------------------------------------------
  4388. # * Dispose TP Icon EX
  4389. #--------------------------------------------------------------------------
  4390. def dispose_tp_icon_ex
  4391. return if @tp_icon3 == nil
  4392. @tp_icon3.bitmap.dispose
  4393. @tp_icon3.dispose
  4394. @tp_icon3 = nil
  4395. end
  4396.  
  4397. #--------------------------------------------------------------------------
  4398. # * Dispose TP Icon Number
  4399. #--------------------------------------------------------------------------
  4400. def dispose_tp_icon_number
  4401. return if @tp_icon_number == nil
  4402. @tp_icon_number.bitmap.dispose
  4403. @tp_icon_number.dispose
  4404. @tp_icon_numbe = nil
  4405. end
  4406.  
  4407. #--------------------------------------------------------------------------
  4408. # * Dispose AT Number
  4409. #--------------------------------------------------------------------------
  4410. def dispose_at_number
  4411. return if @at_number == nil
  4412. @at_number.bitmap.dispose
  4413. @at_number.dispose
  4414. @at_number = nil
  4415. end
  4416.  
  4417. #--------------------------------------------------------------------------
  4418. # * Dispose AT Number Max
  4419. #--------------------------------------------------------------------------
  4420. def dispose_at_number_max
  4421. return if @at_number2 == nil
  4422. @at_number2.bitmap.dispose
  4423. @at_number2.dispose
  4424. @at_number2 = nil
  4425. end
  4426.  
  4427. #--------------------------------------------------------------------------
  4428. # * Dispose AT Meter
  4429. #--------------------------------------------------------------------------
  4430. def dispose_at_meter
  4431. return if @at_meter == nil
  4432. @at_meter.bitmap.dispose
  4433. @at_meter.dispose
  4434. @at_meter = nil
  4435. end
  4436.  
  4437. #--------------------------------------------------------------------------
  4438. # * Dispose Lv Number
  4439. #--------------------------------------------------------------------------
  4440. def dispose_lv_number
  4441. return if @lv_number == nil
  4442. @lv_number.bitmap.dispose
  4443. @lv_number.dispose
  4444. @lv_number = nil
  4445. end
  4446.  
  4447. #--------------------------------------------------------------------------
  4448. # * Dispose States
  4449. #--------------------------------------------------------------------------
  4450. def dispose_states
  4451. return if @status == nil
  4452. @status.bitmap.dispose if @status.bitmap != nil
  4453. @status.dispose
  4454. @actor_status.dispose if @actor_status != nil
  4455. @status = nil
  4456. end
  4457.  
  4458. end
  4459.  
  4460. #==============================================================================
  4461. #==============================================================================
  4462. # ** Battle Hud EX
  4463. #==============================================================================
  4464. #==============================================================================
  4465. class Battle_Hud_EX
  4466.  
  4467. #--------------------------------------------------------------------------
  4468. # * Update
  4469. #--------------------------------------------------------------------------
  4470. def update
  4471. return if @actor == nil
  4472. update_layout
  4473. update_layout_2
  4474. update_name
  4475. update_face
  4476. update_hp
  4477. update_mp
  4478. update_tp
  4479. update_at
  4480. update_level
  4481. update_states
  4482. end
  4483.  
  4484. end
Advertisement
Add Comment
Please, Sign In to add comment