Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 242.70 KB | None | 0 0
  1. #==============================================================================
  2. # +++ MOG - Battle Hud EX (v6.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # https://atelierrgss.wordpress.com/
  6. #==============================================================================
  7. #
  8. # Coloque as imagens da hud na pasta.
  9. #
  10. # Graphics/Huds/Battle/
  11. #==============================================================================
  12. # Para ocultar ou apresentar a hud de batalha use o código abaixo.
  13. #
  14. # battle_hud_visible(false)
  15. #
  16. # ou
  17. #
  18. # battle_hud_visible(true)
  19. #
  20. #==============================================================================
  21. # Para mudar o sprite da face do battler use o código abaixo.
  22. #==============================================================================
  23. #
  24. # battler_face_name( ACTOR_ID, FIlE_NAME )
  25. #
  26. #==============================================================================
  27.  
  28. #==============================================================================
  29. # Atualizações desta versão.
  30. #==============================================================================
  31. # (ver 6.6)
  32. # - Correção do Crash caso optar por desativar o layout das janelas.
  33. # (ver 6.5)
  34. # - Melhoria no cálculo da posição Z.
  35. # - Correção de travar o menu.
  36. # (ver 6.4)
  37. # - Correção do glitch de aparecer um pedaço da Windowskin quando se
  38. # usa mais de 4 battlers na batalha.
  39. # (ver 6.3)
  40. # - Compatibilidade com o MOG Battle Camera.
  41. # (ver 6.2)
  42. # - Refresh da hud ao trocar a posição dos personagens.
  43. # (ver 6.0)
  44. # - Adição da camada da tela.
  45. # - Adição do efeito Slide.
  46. # - Adição de novas opções referente a fonte.
  47. #==============================================================================
  48.  
  49. $imported = {} if $imported.nil?
  50. $imported[:mog_battle_hud_ex] = true
  51.  
  52. module MOG_BATTLE_HUD_EX
  53.  
  54. #============================================================================
  55. #============================================================================
  56. # * HUD SPRITE (GENERAL)
  57. #============================================================================
  58. # Definição da quantidade maxima de personagens na batalha.
  59. #---------------------------------------------------------------------------
  60. MAX_BATTLE_MEMBERS = 5
  61. #---------------------------------------------------------------------------
  62. # Definição da prioridade da hud.
  63. #---------------------------------------------------------------------------
  64. HUD_Z = 110
  65. #---------------------------------------------------------------------------
  66. # Definição da posição geral da hud, influência em todos os sprites da hud.
  67. #---------------------------------------------------------------------------
  68. HUD_POSITION = [-20,333]
  69. #---------------------------------------------------------------------------
  70. # Definição do espaço entre os membros do grupo.
  71. # (Use apenas para ajustes)
  72. #---------------------------------------------------------------------------
  73. MEMBERS_SPACE = [0,0]
  74. #---------------------------------------------------------------------------
  75. # Definição fixa da hud se deseja posicionar a hud em lugares
  76. # específicos da tela.
  77. #
  78. # FIXED_POSITION[INDEX_ID] = [X,Y]
  79. #
  80. #---------------------------------------------------------------------------
  81. FIXED_HUD_POSITION = []
  82. #FIXED_HUD_POSITION[0] = [70,295]
  83. #FIXED_HUD_POSITION[1] = [191,360]
  84. #FIXED_HUD_POSITION[2] = [322,295]
  85. #FIXED_HUD_POSITION[3] = [453 ,360]
  86. #FIXED_HUD_POSITION[3] = [453 ,360]
  87.  
  88. FIXED_HUD_POSITION[0] = [80,295]
  89. FIXED_HUD_POSITION[1] = [270,295]
  90. FIXED_HUD_POSITION[2] = [450,295]
  91. FIXED_HUD_POSITION[3] = [190 ,365]
  92. FIXED_HUD_POSITION[4] = [350 ,365]
  93.  
  94.  
  95. #---------------------------------------------------------------------------
  96. # Definição da posição do comando quando a opção de janelas fixa é ativada.
  97. #---------------------------------------------------------------------------
  98. FIXED_COMMAND_POSITION = []
  99. #FIXED_COMMAND_POSITION[0] = [130,10]
  100. # FIXED_COMMAND_POSITION[1] = [300,10]
  101. # FIXED_COMMAND_POSITION[2] = [130,290]
  102. # FIXED_COMMAND_POSITION[3] = [300,290]
  103. #---------------------------------------------------------------------------
  104. # Ocultar a HUD quando a janela de mensagem está ativa.
  105. #---------------------------------------------------------------------------
  106. MESSAGE_WINDOW_FADE_HUD = true
  107. #---------------------------------------------------------------------------
  108. # Definição da porcentagem do parâmetro baixo, isso influência na cor
  109. # do número dos parâmetros de HP, MP e TP.
  110. #---------------------------------------------------------------------------
  111. LOW_PARAMETER_PERCENTAGE = 30
  112. #============================================================================
  113. #============================================================================
  114.  
  115.  
  116. #============================================================================
  117. #============================================================================
  118. # * NAME
  119. #============================================================================
  120. # Ativar o Sprite do nome do personagem.
  121. #---------------------------------------------------------------------------
  122. NAME_VISIBLE = true
  123. #---------------------------------------------------------------------------
  124. # Definição da prioridade do Sprite.
  125. #---------------------------------------------------------------------------
  126. NAME_Z = 5
  127. #---------------------------------------------------------------------------
  128. # Definição da posição da Face. [X,Y]
  129. #---------------------------------------------------------------------------
  130. NAME_POSITION = [-20,-27]
  131. #---------------------------------------------------------------------------
  132. # Definição do tipo alinhamento do nome.
  133. #
  134. # 0 - Esquerda
  135. # 1 - Centro
  136. # 2 - Direita
  137. #---------------------------------------------------------------------------
  138. NAME_ALIGN_TYPE = 0
  139. #---------------------------------------------------------------------------
  140. # Definição do tamanho da fonte.
  141. #---------------------------------------------------------------------------
  142. NAME_FONT_SIZE = 16
  143. #---------------------------------------------------------------------------
  144. # Ativar Bold.
  145. #---------------------------------------------------------------------------
  146. NAME_FONT_BOLD = true
  147. #---------------------------------------------------------------------------
  148. # Ativar Italic.
  149. #---------------------------------------------------------------------------
  150. NAME_FONT_ITALIC = true
  151. #---------------------------------------------------------------------------
  152. # Definição da cor da fonte
  153. #---------------------------------------------------------------------------
  154. NAME_FONT_COLOR = Color.new(255,255,255,255)
  155. #---------------------------------------------------------------------------
  156. # Ativar Sombra
  157. #---------------------------------------------------------------------------
  158. NAME_FONT_SHADOW = true
  159. #---------------------------------------------------------------------------
  160. # Definição da cor da sombra
  161. #---------------------------------------------------------------------------
  162. NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  163. #---------------------------------------------------------------------------
  164. # Definição da distância da sombra.
  165. #---------------------------------------------------------------------------
  166. NAME_FONT_SHADOW_POSITION = [2,2]
  167. #============================================================================
  168. #============================================================================
  169.  
  170.  
  171. #============================================================================
  172. #============================================================================
  173. # * FACE
  174. #============================================================================
  175. # Ativar a face.
  176. # Será necessário o arquivo.
  177. #
  178. # ACTOR_NAME + _Face.png
  179. #
  180. # Eric_Face.png
  181. #
  182. #---------------------------------------------------------------------------
  183. FACE_VISIBLE = true
  184. # Ativar as Faces representando os battlers.
  185. # Deixe "false" se tiver problemas de compatibilidade com scripts.
  186. FACE_BATTLER = true
  187. #---------------------------------------------------------------------------
  188. # Definição da prioridade do sprite.
  189. #---------------------------------------------------------------------------
  190. FACE_Z = 1
  191. #---------------------------------------------------------------------------
  192. # Definição da posição da Face. [X,Y]
  193. #---------------------------------------------------------------------------
  194. FACE_POSITION = [-30,-8]
  195. #---------------------------------------------------------------------------
  196. # Ativar faces animadas.
  197. # Será necessário ter uma imagem de 5 faces do personagem no mesmo arquivo.
  198. #
  199. # FACE1/FACE2/FACE3/FACE4
  200. #
  201. # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
  202. # a imagem será dividida por 1 frame
  203. #---------------------------------------------------------------------------
  204. FACE_ANIMATION = true
  205. #---------------------------------------------------------------------------
  206. # Ativar o efeito de Zoom quando o personagem usar alguma ação.
  207. #---------------------------------------------------------------------------
  208. FACE_ZOOM_ANIMATION = true
  209. #---------------------------------------------------------------------------
  210. # Ativar o efeito Mirror na animação de ação do personagem.
  211. #---------------------------------------------------------------------------
  212. FACE_ZOOM_MIRROR_EFFECT = false
  213. #---------------------------------------------------------------------------
  214. # Definição do tempo duração da animação da face.
  215. #---------------------------------------------------------------------------
  216. FACE_ANIMATION_DURATION = 40
  217. #---------------------------------------------------------------------------
  218. # Ativar o efeito tremor da face quando o personagem sofrer dano.
  219. #---------------------------------------------------------------------------
  220. FACE_SHAKE_EFFECT = true
  221. #============================================================================
  222. #============================================================================
  223.  
  224.  
  225. #============================================================================
  226. #============================================================================
  227. # * TURN (ACTIVE INDICATOR)
  228. #============================================================================
  229. # Ativar o indicador de turno do personagem.
  230. # Será necessário o arquivo.
  231. #
  232. # Turn.png
  233. #
  234. #---------------------------------------------------------------------------
  235. TURN_SPRITE_VISIBLE = true
  236. #---------------------------------------------------------------------------
  237. # Definição da prioridade do Sprite.
  238. #---------------------------------------------------------------------------
  239. TURN_SPRITE_Z = -1
  240. #---------------------------------------------------------------------------
  241. # Definição da posição do sprite de turno.
  242. #---------------------------------------------------------------------------
  243. TURN_SPRITE_POSITION = [-50,-7]
  244. #---------------------------------------------------------------------------
  245. # Ativar o efeito de animação de piscar.
  246. #---------------------------------------------------------------------------
  247. TURN_BLINK_EFFECT = true
  248. #---------------------------------------------------------------------------
  249.  
  250.  
  251. #============================================================================
  252. #============================================================================
  253. # * HP
  254. #============================================================================
  255. # Ativar o número de HP.
  256. # Será necessário o arquivo.
  257. #
  258. # HP_Number.png
  259. #
  260. #---------------------------------------------------------------------------
  261. HP_NUMBER_VISIBLE = true
  262. #---------------------------------------------------------------------------
  263. # Definição da prioridade do Sprite.
  264. #---------------------------------------------------------------------------
  265. HP_NUMBER_Z = 5
  266. #---------------------------------------------------------------------------
  267. # Definição da posição do número de HP. [X,Y]
  268. #---------------------------------------------------------------------------
  269. HP_NUMBER_POSITION = [73,1]
  270. #---------------------------------------------------------------------------
  271. # Ativar o número de HP Total.
  272. # Será necessário o arquivo.
  273. #
  274. # HP_Number_Max.png
  275. #
  276. #---------------------------------------------------------------------------
  277. HP_NUMBER_MAX_VISIBLE = false
  278. #---------------------------------------------------------------------------
  279. # Definição da posição do número de HP Total. [X,Y]
  280. #---------------------------------------------------------------------------
  281. HP_NUMBER_MAX_POSITION = [165,27]
  282. #---------------------------------------------------------------------------
  283. # Definição do tipo alinhamento do número.
  284. #
  285. # 0 - Esquerda
  286. # 1 - Centro
  287. # 2 - Direita
  288. #---------------------------------------------------------------------------
  289. HP_NUMBER_ALIGN_TYPE = 2
  290. #---------------------------------------------------------------------------
  291. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  292. #---------------------------------------------------------------------------
  293. HP_NUMBER_WAVE_ALIGN_EFFECT = false
  294. #---------------------------------------------------------------------------
  295. # Apresentar os números em porcentagem.
  296. #---------------------------------------------------------------------------
  297. HP_NUMBER_PERCENTAGE = false
  298. #---------------------------------------------------------------------------
  299. # Ativar números animados ("Rolantes").
  300. #---------------------------------------------------------------------------
  301. HP_NUMBER_ANIMATION = true
  302. #---------------------------------------------------------------------------
  303. # Ativar a cor do HP baixo.
  304. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  305. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  306. #
  307. # NORMAL_COLOR
  308. # LOW_PARAMETER_COLOR
  309. #
  310. # Caso definir a função como FALSE a imagem será dividida apenas como
  311. # 1 frame de altura.
  312. #---------------------------------------------------------------------------
  313. HP_NUMBER_LOW_COLOR = false
  314. #---------------------------------------------------------------------------
  315. # Ativar o medidor de HP.
  316. # Será necessário o arquivo.
  317. #
  318. # HP_Meter.png
  319. #
  320. #---------------------------------------------------------------------------
  321. HP_METER_VISIBLE = true
  322. #---------------------------------------------------------------------------
  323. # Definição da prioridade do sprite.
  324. #---------------------------------------------------------------------------
  325. HP_METER_Z = 4
  326. #---------------------------------------------------------------------------
  327. # Definição da posição do medidor de HP. [X,Y]
  328. #---------------------------------------------------------------------------
  329. HP_METER_POSITION = [27,5]
  330. #---------------------------------------------------------------------------
  331. # Definição do ângulo do medidor.
  332. #---------------------------------------------------------------------------
  333. HP_METER_ANGLE = 0
  334. #---------------------------------------------------------------------------
  335. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  336. # inverso.
  337. #---------------------------------------------------------------------------
  338. HP_METER_MIRROR_EFFECT = false
  339. #---------------------------------------------------------------------------
  340. # Ativar o efeito animado de dano no medidor.
  341. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  342. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  343. #
  344. # NORMAL_COLOR
  345. # DAMAGE_COLOR
  346. #
  347. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  348. #---------------------------------------------------------------------------
  349. HP_METER_REDUCTION_ANIMATION = true
  350. #---------------------------------------------------------------------------
  351. # Ativar o efeito animado do "medidor fluindo".
  352. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  353. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  354. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  355. #---------------------------------------------------------------------------
  356. HP_METER_GRADIENT_ANIMATION = false
  357. #---------------------------------------------------------------------------
  358. # Ativar HP em ícones.
  359. # Será necessário ter a imagem.
  360. #
  361. # HP_Icon.png
  362. #
  363. #---------------------------------------------------------------------------
  364. HP_ICON_VISIBLE = false
  365. #---------------------------------------------------------------------------
  366. # Definição da prioridade do Sprite.
  367. #---------------------------------------------------------------------------
  368. HP_ICON_Z = 1
  369. #---------------------------------------------------------------------------
  370. # Posição do ícone de HP.
  371. #---------------------------------------------------------------------------
  372. HP_ICON_POSITION = [60,10]
  373. #---------------------------------------------------------------------------
  374. # Ativar o sprite EX do ultimo ícone
  375. # Será necessário ter a imagem.
  376. #
  377. # HP_Icon_EX.png
  378. #
  379. #---------------------------------------------------------------------------
  380. HP_ICON_EX_VISIBLE = false
  381. #---------------------------------------------------------------------------
  382. # Posição do ícone Animado.
  383. #---------------------------------------------------------------------------
  384. HP_ICON_EX_POSITION = [0,0]
  385. #---------------------------------------------------------------------------
  386. # Ativar o efeito de Zoom do Sprite.
  387. #---------------------------------------------------------------------------
  388. HP_ICON_EX_ZOOM_EFFECT = true
  389. #---------------------------------------------------------------------------
  390. # Espaço entre os ícones.
  391. #---------------------------------------------------------------------------
  392. HP_ICON_SPACE = [-10,-10]
  393. #---------------------------------------------------------------------------
  394. # Definição da quantidade maxima de ícones na horizontal.
  395. #---------------------------------------------------------------------------
  396. HP_ICON_COL_MAX = 10
  397. #---------------------------------------------------------------------------
  398. # Definição da quantidade maxima de ícones na vertical.
  399. #---------------------------------------------------------------------------
  400. HP_ICON_ROW_MAX = 2
  401. #---------------------------------------------------------------------------
  402. # Ativar o número de HP de ícones.
  403. # Será necessário ter a imagem.
  404. #
  405. # HP_Icon_Number.png
  406. #
  407. #---------------------------------------------------------------------------
  408. HP_ICON_NUMBER_VISIBLE = false
  409. #---------------------------------------------------------------------------
  410. # Definição da prioridade do sprite.
  411. #---------------------------------------------------------------------------
  412. HP_ICON_NUMBER_Z = 4
  413. #---------------------------------------------------------------------------
  414. # Posição do número do ícone
  415. #---------------------------------------------------------------------------
  416. HP_ICON_NUMBER_POSITION = [33,22]
  417. #---------------------------------------------------------------------------
  418. # Definição do tipo alinhamento do número.
  419. #
  420. # 0 - Esquerda
  421. # 1 - Centro
  422. # 2 - Direita
  423. #---------------------------------------------------------------------------
  424. HP_ICON_NUMBER_ALIGN_TYPE = 1
  425. #============================================================================
  426. #============================================================================
  427.  
  428.  
  429. #============================================================================
  430. #============================================================================
  431. # * MP
  432. #============================================================================
  433. # Ativar o número de MP.
  434. # Será necessário o arquivo.
  435. #
  436. # MP_Number.png
  437. #
  438. #---------------------------------------------------------------------------
  439. MP_NUMBER_VISIBLE = true
  440. #---------------------------------------------------------------------------
  441. # Definição da prioridade do Sprite.
  442. #---------------------------------------------------------------------------
  443. MP_NUMBER_Z = 5
  444. #---------------------------------------------------------------------------
  445. # Definição da posição do número de MP. [X,Y]
  446. #---------------------------------------------------------------------------
  447. MP_NUMBER_POSITION = [73,15]
  448. #---------------------------------------------------------------------------
  449. # Ativar o número de MP Total.
  450. # Será necessário o arquivo.
  451. #
  452. # MP_Number_Max.png
  453. #
  454. #---------------------------------------------------------------------------
  455. MP_NUMBER_MAX_VISIBLE = false
  456. #---------------------------------------------------------------------------
  457. # Definição da posição do número de MP Total. [X,Y]
  458. #---------------------------------------------------------------------------
  459. MP_NUMBER_MAX_POSITION = [128,53]
  460. #---------------------------------------------------------------------------
  461. # Definição do tipo alinhamento do número.
  462. #
  463. # 0 - Esquerda
  464. # 1 - Centro
  465. # 2 - Direita
  466. #---------------------------------------------------------------------------
  467. MP_NUMBER_ALIGN_TYPE = 2
  468. #---------------------------------------------------------------------------
  469. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  470. #---------------------------------------------------------------------------
  471. MP_NUMBER_WAVE_ALIGN_EFFECT = false
  472. #---------------------------------------------------------------------------
  473. # Apresentar os números em porcentagem.
  474. #---------------------------------------------------------------------------
  475. MP_NUMBER_PERCENTAGE = false
  476. #---------------------------------------------------------------------------
  477. # Ativar números animados ("Rolantes").
  478. #---------------------------------------------------------------------------
  479. MP_NUMBER_ANIMATION = true
  480. #---------------------------------------------------------------------------
  481. # Ativar a cor do MP baixo.
  482. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  483. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  484. #
  485. # NORMAL_COLOR
  486. # LOW_PARAMETER_COLOR
  487. #
  488. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  489. #---------------------------------------------------------------------------
  490. MP_NUMBER_LOW_COLOR = false
  491. #---------------------------------------------------------------------------
  492. # Ativar o medidor de MP.
  493. # Será necessário o arquivo.
  494. #
  495. # MP_Meter.png
  496. #
  497. #---------------------------------------------------------------------------
  498. MP_METER_VISIBLE = true
  499. #---------------------------------------------------------------------------
  500. # Definição da prioridade do sprite.
  501. #---------------------------------------------------------------------------
  502. MP_METER_Z = 4
  503. #---------------------------------------------------------------------------
  504. # Definição da posição do medidor de MP. [X,Y]
  505. #---------------------------------------------------------------------------
  506. MP_METER_POSITION = [27,19]
  507. #---------------------------------------------------------------------------
  508. # Definição do ângulo do medidor.
  509. #---------------------------------------------------------------------------
  510. MP_METER_ANGLE = 0
  511. #---------------------------------------------------------------------------
  512. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  513. # inverso.
  514. #---------------------------------------------------------------------------
  515. MP_METER_MIRROR_EFFECT = false
  516. #---------------------------------------------------------------------------
  517. # Ativar o efeito animado de dano no medidor.
  518. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  519. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  520. #
  521. # NORMAL_COLOR
  522. # DAMAGE_COLOR
  523. #
  524. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  525. #---------------------------------------------------------------------------
  526. MP_METER_REDUCTION_ANIMATION = true
  527. #---------------------------------------------------------------------------
  528. # Ativar o efeito animado do "medidor fluindo".
  529. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  530. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  531. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  532. #---------------------------------------------------------------------------
  533. MP_METER_GRADIENT_ANIMATION = false
  534. #---------------------------------------------------------------------------
  535. # Ativar MP em ícones.
  536. # Será necessário ter a imagem.
  537. #
  538. # MP_Icon.png
  539. #
  540. #---------------------------------------------------------------------------
  541. MP_ICON_VISIBLE = false
  542. #---------------------------------------------------------------------------
  543. # Definição da prioridade do Sprite.
  544. #---------------------------------------------------------------------------
  545. MP_ICON_Z = 1
  546. #---------------------------------------------------------------------------
  547. # Posição do ícone de MP.
  548. #---------------------------------------------------------------------------
  549. MP_ICON_POSITION = [92,30]
  550. #---------------------------------------------------------------------------
  551. # Ativar o sprite EX do ultimo ícone
  552. # Será necessário ter a imagem.
  553. #
  554. # MP_Icon_EX.png
  555. #
  556. #---------------------------------------------------------------------------
  557. MP_ICON_EX_VISIBLE = false
  558. #---------------------------------------------------------------------------
  559. # Posição do ícone Animado.
  560. #---------------------------------------------------------------------------
  561. MP_ICON_EX_POSITION = [0,0]
  562. #---------------------------------------------------------------------------
  563. # Ativar o efeito de Zoom do Sprite.
  564. #---------------------------------------------------------------------------
  565. MP_ICON_EX_ZOOM_EFFECT = true
  566. #---------------------------------------------------------------------------
  567. # Espaço entre os ícones.
  568. #---------------------------------------------------------------------------
  569. MP_ICON_SPACE = [3,3]
  570. #---------------------------------------------------------------------------
  571. # Definição da quantidade maxima de ícones na horizontal.
  572. #---------------------------------------------------------------------------
  573. MP_ICON_COL_MAX = 15
  574. #---------------------------------------------------------------------------
  575. # Definição da quantidade maxima de ícones na vertical.
  576. #---------------------------------------------------------------------------
  577. MP_ICON_ROW_MAX = 1
  578. #---------------------------------------------------------------------------
  579. # Ativar o número de MP de ícones.
  580. # Será necessário ter a imagem.
  581. #
  582. # MP_Icon_Number.png
  583. #
  584. #---------------------------------------------------------------------------
  585. MP_ICON_NUMBER_VISIBLE = false
  586. #---------------------------------------------------------------------------
  587. # Definição da prioridade do sprite.
  588. #---------------------------------------------------------------------------
  589. MP_ICON_NUMBER_Z = 4
  590. #---------------------------------------------------------------------------
  591. # Posição do número do ícone
  592. #---------------------------------------------------------------------------
  593. MP_ICON_NUMBER_POSITION = [75,65]
  594. #---------------------------------------------------------------------------
  595. # Definição do tipo alinhamento do número.
  596. #
  597. # 0 - Esquerda
  598. # 1 - Centro
  599. # 2 - Direita
  600. #---------------------------------------------------------------------------
  601. MP_ICON_NUMBER_ALIGN_TYPE = 1
  602. #============================================================================
  603. #============================================================================
  604.  
  605.  
  606. #============================================================================
  607. #============================================================================
  608. # * TP
  609. #============================================================================
  610. # Ativar o número de TP.
  611. # Será necessário o arquivo.
  612. #
  613. # TP_Number.png
  614. #
  615. #---------------------------------------------------------------------------
  616. TP_NUMBER_VISIBLE = true
  617. #---------------------------------------------------------------------------
  618. # Definição da prioridade do sprite.
  619. #---------------------------------------------------------------------------
  620. TP_NUMBER_Z = 5
  621. #---------------------------------------------------------------------------
  622. # Definição da posição do número de TP. [X,Y]
  623. #---------------------------------------------------------------------------
  624. TP_NUMBER_POSITION = [73,29]
  625. #---------------------------------------------------------------------------
  626. # Ativar o número de TP Total.
  627. # Será necessário o arquivo.
  628. #
  629. # TP_Number_Max.png
  630. #
  631. #---------------------------------------------------------------------------
  632. TP_NUMBER_MAX_VISIBLE = false
  633. #---------------------------------------------------------------------------
  634. # Definição da posição do número de TP Total. [X,Y]
  635. #---------------------------------------------------------------------------
  636. TP_NUMBER_MAX_POSITION = [160,73]
  637. #---------------------------------------------------------------------------
  638. # Definição do tipo alinhamento do número.
  639. #
  640. # 0 - Esquerda
  641. # 1 - Centro
  642. # 2 - Direita
  643. #---------------------------------------------------------------------------
  644. TP_NUMBER_ALIGN_TYPE = 2
  645. #---------------------------------------------------------------------------
  646. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  647. #---------------------------------------------------------------------------
  648. TP_NUMBER_WAVE_ALIGN_EFFECT = false
  649. #---------------------------------------------------------------------------
  650. # Apresentar os números em porcentagem.
  651. #---------------------------------------------------------------------------
  652. TP_NUMBER_PERCENTAGE = false
  653. #---------------------------------------------------------------------------
  654. # Ativar números animados ("Rolantes").
  655. #---------------------------------------------------------------------------
  656. TP_NUMBER_ANIMATION = true
  657. #---------------------------------------------------------------------------
  658. # Ativar a cor do TP baixo.
  659. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  660. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  661. #
  662. # NORMAL_COLOR
  663. # LOW_PARAMETER_COLOR
  664. #
  665. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  666. #---------------------------------------------------------------------------
  667. TP_NUMBER_LOW_COLOR = false
  668. #---------------------------------------------------------------------------
  669. # Ativar o medidor de TP.
  670. # Será necessário o arquivo.
  671. #
  672. # TP_Meter.png
  673. #
  674. #---------------------------------------------------------------------------
  675. TP_METER_VISIBLE = true
  676. #---------------------------------------------------------------------------
  677. # Definição da prioridade do sprite.
  678. #---------------------------------------------------------------------------
  679. TP_METER_Z = 4
  680. #---------------------------------------------------------------------------
  681. # Definição da posição do medidor de TP. [X,Y]
  682. #---------------------------------------------------------------------------
  683. TP_METER_POSITION = [27,33]
  684. #---------------------------------------------------------------------------
  685. # Definição do ângulo do medidor.
  686. #---------------------------------------------------------------------------
  687. TP_METER_ANGLE = 0
  688. #---------------------------------------------------------------------------
  689. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  690. # inverso.
  691. #---------------------------------------------------------------------------
  692. TP_METER_MIRROR_EFFECT = false
  693. #---------------------------------------------------------------------------
  694. # Ativar o efeito animado de dano no medidor.
  695. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  696. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  697. #
  698. # NORMAL_COLOR
  699. # DAMAGE_COLOR
  700. #
  701. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  702. #---------------------------------------------------------------------------
  703. TP_METER_REDUCTION_ANIMATION = true
  704. #---------------------------------------------------------------------------
  705. # Ativar o efeito animado do "medidor fluindo".
  706. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  707. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  708. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  709. #---------------------------------------------------------------------------
  710. TP_METER_GRADIENT_ANIMATION = false
  711. #---------------------------------------------------------------------------
  712. # Ativar TP em ícones.
  713. # Será necessário ter a imagem.
  714. #
  715. # TP_Icon.png
  716. #
  717. #---------------------------------------------------------------------------
  718. TP_ICON_VISIBLE = false
  719. #---------------------------------------------------------------------------
  720. # Definição da prioridade do sprite.
  721. #---------------------------------------------------------------------------
  722. TP_ICON_Z = 1
  723. #---------------------------------------------------------------------------
  724. # Posição do ícone de TP.
  725. #---------------------------------------------------------------------------
  726. TP_ICON_POSITION = [200,128]
  727. #---------------------------------------------------------------------------
  728. # Ativar o sprite EX do ultimo ícone
  729. # Será necessário ter a imagem.
  730. #
  731. # TP_Icon_EX.png
  732. #
  733. #---------------------------------------------------------------------------
  734. TP_ICON_EX_VISIBLE = false
  735. #---------------------------------------------------------------------------
  736. # Posição do ícone Animado.
  737. #---------------------------------------------------------------------------
  738. TP_ICON_EX_POSITION = [0,0]
  739. #---------------------------------------------------------------------------
  740. # Ativar o efeito de Zoom do Sprite.
  741. #---------------------------------------------------------------------------
  742. TP_ICON_EX_ZOOM_EFFECT = true
  743. #---------------------------------------------------------------------------
  744. # Espaço entre os ícones.
  745. #---------------------------------------------------------------------------
  746. TP_ICON_SPACE = [-10,-10]
  747. #---------------------------------------------------------------------------
  748. # Definição da quantidade maxima de ícones na horizontal.
  749. #---------------------------------------------------------------------------
  750. TP_ICON_COL_MAX = 10
  751. #---------------------------------------------------------------------------
  752. # Definição da quantidade maxima de ícones na vertical.
  753. #---------------------------------------------------------------------------
  754. TP_ICON_ROW_MAX = 2
  755. #---------------------------------------------------------------------------
  756. # Ativar o número de TP de ícones.
  757. # Será necessário ter a imagem.
  758. #
  759. # TP_Icon_Number.png
  760. #
  761. #---------------------------------------------------------------------------
  762. TP_ICON_NUMBER_VISIBLE = false
  763. #---------------------------------------------------------------------------
  764. # Definição da prioridade do sprite.
  765. #---------------------------------------------------------------------------
  766. TP_ICON_NUMBER_Z = 4
  767. #---------------------------------------------------------------------------
  768. # Posição do número do ícone
  769. #---------------------------------------------------------------------------
  770. TP_ICON_NUMBER_POSITION = [0,128]
  771. #---------------------------------------------------------------------------
  772. # Definição do tipo alinhamento do número.
  773. #
  774. # 0 - Esquerda
  775. # 1 - Centro
  776. # 2 - Direita
  777. #---------------------------------------------------------------------------
  778. TP_ICON_NUMBER_ALIGN_TYPE = 0
  779. #============================================================================
  780. #============================================================================
  781.  
  782. #============================================================================
  783. #============================================================================
  784. # * AT
  785. #============================================================================
  786. # Ativar o número de AT.
  787. # Será necessário o arquivo.
  788. #
  789. # AT_Number.png
  790. #
  791. #---------------------------------------------------------------------------
  792. AT_NUMBER_VISIBLE = false
  793. #---------------------------------------------------------------------------
  794. # Definição da prioridade do Sprite.
  795. #---------------------------------------------------------------------------
  796. AT_NUMBER_Z = 2
  797. #---------------------------------------------------------------------------
  798. # Definição da posição do número de AT. [X,Y]
  799. #---------------------------------------------------------------------------
  800. AT_NUMBER_POSITION = [125,-27]
  801. #---------------------------------------------------------------------------
  802. # Ativar o número de AT Total.
  803. # Será necessário o arquivo.
  804. #
  805. # AT_Number_Max.png
  806. #
  807. #---------------------------------------------------------------------------
  808. AT_NUMBER_MAX_VISIBLE = false
  809. #---------------------------------------------------------------------------
  810. # Definição da posição do número de AT Total. [X,Y]
  811. #---------------------------------------------------------------------------
  812. AT_NUMBER_MAX_POSITION = [165,-17]
  813. #---------------------------------------------------------------------------
  814. # Definição do tipo alinhamento do número.
  815. #
  816. # 0 - Esquerda
  817. # 1 - Centro
  818. # 2 - Direita
  819. #---------------------------------------------------------------------------
  820. AT_NUMBER_ALIGN_TYPE = 2
  821. #---------------------------------------------------------------------------
  822. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  823. #---------------------------------------------------------------------------
  824. AT_NUMBER_WAVE_ALIGN_EFFECT = false
  825. #---------------------------------------------------------------------------
  826. # Apresentar os números em porcentagem.
  827. #---------------------------------------------------------------------------
  828. AT_NUMBER_PERCENTAGE = false
  829. #---------------------------------------------------------------------------
  830. # Ativar números animados ("Rolantes").
  831. #---------------------------------------------------------------------------
  832. AT_NUMBER_ANIMATION = false
  833. #---------------------------------------------------------------------------
  834. # Ativar o medidor de AT.
  835. # Será necessário o arquivo.
  836. #
  837. # AT_Meter.png
  838. #
  839. #---------------------------------------------------------------------------
  840. AT_METER_VISIBLE = false
  841. #---------------------------------------------------------------------------
  842. # Definição da prioridade do sprite.
  843. #---------------------------------------------------------------------------
  844. AT_METER_Z = 1
  845. #---------------------------------------------------------------------------
  846. # Definição da posição do medidor de AT. [X,Y]
  847. #---------------------------------------------------------------------------
  848. AT_METER_POSITION = [38,76]
  849. #---------------------------------------------------------------------------
  850. # Definição do ângulo do medidor.
  851. #---------------------------------------------------------------------------
  852. AT_METER_ANGLE = 0
  853. #---------------------------------------------------------------------------
  854. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  855. # inverso.
  856. #---------------------------------------------------------------------------
  857. AT_METER_MIRROR_EFFECT = false
  858. #---------------------------------------------------------------------------
  859. # Ativar o efeito animado do "medidor fluindo".
  860. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  861. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  862. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  863. #---------------------------------------------------------------------------
  864. AT_METER_GRADIENT_ANIMATION = true
  865. #============================================================================
  866.  
  867.  
  868. #============================================================================
  869. #============================================================================
  870. # * LEVEL
  871. #============================================================================
  872. # Ativar o número de Level.
  873. # Será necessário o arquivo.
  874. #
  875. # LV_Number.png
  876. #
  877. #---------------------------------------------------------------------------
  878. LEVEL_NUMBER_VISIBLE = false
  879. #---------------------------------------------------------------------------
  880. # Definição da prioridade do Sprite.
  881. #---------------------------------------------------------------------------
  882. LEVEL_NUMBER_Z = 2
  883. #---------------------------------------------------------------------------
  884. # Definição da posição do número do Level. [X,Y]
  885. #---------------------------------------------------------------------------
  886. LEVEL_NUMBER_POSITION = [23,56]
  887. #---------------------------------------------------------------------------
  888. # Definição do tipo alinhamento do número.
  889. #
  890. # 0 - Esquerda
  891. # 1 - Centro
  892. # 2 - Direita
  893. #---------------------------------------------------------------------------
  894. LEVEL_NUMBER_ALIGN_TYPE = 1
  895. #============================================================================
  896. #============================================================================
  897.  
  898.  
  899. #============================================================================
  900. #============================================================================
  901. # * STATE
  902. #============================================================================
  903. # Ativar as condições.
  904. #---------------------------------------------------------------------------
  905. STATES_VISIBLE = true
  906. #---------------------------------------------------------------------------
  907. # Definição da prioridade do sprite.
  908. #---------------------------------------------------------------------------
  909. STATES_Z = 1
  910. #---------------------------------------------------------------------------
  911. # Definição da posição das condições. [X,Y]
  912. #---------------------------------------------------------------------------
  913. STATES_POSITION = [-70,26]
  914. #---------------------------------------------------------------------------
  915. # Ativar o efeito animado das condições deslizando.
  916. #---------------------------------------------------------------------------
  917. STATES_SCROLLING_ANIMATION = false
  918. #---------------------------------------------------------------------------
  919. # Definição do ângulo do sprite.
  920. #---------------------------------------------------------------------------
  921. STATE_ANGLE = 0
  922. #---------------------------------------------------------------------------
  923. # Definição das condições que serão ocultadas pela hud.
  924. # EX - HIDE_STATES_ID = [9,10,12,14]
  925. #---------------------------------------------------------------------------
  926. HIDE_STATES_ID = []
  927. #============================================================================
  928. #============================================================================
  929.  
  930. #============================================================================
  931. #============================================================================
  932. # * SECOND LAYOUT (Overlayer)
  933. #============================================================================
  934. # Ativar a segunda camada de Layout
  935. # Será necessário o arquivo.
  936. #
  937. # Layout_2.png
  938. #
  939. #============================================================================
  940. SECOND_LAYOUT = false
  941. #---------------------------------------------------------------------------
  942. # Definição da prioridade do sprite.
  943. #---------------------------------------------------------------------------
  944. SECOND_LAYOUT_Z = 2
  945. #---------------------------------------------------------------------------
  946. # Definição da posição do sprite.
  947. #---------------------------------------------------------------------------
  948. SECOND_LAYOUT_POSITION = [0,0]
  949. #============================================================================
  950. #============================================================================
  951.  
  952. #============================================================================
  953. #============================================================================
  954. # * SCREEN LAYOUT
  955. #============================================================================
  956. # Ativar o Layout da tela.
  957. # Será necessário o arquivo.
  958. #
  959. # Layout_Screen.png
  960. #
  961. #============================================================================
  962. #Ativar o Layout da tela
  963. SCREEN_LAYOUT = true
  964. #---------------------------------------------------------------------------
  965. #Posição do layout
  966. #---------------------------------------------------------------------------
  967. SCREEN_LAYOUT_POSITION = [0,0]
  968. #---------------------------------------------------------------------------
  969. #Definição da posição Z
  970. #---------------------------------------------------------------------------
  971. SCREEN_LAYOUT_Z = -5
  972.  
  973. end
  974.  
  975. #============================================================================
  976. #============================================================================
  977. # * CUSTOM WINDOWS (GENERAL)
  978. #============================================================================
  979. module MOG_BATTLE_HUD_EX
  980.  
  981. #============================================================================
  982. # * Ativar Janelas Customizadas.
  983. #============================================================================
  984. ENABLE_CUSTOM_WINDOWS = true
  985.  
  986. #============================================================================
  987. # * BATTLE LOG WINDOW
  988. #============================================================================
  989. #Definição da posição da janela de log.
  990. BATTLE_LOG_POSITION = [0,0]
  991.  
  992. #============================================================================
  993. # * FONT SETTING
  994. #============================================================================
  995. #Ativar a configuração da fonte.
  996. ENABLE_WINDOW_FONT_SET = true
  997. #Definição do nome da fonte.
  998. WINDOW_FONT_NAME = nil
  999. #Definição do tamanho da fonte.
  1000. WINDOW_FONT_SIZE = 18
  1001. #Ativar fonte em bold;
  1002. WINDOW_FONT_BOLD = true
  1003. #Ativar fonte em itálico.
  1004. WINDOW_FONT_ITALIC = false
  1005.  
  1006. #============================================================================
  1007. # * SKILL WINDOW
  1008. #============================================================================
  1009. #Definição do tamanho da janela.
  1010. SKILL_WINDOW_SIZE = [245, 130]
  1011. #Definição da posição da janela.
  1012. SKILL_WINDOW_POSITION = [30, -195]
  1013. #Definição da transparência da janela.
  1014. SKILL_WINDOW_OPACITY = 0
  1015. #Ativar a imagem de Layout. ("Layout_Skill.png")
  1016. SKILL_WINDOW_LAYOUT = true
  1017. #Definição do layout.
  1018. SKILL_WINDOW_LAYOUT_POSITION = [-35,-42]
  1019. #Definição da quantidade colunas máxima.
  1020. SKILL_COL_MAX = 1
  1021. #Ativar a animação de slide.
  1022. SKILL_WINDOW_SLIDE_EFFECT = true
  1023. #Definição da posição do slide.
  1024. SKILL_WINDOW_SLIDE_POSITION = [-150,0]
  1025. #============================================================================
  1026.  
  1027. #============================================================================
  1028. # * ITEM WINDOW
  1029. #============================================================================
  1030. #Definição do tamanho da janela.
  1031. ITEM_WINDOW_SIZE = [245, 130]
  1032. #Definição da posição da janela.
  1033. ITEM_WINDOW_POSITION = [30, -195]
  1034. #Definição da transparência da janela.
  1035. ITEM_WINDOW_OPACITY = 0
  1036. #Ativar a imagem de Layout. ("Layout_Item.png")
  1037. ITEM_WINDOW_LAYOUT = true
  1038. #Definição do layout.
  1039. ITEM_WINDOW_LAYOUT_POSITION = [-35,-42]
  1040. #Definição da quantidade colunas máxima.
  1041. ITEM_COL_MAX = 1
  1042. #Ativar a animação de slide.
  1043. ITEM_WINDOW_SLIDE_EFFECT = true
  1044. #Definição da posição do slide.
  1045. ITEM_WINDOW_SLIDE_POSITION = [-150,0]
  1046. #============================================================================
  1047.  
  1048. #============================================================================
  1049. # * COMMAND WINDOW
  1050. #============================================================================
  1051. #Ajustar automáticamente
  1052. AUTO_ADJUST_ACTOR_COMMAND = true
  1053. #Definição da posição da janela. (Apenas para Ajustes)
  1054. ACTOR_COMMAND_POSITION = [170,20]
  1055. #Definição da transparência da janela.
  1056. ACTOR_COMMAND_OPACITY = 0
  1057. #Ativar a imagem de Layout. ("Layout_Command.png")
  1058. ACTOR_COMMAND_LAYOUT = true
  1059. #Definição do layout.
  1060. ACTOR_COMMAND_LAYOUT_POSITION = [0,0]
  1061. #============================================================================
  1062.  
  1063. #============================================================================
  1064. # * HELP WINDOW
  1065. #============================================================================
  1066. #Definição do tamanho da janela.
  1067. HELP_WINDOW_SIZE = [Graphics.width, 72]
  1068. #Definição do tamanho da janela.
  1069. HELP_WINDOW_POSITION = [Graphics.width / 2, 0]
  1070. #Definição da transparência da janela.
  1071. HELP_WINDOW_OPACITY = 0
  1072. #Ativar a imagem de Layout. ("Layout_Help.png")
  1073. HELP_WINDOW_LAYOUT = true
  1074. #Definição do layout.
  1075. HELP_WINDOW_LAYOUT_POSITION = [0,0]
  1076. #Ativar a animação de slide.
  1077. HELP_WINDOW_SLIDE_EFFECT = true
  1078. #Definição da posição do slide.
  1079. HELP_WINDOW_SLIDE_POSITION = [0,-150]
  1080. #============================================================================
  1081.  
  1082. #============================================================================
  1083. # * TARGET ACTOR WINDOW
  1084. #============================================================================
  1085. #Definição do tamanho da janela.
  1086. ACTOR_WINDOW_SIZE = [Graphics.width, 120]
  1087. #Definição do tamanho da janela.
  1088. ACTOR_WINDOW_POSITION = [Graphics.width / 2, Graphics.height - 20]
  1089. #Definição da transparência da janela.
  1090. ACTOR_WINDOW_OPACITY = 0
  1091. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1092. ACTOR_WINDOW_LAYOUT = true
  1093. #Definição do layout.
  1094. ACTOR_WINDOW_LAYOUT_POSITION = [0,-7]
  1095. #Ativar a animação de slide.
  1096. ACTOR_WINDOW_SLIDE_EFFECT = true
  1097. #Definição da posição do slide.
  1098. ACTOR_WINDOW_SLIDE_POSITION = [0,100]
  1099. #============================================================================
  1100.  
  1101. #============================================================================
  1102. # * TARGET ENEMY WINDOW
  1103. #============================================================================
  1104. #Definição do tamanho da janela.
  1105. ENEMY_WINDOW_SIZE = [Graphics.width, 120]
  1106. #Definição do tamanho da janela.
  1107. ENEMY_WINDOW_POSITION = [Graphics.width / 2, Graphics.height - 20]
  1108. #Definição da transparência da janela.
  1109. ENEMY_WINDOW_OPACITY = 0
  1110. #Ativar a imagem de Layout. ("Layout_Target_Actor.png")
  1111. ENEMY_WINDOW_LAYOUT = true
  1112. #Definição do layout.
  1113. ENEMY_WINDOW_LAYOUT_POSITION = [0,-7]
  1114. #Ativar a animação de slide.
  1115. ENEMY_WINDOW_SLIDE_EFFECT = true
  1116. #Definição da posição do slide.
  1117. ENEMY_WINDOW_SLIDE_POSITION = [0,100]
  1118. #============================================================================
  1119.  
  1120. #============================================================================
  1121. # * PARTY WINDOW (Fight/Escape)
  1122. #============================================================================
  1123. #Definição do tamanho da janela.
  1124. PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
  1125. #Definição da transparência da janela.
  1126. PARTY_COMMAND_OPACITY = 0
  1127. #Ativar a imagem de Layout. ("Layout_Party.png")
  1128. PARTY_COMMAND_LAYOUT = true
  1129. #Definição do layout.
  1130. PARTY_COMMAND_LAYOUT_POSITION = [-25,-47]
  1131. #Ativar a animação de slide.
  1132. PARTY_COMMAND_SLIDE_EFFECT = true
  1133. #Definição da posição do slide.
  1134. PARTY_COMMAND_SLIDE_POSITION = [0,-150]
  1135. #============================================================================
  1136.  
  1137. end
  1138.  
  1139. #==============================================================================
  1140. # ** Cache
  1141. #==============================================================================
  1142. module Cache
  1143.  
  1144. #--------------------------------------------------------------------------
  1145. # * Hud
  1146. #--------------------------------------------------------------------------
  1147. def self.battle_hud(filename)
  1148. load_bitmap("Graphics/Huds/Battle/", filename)
  1149. end
  1150.  
  1151. end
  1152.  
  1153. #==============================================================================
  1154. # ** Game Temp
  1155. #==============================================================================
  1156. class Game_Temp
  1157.  
  1158. attr_accessor :battler_face_pos
  1159. attr_accessor :hud_pos
  1160. attr_accessor :hud_pos_real
  1161. attr_accessor :com_pos
  1162. attr_accessor :mbhud_force_refresh
  1163. attr_accessor :mbhud_window
  1164. attr_accessor :command_visible
  1165. attr_accessor :refresh_turn_sprite
  1166. attr_accessor :battle_hud_visible
  1167. attr_accessor :battle_hud_visible_refresh
  1168. attr_accessor :battle_end
  1169.  
  1170. #--------------------------------------------------------------------------
  1171. # * Initialize
  1172. #--------------------------------------------------------------------------
  1173. alias mog_monogatari_bhud_initialize initialize
  1174. def initialize
  1175. @battler_face_pos = []
  1176. @hud_pos = []
  1177. @hud_pos_real = []
  1178. @com_pos = []
  1179. @mbhud_force_refresh = false
  1180. @mbhud_window = [false,false,false,false,false,false,false]
  1181. @command_visible = false
  1182. @refresh_turn_sprite = false
  1183. @battle_hud_visible = true
  1184. @battle_hud_visible_refresh = [false,false]
  1185. @battle_end = false
  1186. mog_monogatari_bhud_initialize
  1187. end
  1188.  
  1189. #--------------------------------------------------------------------------
  1190. # * Check Screen Xyz
  1191. #--------------------------------------------------------------------------
  1192. def check_screen_xyz_nil
  1193. return if !SceneManager.face_battler?
  1194. for actor in $game_party.battle_members
  1195. actor.screen_x = 0 if actor.screen_x == nil
  1196. actor.screen_y = 0 if actor.screen_y == nil
  1197. actor.screen_z = 0 if actor.screen_z == nil
  1198. end
  1199. end
  1200.  
  1201. #--------------------------------------------------------------------------
  1202. # ● Sprite Visible
  1203. #--------------------------------------------------------------------------
  1204. def sprite_visible
  1205. return false if $game_message.visible
  1206. return false if $game_temp.battle_end
  1207. return true
  1208. end
  1209.  
  1210. end
  1211.  
  1212. #==============================================================================
  1213. # ** Game Interpreter
  1214. #==============================================================================
  1215. class Game_Interpreter
  1216.  
  1217. #--------------------------------------------------------------------------
  1218. # * Refresh Battle Hud
  1219. #--------------------------------------------------------------------------
  1220. def refresh_battle_hud
  1221. $game_temp.check_screen_xyz_nil rescue nil
  1222. $game_temp.mbhud_force_refresh = true
  1223. end
  1224.  
  1225. #--------------------------------------------------------------------------
  1226. # * Battler Face Name
  1227. #--------------------------------------------------------------------------
  1228. def battler_face_name(actor_id,face_name = "")
  1229. for actor in $game_party.members
  1230. actor.battler_face_name = face_name if actor.id == actor_id
  1231. end
  1232. refresh_battle_hud
  1233. end
  1234.  
  1235. #--------------------------------------------------------------------------
  1236. # * Battler Hud Visible
  1237. #--------------------------------------------------------------------------
  1238. def battle_hud_visible(value)
  1239. $game_temp.battle_hud_visible = value
  1240. end
  1241.  
  1242. #--------------------------------------------------------------------------
  1243. # * Command_129
  1244. #--------------------------------------------------------------------------
  1245. alias mog_monogatari_bhud_command_129 command_129
  1246. def command_129
  1247. mog_monogatari_bhud_command_129
  1248. refresh_battle_hud if SceneManager.scene_is?(Scene_Battle)
  1249. end
  1250.  
  1251. end
  1252.  
  1253. #==============================================================================
  1254. # ** Game Actor
  1255. #==============================================================================
  1256. class Game_Actor < Game_Battler
  1257.  
  1258. attr_accessor :face_animation
  1259. attr_accessor :battler_face_name
  1260.  
  1261. #--------------------------------------------------------------------------
  1262. # * Setup
  1263. #--------------------------------------------------------------------------
  1264. alias mog_monogatari_face_animation setup
  1265. def setup(actor_id)
  1266. mog_monogatari_face_animation(actor_id)
  1267. @face_animation = [0,0,0]
  1268. @battler_face_name = "Face_" + actor_id.to_s
  1269. end
  1270.  
  1271. #--------------------------------------------------------------------------
  1272. # ● Real Next Level
  1273. #--------------------------------------------------------------------------
  1274. def real_next_level
  1275. next_level_exp - exp_for_level(level)
  1276. end
  1277.  
  1278. #--------------------------------------------------------------------------
  1279. # ● Remain Exp
  1280. #--------------------------------------------------------------------------
  1281. def remain_exp
  1282. exp - exp_for_level(level)
  1283. end
  1284.  
  1285. #--------------------------------------------------------------------------
  1286. # ● Gain Exp Test
  1287. #--------------------------------------------------------------------------
  1288. def gain_exp_test
  1289. exp_r = rand(next_level_exp)
  1290. change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1291. end
  1292.  
  1293. #--------------------------------------------------------------------------
  1294. # ● Low HP?
  1295. #--------------------------------------------------------------------------
  1296. def low_hp?
  1297. hp <= (mhp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1298. end
  1299.  
  1300. #--------------------------------------------------------------------------
  1301. # ● Low MP?
  1302. #--------------------------------------------------------------------------
  1303. def low_mp?
  1304. mp <= (mmp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1305. end
  1306.  
  1307. #--------------------------------------------------------------------------
  1308. # ● Low TP?
  1309. #--------------------------------------------------------------------------
  1310. def low_tp?
  1311. tp <= (max_tp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
  1312. end
  1313.  
  1314. end
  1315.  
  1316. #==============================================================================
  1317. # ** Game Party
  1318. #==============================================================================
  1319. class Game_Party < Game_Unit
  1320.  
  1321. #--------------------------------------------------------------------------
  1322. # * Get Maximum Number of Battle Members
  1323. #--------------------------------------------------------------------------
  1324. def max_battle_members
  1325. return MOG_BATTLE_HUD_EX::MAX_BATTLE_MEMBERS
  1326. end
  1327.  
  1328. #--------------------------------------------------------------------------
  1329. # * Swap Order
  1330. #--------------------------------------------------------------------------
  1331. alias mog_bhex_swap_order swap_order
  1332. def swap_order(index1, index2)
  1333. mog_bhex_swap_order(index1, index2)
  1334. if SceneManager.scene_is?(Scene_Battle)
  1335. $game_temp.check_screen_xyz_nil rescue nil
  1336. $game_temp.mbhud_force_refresh = true
  1337. end
  1338. end
  1339.  
  1340. end
  1341.  
  1342. #==============================================================================
  1343. # ** BattleManager
  1344. #==============================================================================
  1345. module BattleManager
  1346.  
  1347. #--------------------------------------------------------------------------
  1348. # * Current Index
  1349. #--------------------------------------------------------------------------
  1350. def self.current_index
  1351. if $imported[:mog_atb_system]
  1352. return actor.index if actor
  1353. end
  1354. return 0 if @actor_index == nil
  1355. return @actor_index != -1 ? @actor_index : 0
  1356. end
  1357.  
  1358. #--------------------------------------------------------------------------
  1359. # * Current Index Real
  1360. #--------------------------------------------------------------------------
  1361. def self.current_index_real
  1362. return -1 if @actor_index == nil
  1363. return @actor_index
  1364. end
  1365.  
  1366. #--------------------------------------------------------------------------
  1367. # * Next Actor Avaliable
  1368. #--------------------------------------------------------------------------
  1369. def self.next_actor_avaliable?
  1370. return false if @actor_index == nil
  1371. next_index = @actor_index + 1
  1372. return false if next_index >= $game_party.members.size
  1373. return true
  1374. end
  1375.  
  1376. #--------------------------------------------------------------------------
  1377. # * To Next Command Input
  1378. #--------------------------------------------------------------------------
  1379. def self.next_command_avaliable
  1380. aindex = @actor_index
  1381. begin
  1382. if !actor || !actor.next_command
  1383. return false if actor == nil
  1384. aindex += 1
  1385. return false if aindex >= $game_party.members.size
  1386. end
  1387. end until actor.inputable?
  1388. return true
  1389. end
  1390.  
  1391. #--------------------------------------------------------------------------
  1392. # * Can Enable Window?
  1393. #--------------------------------------------------------------------------
  1394. def self.can_enable_window?
  1395. max_members = $game_party.members.size
  1396. index_real = current_index_real + 1
  1397. return false if index_real > max_members
  1398. return false if in_turn?
  1399. return false if $imported[:mog_battle_cursor]
  1400. return true
  1401. end
  1402.  
  1403. end
  1404.  
  1405. #==============================================================================
  1406. # ** SceneManager
  1407. #==============================================================================
  1408. module SceneManager
  1409.  
  1410. #--------------------------------------------------------------------------
  1411. # * Face Battler
  1412. #--------------------------------------------------------------------------
  1413. def self.face_battler?
  1414. return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
  1415. return false if !MOG_BATTLE_HUD_EX::FACE_VISIBLE
  1416. return false if $imported[:mog_sprite_actor]
  1417. return false if $imported[:ve_animated_battle]
  1418. return false if $imported[:ve_actor_battlers]
  1419. return false if $imported["YES-BattleSymphony"]
  1420. return false if $imported["YEA-VisualBattlers"]
  1421. return false if $imported["Galv_Animated_Battlers"]
  1422. return false if $imported['KRX-AnimatedBattlers']
  1423. return false if $imported[:Theo_BasicFuntions]
  1424. return false if $sv_camera != nil
  1425. return false if BattleManager.true_surprise != nil rescue nil
  1426. return false if $imported[:jet][:AnimatedBattlers] rescue nil
  1427. return true
  1428. end
  1429.  
  1430. end
  1431.  
  1432. #==============================================================================
  1433. # ■ Sprite Picture
  1434. #==============================================================================
  1435. class Sprite_Picture < Sprite
  1436.  
  1437. #--------------------------------------------------------------------------
  1438. # * Initialize
  1439. #--------------------------------------------------------------------------
  1440. alias mog_battle_hud_initialize initialize
  1441. def initialize(viewport, picture)
  1442. mog_battle_hud_initialize(viewport, picture)
  1443. self.viewport = nil if SceneManager.scene_is?(Scene_Battle)
  1444.  
  1445. end
  1446.  
  1447. #--------------------------------------------------------------------------
  1448. # * Update Position
  1449. #--------------------------------------------------------------------------
  1450. alias mog_battle_hud_update_position update_position
  1451. def update_position
  1452. mog_battle_hud_update_position
  1453. self.z = @picture.number + 120 if SceneManager.scene_is?(Scene_Battle)
  1454. end
  1455.  
  1456. end
  1457.  
  1458. #==============================================================================
  1459. # ■ Sprite Base
  1460. #==============================================================================
  1461. class Sprite_Base < Sprite
  1462.  
  1463. #--------------------------------------------------------------------------
  1464. # * Initialize
  1465. #--------------------------------------------------------------------------
  1466. alias mog_bhud_ex_initialize initialize
  1467. def initialize(viewport = nil)
  1468. @ani_x = SceneManager.face_battler? ? MOG_BATTLE_HUD_EX::HUD_Z + 20 : 100
  1469. mog_bhud_ex_initialize(viewport)
  1470. end
  1471.  
  1472. #--------------------------------------------------------------------------
  1473. # * Animation Set Sprite
  1474. #--------------------------------------------------------------------------
  1475. alias mog_battle_hud_ex_animation_set_sprites animation_set_sprites
  1476. def animation_set_sprites(frame)
  1477. mog_battle_hud_ex_animation_set_sprites(frame)
  1478. update_sprite_z_animation rescue nil if SceneManager.scene_is?(Scene_Battle)
  1479. end
  1480.  
  1481. #--------------------------------------------------------------------------
  1482. # * Update Sprite Z Animation
  1483. #--------------------------------------------------------------------------
  1484. def update_sprite_z_animation
  1485. if $imported[:mog_battle_camera]
  1486. @ani_sprites.each_with_index do |sprite, i|
  1487. sprite.z = @ani_x + i end
  1488. else
  1489. @ani_sprites.each_with_index do |sprite, i|
  1490. sprite.viewport = nil ; sprite.z = @ani_x + i end
  1491. end
  1492. end
  1493.  
  1494. end
  1495.  
  1496. #==============================================================================
  1497. # ** Spriteset Battle
  1498. #==============================================================================
  1499. class Spriteset_Battle
  1500.  
  1501. #--------------------------------------------------------------------------
  1502. # * Create Actors
  1503. #--------------------------------------------------------------------------
  1504. alias mog_battle_hud_create_actors create_actors
  1505. def create_actors
  1506. if can_create_max_members?
  1507. @actor_sprites = Array.new($game_party.max_battle_members) { Sprite_Battler.new(@viewport1) }
  1508. return
  1509. end
  1510. mog_battle_hud_create_actors
  1511. end
  1512.  
  1513. #--------------------------------------------------------------------------
  1514. # * Can Create Max Members
  1515. #--------------------------------------------------------------------------
  1516. def can_create_max_members?
  1517. return false if $imported[:ve_animated_battle]
  1518. return false if $imported[:ve_actor_battlers]
  1519. return false if $sv_camera != nil
  1520. return true
  1521. end
  1522.  
  1523. end
  1524.  
  1525. #==============================================================================
  1526. # ■ Scene Battle
  1527. #==============================================================================
  1528. class Scene_Battle < Scene_Base
  1529.  
  1530. #--------------------------------------------------------------------------
  1531. # ● Clear All Windows
  1532. #--------------------------------------------------------------------------
  1533. alias mog_battle_hud_ex_start start
  1534. def start
  1535. setup_battle_hud_ex
  1536. mog_battle_hud_ex_start
  1537. end
  1538.  
  1539. #--------------------------------------------------------------------------
  1540. # ● Setup Battle Hud EX
  1541. #--------------------------------------------------------------------------
  1542. def setup_battle_hud_ex
  1543. @force_clear_duration = 0
  1544. end
  1545.  
  1546. #--------------------------------------------------------------------------
  1547. # ● Clear All Windows
  1548. #--------------------------------------------------------------------------
  1549. def clear_all_windows
  1550. if @actor_window != nil
  1551. @actor_window.visible = false
  1552. @actor_window.active = false
  1553. end
  1554. if @status_window != nil
  1555. @status_window.visible = false
  1556. @status_window.active = false
  1557. end
  1558. if @actor_command_window != nil
  1559. @actor_command_window.visible = false
  1560. @actor_command_window.active = false
  1561. end
  1562. if @party_command_window != nil
  1563. @party_command_window.visible = false
  1564. @party_command_window.active = false
  1565. end
  1566. if @help_window != nil
  1567. @help_window.visible = false
  1568. end
  1569. end
  1570.  
  1571. #--------------------------------------------------------------------------
  1572. # ● Update
  1573. #--------------------------------------------------------------------------
  1574. alias mog_battle_hud_ex_update_main update
  1575. def update
  1576. mog_battle_hud_ex_update_main
  1577. update_battle_hud_ex
  1578. end
  1579.  
  1580. #--------------------------------------------------------------------------
  1581. # ● Update Battle Hud_ex
  1582. #--------------------------------------------------------------------------
  1583. def update_battle_hud_ex
  1584. @status_window.visible = false
  1585. end
  1586.  
  1587. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1588. #--------------------------------------------------------------------------
  1589. # * On Skill OK
  1590. #--------------------------------------------------------------------------
  1591. alias mog_battle_hud_ex_on_skill_ok on_skill_ok
  1592. def on_skill_ok
  1593. @skill = @skill_window.item
  1594. @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
  1595. mog_battle_hud_ex_on_skill_ok
  1596. end
  1597.  
  1598. #--------------------------------------------------------------------------
  1599. # * On Item OK
  1600. #--------------------------------------------------------------------------
  1601. alias mog_battle_hud_on_item_ok on_item_ok
  1602. def on_item_ok
  1603. @item = @item_window.item
  1604. @item_window.hide if @item.for_opponent? or @item.for_friend?
  1605. mog_battle_hud_on_item_ok
  1606. end
  1607.  
  1608. #--------------------------------------------------------------------------
  1609. # * On Enemy Cancel
  1610. #--------------------------------------------------------------------------
  1611. alias mog_battle_hud_ex_on_enemy_cancel on_enemy_cancel
  1612. def on_enemy_cancel
  1613. mog_battle_hud_ex_on_enemy_cancel
  1614. @skill_window.show if @skill_window.active
  1615. @item_window.show if @item_window.active
  1616. end
  1617.  
  1618. #--------------------------------------------------------------------------
  1619. # * On Actor Cancel
  1620. #--------------------------------------------------------------------------
  1621. alias mog_battle_hud_ex_on_actor_cancel on_actor_cancel
  1622. def on_actor_cancel
  1623. mog_battle_hud_ex_on_actor_cancel
  1624. @skill_window.show if @skill_window.active
  1625. @item_window.show if @item_window.active
  1626. mog_battle_hud_ex_on_actor_cancel
  1627. end
  1628. end
  1629.  
  1630. end
  1631.  
  1632. if SceneManager.face_battler?
  1633. #==============================================================================
  1634. # ■ Game_Actor
  1635. #==============================================================================
  1636. class Game_Actor < Game_Battler
  1637.  
  1638. attr_accessor :screen_x
  1639. attr_accessor :screen_y
  1640. attr_accessor :screen_z
  1641.  
  1642.  
  1643. #--------------------------------------------------------------------------
  1644. # ● Use Sprite?
  1645. #--------------------------------------------------------------------------
  1646. def use_sprite?
  1647. return true
  1648. end
  1649.  
  1650. end
  1651.  
  1652. #==============================================================================
  1653. # ■ Sprite_Battler
  1654. #==============================================================================
  1655. class Sprite_Battler < Sprite_Base
  1656. include MOG_BATTLE_HUD_EX
  1657.  
  1658. #--------------------------------------------------------------------------
  1659. # ● Update Collapse
  1660. #--------------------------------------------------------------------------
  1661. alias mog_battle_hud_update_collapse update_collapse
  1662. def update_collapse
  1663. return if face_can_cancel_method?
  1664. mog_battle_hud_update_collapse
  1665. end
  1666.  
  1667. #--------------------------------------------------------------------------
  1668. # ● Update Instant Collapse
  1669. #--------------------------------------------------------------------------
  1670. alias mog_battle_hud_update_instant_collapse update_instant_collapse
  1671. def update_instant_collapse
  1672. return if face_can_cancel_method?
  1673. mog_battle_hud_update_instant_collapse
  1674. end
  1675.  
  1676. #--------------------------------------------------------------------------
  1677. # ● Face Can Cancel Method
  1678. #--------------------------------------------------------------------------
  1679. def face_can_cancel_method?
  1680. return false if !SceneManager.face_battler?
  1681. return false if @battler.is_a?(Game_Enemy)
  1682. self.opacity = 255 ; self.visible = true
  1683. return true
  1684. end
  1685.  
  1686. #--------------------------------------------------------------------------
  1687. # ● Update Bitmap
  1688. #--------------------------------------------------------------------------
  1689. alias mog_battle_hud_ex_update_bitmap update_bitmap
  1690. def update_bitmap
  1691. return if face_can_cancel_method?
  1692. mog_battle_hud_ex_update_bitmap
  1693. end
  1694.  
  1695. #--------------------------------------------------------------------------
  1696. # ● Update Position
  1697. #--------------------------------------------------------------------------
  1698. alias mog_battle_hud_ex_update_position update_position
  1699. def update_position
  1700. if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  1701. if !face_sprite_visible? or $game_temp.battle_end
  1702. self.y = -1000
  1703. return
  1704. end
  1705. end
  1706. mog_battle_hud_ex_update_position
  1707. end
  1708.  
  1709. #--------------------------------------------------------------------------
  1710. # * Sprite Visible
  1711. #--------------------------------------------------------------------------
  1712. def face_sprite_visible?
  1713. return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  1714. return false if !$game_temp.battle_hud_visible
  1715. return true
  1716. end
  1717.  
  1718. end
  1719.  
  1720. end
  1721.  
  1722. #==============================================================================
  1723. # ** Window_BattleStatus
  1724. #==============================================================================
  1725. class Window_BattleStatus < Window_Selectable
  1726. include MOG_BATTLE_HUD_EX
  1727.  
  1728. #--------------------------------------------------------------------------
  1729. # * Get Window Width
  1730. #--------------------------------------------------------------------------
  1731. def window_width
  1732. ACTOR_WINDOW_SIZE[0]
  1733. end
  1734.  
  1735. #--------------------------------------------------------------------------
  1736. # * Refresh
  1737. #--------------------------------------------------------------------------
  1738. alias mog_monogatari_refresh refresh
  1739. def refresh
  1740. mog_monogatari_refresh
  1741. self.visible = false
  1742. self.opacity = 0
  1743. self.contents_opacity = 0
  1744. self.y = 1200
  1745. end
  1746.  
  1747. end
  1748.  
  1749. #==============================================================================
  1750. # ** Window Actor Command
  1751. #==============================================================================
  1752. class Window_ActorCommand < Window_Command
  1753.  
  1754. #--------------------------------------------------------------------------
  1755. # * Update
  1756. #--------------------------------------------------------------------------
  1757. alias mog_hud_battle_hud_ex_turn_sprite_update update
  1758. def update
  1759. mog_hud_battle_hud_ex_turn_sprite_update
  1760. $game_temp.command_visible = self.visible
  1761. end
  1762.  
  1763. end
  1764.  
  1765. #==============================================================================
  1766. # ** Window_BattleActor
  1767. #==============================================================================
  1768. class Window_BattleActor < Window_BattleStatus
  1769.  
  1770. #--------------------------------------------------------------------------
  1771. # * Refresh
  1772. #--------------------------------------------------------------------------
  1773. alias mog_battle_hud_ex_actor_w_refresh refresh
  1774. def refresh
  1775. mog_battle_hud_ex_actor_w_refresh
  1776. self.contents_opacity = 255
  1777. self.opacity = 255 if !MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1778. self.visible = true
  1779. end
  1780.  
  1781. end
  1782.  
  1783. if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
  1784.  
  1785. #==============================================================================
  1786. # ** Window BattleLog
  1787. #==============================================================================
  1788. class Window_BattleLog < Window_Selectable
  1789.  
  1790. include MOG_BATTLE_HUD_EX
  1791.  
  1792. #--------------------------------------------------------------------------
  1793. # * Initialize
  1794. #--------------------------------------------------------------------------
  1795. alias mog_battle_hud_ex_log_initialize initialize
  1796. def initialize
  1797. mog_battle_hud_ex_log_initialize
  1798. self.x = BATTLE_LOG_POSITION[0]
  1799. self.y = BATTLE_LOG_POSITION[1]
  1800. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1801. end
  1802.  
  1803. #--------------------------------------------------------------------------
  1804. # * Create Back Sprite
  1805. #--------------------------------------------------------------------------
  1806. alias mog_battle_hud_ex_log_create_back_sprite create_back_sprite
  1807. def create_back_sprite
  1808. self.x = BATTLE_LOG_POSITION[0]
  1809. self.y = BATTLE_LOG_POSITION[1]
  1810. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
  1811. mog_battle_hud_ex_log_create_back_sprite
  1812. end
  1813.  
  1814. end
  1815.  
  1816. #==============================================================================
  1817. # ** Window Actor Command
  1818. #==============================================================================
  1819. class Window_ActorCommand < Window_Command
  1820.  
  1821. include MOG_BATTLE_HUD_EX
  1822.  
  1823. #--------------------------------------------------------------------------
  1824. # * Initialize
  1825. #--------------------------------------------------------------------------
  1826. alias mog_monogatari_initialize initialize
  1827. def initialize
  1828. mog_monogatari_initialize
  1829. create_layout if $imported[:mog_battle_command_ex] == nil
  1830. end
  1831.  
  1832. #--------------------------------------------------------------------------
  1833. # * Dispose
  1834. #--------------------------------------------------------------------------
  1835. alias mog_monogatari_actor_command_dispose dispose
  1836. def dispose
  1837. mog_monogatari_actor_command_dispose
  1838. dispose_layout
  1839. end
  1840.  
  1841. #--------------------------------------------------------------------------
  1842. # * Create Layout
  1843. #--------------------------------------------------------------------------
  1844. def create_layout
  1845. return if @layout != nil
  1846. return if !ACTOR_COMMAND_LAYOUT
  1847. return if $game_temp.mbhud_window[0]
  1848. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1849. $game_temp.mbhud_window[0] = true
  1850. @layout = Sprite.new
  1851. @layout.bitmap = Cache.battle_hud("Layout_Command")
  1852. @layout.z = self.z - 1
  1853. @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1854. @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1855. @layout.visible = false
  1856. end
  1857.  
  1858. #--------------------------------------------------------------------------
  1859. # * Dispose Layout
  1860. #--------------------------------------------------------------------------
  1861. def dispose_layout
  1862. return if @layout == nil
  1863. @layout.dispose
  1864. @layout = nil
  1865. end
  1866.  
  1867. #--------------------------------------------------------------------------
  1868. # * Refresh Layout
  1869. #--------------------------------------------------------------------------
  1870. def refresh_layout
  1871. return if @layout == nil
  1872. @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
  1873. @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
  1874. @layout.visible = self.visible
  1875. @layout.z = self.z - 1
  1876. end
  1877.  
  1878. #--------------------------------------------------------------------------
  1879. # * Select
  1880. #--------------------------------------------------------------------------
  1881. alias mog_monogatari_select_actor_command select
  1882. def select(index)
  1883. mog_monogatari_select_actor_command(index)
  1884. set_command_position if $imported[:mog_battle_command_ex] == nil
  1885. end
  1886.  
  1887. #--------------------------------------------------------------------------
  1888. # * Set Command Position
  1889. #--------------------------------------------------------------------------
  1890. def set_command_position
  1891. self.viewport = nil
  1892. self.opacity = ACTOR_COMMAND_OPACITY
  1893. battler_index = BattleManager.current_index rescue nil
  1894. battler_index = 0 if battler_index == nil
  1895. if @actor != nil and $game_temp.hud_pos[battler_index] != nil
  1896. if FIXED_COMMAND_POSITION[battler_index] != nil
  1897. self.x = FIXED_COMMAND_POSITION[battler_index][0]
  1898. self.y = FIXED_COMMAND_POSITION[battler_index][1]
  1899. else
  1900. self.x = ACTOR_COMMAND_POSITION[0] + $game_temp.hud_pos[battler_index][0] - (self.width / 2)
  1901. self.x = Graphics.width - self.width if self.x + self.width > Graphics.width
  1902. self.x = 0 if self.x < 0
  1903. self.y = ACTOR_COMMAND_POSITION[1] + $game_temp.hud_pos[battler_index][1] - self.height
  1904. end
  1905. end
  1906. refresh_layout
  1907. end
  1908.  
  1909. #--------------------------------------------------------------------------
  1910. # * Refresh
  1911. #--------------------------------------------------------------------------
  1912. alias mog_battle_hud_ex_refresh refresh
  1913. def refresh
  1914. mog_battle_hud_ex_refresh
  1915. $game_temp.refresh_turn_sprite = true if $imported[:mog_battle_command_ex] == nil
  1916. end
  1917.  
  1918. #--------------------------------------------------------------------------
  1919. # * Update
  1920. #--------------------------------------------------------------------------
  1921. alias mog_monogatari_actor_commnand_update update
  1922. def update
  1923. mog_monogatari_actor_commnand_update
  1924. if $imported[:mog_battle_command_ex] == nil
  1925. self.visible = self.active
  1926. if !@layout.nil?
  1927. refresh_layout if @layout.visible != self.visible
  1928. @layout.visible = false if !$game_temp.sprite_visible
  1929. end
  1930. self.visible = false if !$game_temp.sprite_visible
  1931. end
  1932. end
  1933.  
  1934. end
  1935.  
  1936. #==============================================================================
  1937. # ** Window_PartyCommand
  1938. #==============================================================================
  1939. class Window_PartyCommand < Window_Command
  1940.  
  1941. include MOG_BATTLE_HUD_EX
  1942.  
  1943. #--------------------------------------------------------------------------
  1944. # * Initialize
  1945. #--------------------------------------------------------------------------
  1946. alias mog_monogatari_party_initialize initialize
  1947. def initialize
  1948. mog_monogatari_party_initialize
  1949. # self.x = @org_position[0] ; self.y = @org_position[1]
  1950. # self.opacity = PARTY_COMMAND_OPACITY
  1951. create_layout
  1952. end
  1953.  
  1954. #--------------------------------------------------------------------------
  1955. # * Dispose
  1956. #--------------------------------------------------------------------------
  1957. alias mog_monogatari_party_window_dispose dispose
  1958. def dispose
  1959. mog_monogatari_party_window_dispose
  1960. dispose_layout
  1961. end
  1962.  
  1963. #--------------------------------------------------------------------------
  1964. # * Create Layout
  1965. #--------------------------------------------------------------------------
  1966. def create_layout
  1967. return if @layout != nil
  1968. return if !PARTY_COMMAND_LAYOUT
  1969. return if $game_temp.mbhud_window[1]
  1970. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1971. $game_temp.mbhud_window[1] = true
  1972. @org_position_2 = [@org_position[0] + PARTY_COMMAND_LAYOUT_POSITION[0],@org_position[1] + PARTY_COMMAND_LAYOUT_POSITION[1]]
  1973. @layout = Sprite.new
  1974. @layout.bitmap = Cache.battle_hud("Layout_Party")
  1975. @layout.z = self.z - 1
  1976. refresh_layout
  1977. @layout.visible = false
  1978. end
  1979.  
  1980. #--------------------------------------------------------------------------
  1981. # * Dispose Layout
  1982. #--------------------------------------------------------------------------
  1983. def dispose_layout
  1984. return if @layout == nil
  1985. @layout.dispose
  1986. @layout = nil
  1987. end
  1988.  
  1989. #--------------------------------------------------------------------------
  1990. # * Refresh Layout
  1991. #--------------------------------------------------------------------------
  1992. def refresh_layout
  1993. return if @layout == nil
  1994. @layout.x = @org_position_2[0]
  1995. @layout.y = @org_position_2[1]
  1996. @layout.x += PARTY_COMMAND_SLIDE_POSITION[0] if PARTY_COMMAND_SLIDE_EFFECT
  1997. @layout.y += PARTY_COMMAND_SLIDE_POSITION[1] if PARTY_COMMAND_SLIDE_EFFECT
  1998. @layout.visible = self.visible
  1999. end
  2000.  
  2001. #--------------------------------------------------------------------------
  2002. # * Select
  2003. #--------------------------------------------------------------------------
  2004. alias mog_monogatari_refresh_partycommand refresh
  2005. def refresh
  2006. if @org_position == nil
  2007. @org_position = [PARTY_COMMAND_POSITION[0] - (self.width / 2),
  2008. PARTY_COMMAND_POSITION[1] - (self.height / 2)]
  2009. end
  2010. mog_monogatari_refresh_partycommand
  2011.  
  2012. self.viewport = nil
  2013. self.x = @org_position[0] ; self.y = @org_position[1]
  2014. if PARTY_COMMAND_SLIDE_EFFECT
  2015. self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2016. self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2017.  
  2018. end
  2019. self.opacity = PARTY_COMMAND_OPACITY
  2020. end
  2021.  
  2022. def show
  2023.  
  2024. end
  2025.  
  2026. #--------------------------------------------------------------------------
  2027. # * Show
  2028. #--------------------------------------------------------------------------
  2029. alias mog_bg_ex_slide_show_party show
  2030. def show
  2031. self.viewport = nil
  2032. self.x = @org_position[0] ; self.y = @org_position[1]
  2033. if PARTY_COMMAND_SLIDE_EFFECT
  2034. self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2035. self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2036.  
  2037. end
  2038. self.opacity = PARTY_COMMAND_OPACITY
  2039. mog_bg_ex_slide_show_party
  2040. end
  2041.  
  2042. #--------------------------------------------------------------------------
  2043. # * Update
  2044. #--------------------------------------------------------------------------
  2045. alias mog_monogatari_party_window_update update
  2046. def update
  2047. mog_monogatari_party_window_update
  2048. self.visible = self.active
  2049. if @layout != nil and @layout.visible != self.visible
  2050. refresh_layout
  2051. end
  2052. execute_slide_effect if self.visible
  2053. end
  2054.  
  2055. end
  2056.  
  2057. #==============================================================================
  2058. # ** Window_Help
  2059. #==============================================================================
  2060. class Window_Help < Window_Base
  2061.  
  2062. include MOG_BATTLE_HUD_EX
  2063.  
  2064. #--------------------------------------------------------------------------
  2065. # * Object Initialization
  2066. #--------------------------------------------------------------------------
  2067. alias mog_monogatari_battle_help_initialize initialize
  2068. def initialize(line_number = 2)
  2069. @battle_phase = false
  2070. mog_monogatari_battle_help_initialize(line_number)
  2071. @wait_time = 5
  2072. if SceneManager.scene_is?(Scene_Battle)
  2073. @battle_phase = true
  2074. self.width = HELP_WINDOW_SIZE[0]
  2075. self.height = HELP_WINDOW_SIZE[1]
  2076. @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
  2077. HELP_WINDOW_POSITION[1]]
  2078. self.x = @org_position[0]
  2079. self.y = @org_position[1]
  2080. self.opacity = HELP_WINDOW_OPACITY
  2081. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2082. create_layout
  2083. end
  2084. end
  2085.  
  2086. #--------------------------------------------------------------------------
  2087. # * Dispose
  2088. #--------------------------------------------------------------------------
  2089. alias mog_monogatari_help_window_dispose dispose
  2090. def dispose
  2091. mog_monogatari_help_window_dispose
  2092. dispose_layout
  2093. end
  2094.  
  2095. #--------------------------------------------------------------------------
  2096. # * Create Layout
  2097. #--------------------------------------------------------------------------
  2098. def create_layout
  2099. return if @layout != nil
  2100. return if !HELP_WINDOW_LAYOUT
  2101. return if $game_temp.mbhud_window[2]
  2102. return if !SceneManager.scene_is?(Scene_Battle)
  2103. $game_temp.mbhud_window[2] = true
  2104. @org_position_2 = [self.x + HELP_WINDOW_LAYOUT_POSITION[0],self.y + HELP_WINDOW_LAYOUT_POSITION[1]]
  2105. @layout = Sprite.new
  2106. @layout.bitmap = Cache.battle_hud("Layout_Help")
  2107. @layout.z = self.z - 1
  2108. refresh_layout
  2109. @layout.visible = false
  2110. end
  2111.  
  2112. #--------------------------------------------------------------------------
  2113. # * Dispose Layout
  2114. #--------------------------------------------------------------------------
  2115. def dispose_layout
  2116. return if @layout == nil
  2117. @layout.dispose
  2118. @layout = nil
  2119. end
  2120.  
  2121. #--------------------------------------------------------------------------
  2122. # * Refresh Layout
  2123. #--------------------------------------------------------------------------
  2124. def refresh_layout
  2125. return if @layout == nil
  2126. @layout.x = @org_position_2[0]
  2127. @layout.y = @org_position_2[1]
  2128. @layout.x += HELP_WINDOW_SLIDE_POSITION[0] if HELP_WINDOW_SLIDE_EFFECT
  2129. @layout.y += HELP_WINDOW_SLIDE_POSITION[1] if HELP_WINDOW_SLIDE_EFFECT
  2130. @layout.visible = self.visible
  2131. end
  2132.  
  2133. #--------------------------------------------------------------------------
  2134. # * Show
  2135. #--------------------------------------------------------------------------
  2136. alias mog_bg_ex_slide_show_help show
  2137. def show
  2138. if @battle_phase
  2139. self.viewport = nil
  2140. self.x = @org_position[0] ; self.y = @org_position[1]
  2141. if HELP_WINDOW_SLIDE_EFFECT
  2142. self.x += HELP_WINDOW_SLIDE_POSITION[0]
  2143. self.y += HELP_WINDOW_SLIDE_POSITION[1]
  2144. end
  2145. self.opacity = HELP_WINDOW_OPACITY
  2146. end
  2147. mog_bg_ex_slide_show_help
  2148. end
  2149.  
  2150. #--------------------------------------------------------------------------
  2151. # * Update
  2152. #--------------------------------------------------------------------------
  2153. alias mog_monogatari_help_window_update update
  2154. def update
  2155. if @wait_time > 0
  2156. @wait_time -= 1
  2157. return
  2158. end
  2159. mog_monogatari_help_window_update
  2160. if SceneManager.scene_is?(Scene_Battle)
  2161. if @layout != nil
  2162. refresh_layout if @layout.visible != self.visible
  2163. @layout.visible = self.visible
  2164. end
  2165. self.visible = false if !$game_temp.sprite_visible
  2166. execute_slide_effect if self.visible
  2167. end
  2168. end
  2169.  
  2170. end
  2171.  
  2172. #==============================================================================
  2173. # ** Window_BattleActor
  2174. #==============================================================================
  2175. class Window_BattleActor < Window_BattleStatus
  2176.  
  2177. include MOG_BATTLE_HUD_EX
  2178.  
  2179. #--------------------------------------------------------------------------
  2180. # * Initialize
  2181. #--------------------------------------------------------------------------
  2182. alias mog_monogatari_battle_actor_initialize initialize
  2183. def initialize(info_viewport)
  2184. @force_hide = can_force_hide?
  2185. mog_monogatari_battle_actor_initialize(info_viewport)
  2186. self.width = ACTOR_WINDOW_SIZE[0]
  2187. self.height = ACTOR_WINDOW_SIZE[1]
  2188. @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
  2189. ACTOR_WINDOW_POSITION[1] - self.height]
  2190. @org_position[1] = Graphics.height + 64 if @force_hide
  2191. self.x = @org_position[0]
  2192. self.y = @org_position[1]
  2193. self.opacity = ACTOR_WINDOW_OPACITY
  2194. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2195. self.viewport = nil
  2196. create_layout
  2197. end
  2198.  
  2199. #--------------------------------------------------------------------------
  2200. # * Can Force Hide?
  2201. #--------------------------------------------------------------------------
  2202. def can_force_hide?
  2203. return true if $imported[:ve_target_arrow]
  2204. return true if $imported[:mog_battle_cursor]
  2205. return false
  2206. end
  2207.  
  2208. #--------------------------------------------------------------------------
  2209. # * Dispose
  2210. #--------------------------------------------------------------------------
  2211. alias mog_monogatari_actor_window_dispose dispose
  2212. def dispose
  2213. mog_monogatari_actor_window_dispose
  2214. dispose_layout
  2215. end
  2216.  
  2217. #--------------------------------------------------------------------------
  2218. # * Create Layout
  2219. #--------------------------------------------------------------------------
  2220. def create_layout
  2221. return if @layout != nil
  2222. return if !ACTOR_WINDOW_LAYOUT
  2223. return if $game_temp.mbhud_window[3]
  2224. $game_temp.mbhud_window[3] = true
  2225. @org_position_2 = [self.x + ACTOR_WINDOW_LAYOUT_POSITION[0],self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]]
  2226. @layout = Sprite.new
  2227. @layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
  2228. @layout.z = self.z - 1
  2229. refresh_layout
  2230. @layout.visible = false
  2231. end
  2232.  
  2233. #--------------------------------------------------------------------------
  2234. # * Dispose Layout
  2235. #--------------------------------------------------------------------------
  2236. def dispose_layout
  2237. return if @layout == nil
  2238. @layout.dispose
  2239. @layout = nil
  2240. end
  2241.  
  2242. #--------------------------------------------------------------------------
  2243. # * Refresh Layout
  2244. #--------------------------------------------------------------------------
  2245. def refresh_layout
  2246. return if @layout == nil
  2247. @layout.x = @org_position_2[0]
  2248. @layout.y = @org_position_2[1]
  2249. @layout.x += ACTOR_WINDOW_SLIDE_POSITION[0] if ACTOR_WINDOW_SLIDE_EFFECT
  2250. @layout.y += ACTOR_WINDOW_SLIDE_POSITION[1] if ACTOR_WINDOW_SLIDE_EFFECT
  2251. @layout.visible = self.visible
  2252. end
  2253.  
  2254. if $imported[:ve_target_arrow]
  2255. #--------------------------------------------------------------------------
  2256. # * New method: show_actor
  2257. #--------------------------------------------------------------------------
  2258. alias mog_battle_hud_ex_show_actor show_actor
  2259. def show_actor
  2260. return true if SceneManager.face_battler?
  2261. mog_battle_hud_ex_show_actor
  2262. end
  2263. end
  2264.  
  2265. #--------------------------------------------------------------------------
  2266. # * Show
  2267. #--------------------------------------------------------------------------
  2268. alias mog_bg_ex_slide_show_actor show
  2269. def show
  2270. self.viewport = nil
  2271. self.x = @org_position[0] ; self.y = @org_position[1]
  2272. if ACTOR_WINDOW_SLIDE_EFFECT
  2273. self.x += ACTOR_WINDOW_SLIDE_POSITION[0]
  2274. self.y += ACTOR_WINDOW_SLIDE_POSITION[1]
  2275. end
  2276. self.opacity = ACTOR_WINDOW_OPACITY
  2277. mog_bg_ex_slide_show_actor
  2278. end
  2279.  
  2280. #--------------------------------------------------------------------------
  2281. # * Update
  2282. #--------------------------------------------------------------------------
  2283. alias mog_monogatari_actor_window_update update
  2284. def update
  2285. mog_monogatari_actor_window_update
  2286. self.visible = self.active
  2287. self.visible = false if @force_hide
  2288. if @layout != nil
  2289. refresh_layout if @layout.visible != self.visible
  2290. end
  2291. if !$game_temp.sprite_visible
  2292. self.visible = false
  2293. @layout.visible = self.visible if @layout != nil
  2294. end
  2295. execute_slide_effect if self.visible
  2296. end
  2297.  
  2298. end
  2299.  
  2300. #==============================================================================
  2301. # ** Window_BattleEnemy
  2302. #==============================================================================
  2303. class Window_BattleEnemy < Window_Selectable
  2304.  
  2305. include MOG_BATTLE_HUD_EX
  2306.  
  2307. #--------------------------------------------------------------------------
  2308. # * Initialize
  2309. #--------------------------------------------------------------------------
  2310. alias mog_monogatari_battle_enemy_initialize initialize
  2311. def initialize(info_viewport)
  2312. @force_hide = can_force_hide?
  2313. mog_monogatari_battle_enemy_initialize(info_viewport)
  2314. self.width = ENEMY_WINDOW_SIZE[0]
  2315. self.height = ENEMY_WINDOW_SIZE[1]
  2316. @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
  2317. ENEMY_WINDOW_POSITION[1] - self.height]
  2318. @org_position[1] = Graphics.height + 64 if @force_hide
  2319. self.x = @org_position[0]
  2320. self.y = @org_position[1]
  2321. self.opacity = ENEMY_WINDOW_OPACITY
  2322. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2323. create_layout
  2324. end
  2325.  
  2326. #--------------------------------------------------------------------------
  2327. # * Can Force Hide?
  2328. #--------------------------------------------------------------------------
  2329. def can_force_hide?
  2330. return true if $imported[:ve_target_arrow]
  2331. return true if $imported[:mog_battle_cursor]
  2332. return false
  2333. end
  2334.  
  2335. #--------------------------------------------------------------------------
  2336. # * Dispose
  2337. #--------------------------------------------------------------------------
  2338. alias mog_monogatari_enemy_window_dispose dispose
  2339. def dispose
  2340. mog_monogatari_enemy_window_dispose
  2341. dispose_layout
  2342. end
  2343.  
  2344. #--------------------------------------------------------------------------
  2345. # * Create Layout
  2346. #--------------------------------------------------------------------------
  2347. def create_layout
  2348. return if @layout != nil
  2349. return if !ENEMY_WINDOW_LAYOUT
  2350. return if $game_temp.mbhud_window[4]
  2351. $game_temp.mbhud_window[4] = true
  2352. @org_position_2 = [self.x + ENEMY_WINDOW_LAYOUT_POSITION[0],self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]]
  2353. @layout = Sprite.new
  2354. @layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
  2355. @layout.z = self.z - 1
  2356. refresh_layout
  2357. @layout.visible = false
  2358. end
  2359.  
  2360. #--------------------------------------------------------------------------
  2361. # * Dispose Layout
  2362. #--------------------------------------------------------------------------
  2363. def dispose_layout
  2364. return if @layout == nil
  2365. @layout.dispose
  2366. @layout = nil
  2367. end
  2368.  
  2369. #--------------------------------------------------------------------------
  2370. # * Refresh Layout
  2371. #--------------------------------------------------------------------------
  2372. def refresh_layout
  2373. return if @layout == nil
  2374. @layout.x = @org_position_2[0]
  2375. @layout.y = @org_position_2[1]
  2376. @layout.x += ENEMY_WINDOW_SLIDE_POSITION[0] if ENEMY_WINDOW_SLIDE_EFFECT
  2377. @layout.y += ENEMY_WINDOW_SLIDE_POSITION[1] if ENEMY_WINDOW_SLIDE_EFFECT
  2378. @layout.visible = self.visible
  2379. end
  2380.  
  2381. #--------------------------------------------------------------------------
  2382. # * Show
  2383. #--------------------------------------------------------------------------
  2384. alias mog_bg_ex_slide_show_enemy show
  2385. def show
  2386. self.viewport = nil
  2387. self.x = @org_position[0] ; self.y = @org_position[1]
  2388. if ENEMY_WINDOW_SLIDE_EFFECT
  2389. self.x += ENEMY_WINDOW_SLIDE_POSITION[0]
  2390. self.y += ENEMY_WINDOW_SLIDE_POSITION[1]
  2391. end
  2392. self.opacity = ENEMY_WINDOW_OPACITY
  2393. mog_bg_ex_slide_show_enemy
  2394. end
  2395.  
  2396. #--------------------------------------------------------------------------
  2397. # * Update
  2398. #--------------------------------------------------------------------------
  2399. alias mog_monogatari_enemy_window_update update
  2400. def update
  2401. mog_monogatari_enemy_window_update
  2402. self.visible = false if @force_hide
  2403. if @layout != nil and @layout.visible != self.visible
  2404. refresh_layout
  2405. end
  2406. if !$game_temp.sprite_visible
  2407. self.visible = false
  2408. @layout.visible = self.visible if @layout != nil
  2409. end
  2410. execute_slide_effect if self.visible
  2411. end
  2412.  
  2413. if $imported["YEA-BattleEngine"]
  2414. #--------------------------------------------------------------------------
  2415. # * Draw Item
  2416. #--------------------------------------------------------------------------
  2417. def draw_item(index)
  2418. change_color(normal_color)
  2419. name = $game_troop.alive_members[index].name
  2420. draw_text(item_rect_for_text(index), name)
  2421. end
  2422. end
  2423.  
  2424. #--------------------------------------------------------------------------
  2425. # * Process Cursor Move
  2426. #--------------------------------------------------------------------------
  2427. alias mog_atb_wenemy_process_cursor_move process_cursor_move
  2428. def process_cursor_move
  2429. return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2430. mog_atb_wenemy_process_cursor_move
  2431. end
  2432.  
  2433. #--------------------------------------------------------------------------
  2434. # * Process Handling
  2435. #--------------------------------------------------------------------------
  2436. alias mog_atb_wenemy_process_handling process_handling
  2437. def process_handling
  2438. return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2439. mog_atb_wenemy_process_handling
  2440. end
  2441.  
  2442. end
  2443.  
  2444. #==============================================================================
  2445. # ** Window_BattleSkill
  2446. #==============================================================================
  2447. class Window_BattleSkill < Window_SkillList
  2448. include MOG_BATTLE_HUD_EX
  2449.  
  2450. #--------------------------------------------------------------------------
  2451. # * Initialize
  2452. #--------------------------------------------------------------------------
  2453. alias mog_monogatari_battle_skill_initialize initialize
  2454. def initialize(help_window, info_viewport)
  2455. @force_hide = can_force_hide?
  2456. @force_hide_active = can_force_hide_active?
  2457. mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  2458. self.width = SKILL_WINDOW_SIZE[0]
  2459. self.height = SKILL_WINDOW_SIZE[1]
  2460. @org_position = [SKILL_WINDOW_POSITION[0],
  2461. Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  2462. self.x = @org_position[0]
  2463. self.y = @org_position[1]
  2464. self.opacity = SKILL_WINDOW_OPACITY
  2465. self.viewport = nil
  2466. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2467. create_layout
  2468. end
  2469.  
  2470. #--------------------------------------------------------------------------
  2471. # * Col Max
  2472. #--------------------------------------------------------------------------
  2473. def col_max
  2474. return SKILL_COL_MAX
  2475. end
  2476.  
  2477. #--------------------------------------------------------------------------
  2478. # * Can Force Hide Active?
  2479. #--------------------------------------------------------------------------
  2480. def can_force_hide_active?
  2481. return true if $imported[:ve_target_arrow]
  2482. return true if $imported[:mog_battle_cursor] != nil
  2483. return false
  2484. end
  2485.  
  2486. #--------------------------------------------------------------------------
  2487. # * Can Force Hide?
  2488. #--------------------------------------------------------------------------
  2489. def can_force_hide?
  2490. return false
  2491. end
  2492.  
  2493. #--------------------------------------------------------------------------
  2494. # * Dispose
  2495. #--------------------------------------------------------------------------
  2496. alias mog_monogatari_skill_window_dispose dispose
  2497. def dispose
  2498. mog_monogatari_skill_window_dispose
  2499. dispose_layout
  2500. end
  2501.  
  2502. #--------------------------------------------------------------------------
  2503. # * Create Layout
  2504. #--------------------------------------------------------------------------
  2505. def create_layout
  2506. return if @layout != nil
  2507. return if !SKILL_WINDOW_LAYOUT
  2508. return if $game_temp.mbhud_window[5]
  2509. $game_temp.mbhud_window[5] = true
  2510. @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
  2511. @layout = Sprite.new
  2512. @layout.bitmap = Cache.battle_hud("Layout_Skill")
  2513. @layout.z = self.z - 1
  2514. refresh_layout
  2515. @layout.visible = false
  2516. end
  2517.  
  2518. #--------------------------------------------------------------------------
  2519. # * Dispose Layout
  2520. #--------------------------------------------------------------------------
  2521. def dispose_layout
  2522. return if @layout == nil
  2523. @layout.dispose
  2524. @layout = nil
  2525. end
  2526.  
  2527. #--------------------------------------------------------------------------
  2528. # * Refresh Layout
  2529. #--------------------------------------------------------------------------
  2530. def refresh_layout
  2531. return if @layout == nil
  2532. @layout.x = @org_position_2[0]
  2533. @layout.y = @org_position_2[1]
  2534. @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
  2535. @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
  2536. @layout.visible = self.visible
  2537. end
  2538.  
  2539. #--------------------------------------------------------------------------
  2540. # * Show
  2541. #--------------------------------------------------------------------------
  2542. alias mog_bg_ex_slide_show_skill show
  2543. def show
  2544. self.viewport = nil
  2545. self.x = @org_position[0] ; self.y = @org_position[1]
  2546. if SKILL_WINDOW_SLIDE_EFFECT
  2547. self.x += SKILL_WINDOW_SLIDE_POSITION[0]
  2548. self.y += SKILL_WINDOW_SLIDE_POSITION[1]
  2549. end
  2550. self.opacity = SKILL_WINDOW_OPACITY
  2551. mog_bg_ex_slide_show_skill
  2552. end
  2553.  
  2554. #--------------------------------------------------------------------------
  2555. # * Update
  2556. #--------------------------------------------------------------------------
  2557. alias mog_monogatari_skill_window_update update
  2558. def update
  2559. mog_monogatari_skill_window_update
  2560. self.visible = self.active if @force_hide_active
  2561. self.visible = false if @force_hide
  2562. if @layout != nil and @layout.visible != self.visible
  2563. refresh_layout
  2564. end
  2565. self.visible = false if !$game_temp.sprite_visible
  2566. execute_slide_effect if self.visible
  2567. end
  2568.  
  2569. end
  2570.  
  2571. #==============================================================================
  2572. # ** Window_BattleItem
  2573. #==============================================================================
  2574. class Window_BattleItem < Window_ItemList
  2575. include MOG_BATTLE_HUD_EX
  2576.  
  2577. #--------------------------------------------------------------------------
  2578. # * Initialize
  2579. #--------------------------------------------------------------------------
  2580. alias mog_monogatari_battle_item_initialize initialize
  2581. def initialize(help_window, info_viewport)
  2582. @force_hide = can_force_hide?
  2583. @force_hide_active = can_force_hide_active?
  2584. mog_monogatari_battle_item_initialize(help_window, info_viewport)
  2585. self.width = ITEM_WINDOW_SIZE[0]
  2586. self.height = ITEM_WINDOW_SIZE[1]
  2587. @org_position = [ITEM_WINDOW_POSITION[0],
  2588. Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  2589. self.x = @org_position[0]
  2590. self.y = @org_position[1]
  2591. self.viewport = nil
  2592. self.opacity = ITEM_WINDOW_OPACITY
  2593. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2594. create_layout
  2595. end
  2596.  
  2597. #--------------------------------------------------------------------------
  2598. # * Col Max
  2599. #--------------------------------------------------------------------------
  2600. def col_max
  2601. return ITEM_COL_MAX
  2602. end
  2603.  
  2604. #--------------------------------------------------------------------------
  2605. # * Can Force Hide Active?
  2606. #--------------------------------------------------------------------------
  2607. def can_force_hide_active?
  2608. return true if $imported[:ve_target_arrow]
  2609. return true if $imported[:mog_battle_cursor] != nil
  2610. return false
  2611. end
  2612.  
  2613. #--------------------------------------------------------------------------
  2614. # * Can Force Hide?
  2615. #--------------------------------------------------------------------------
  2616. def can_force_hide?
  2617. return false
  2618. end
  2619.  
  2620. #--------------------------------------------------------------------------
  2621. # * Dispose
  2622. #--------------------------------------------------------------------------
  2623. alias mog_monogatari_item_window_dispose dispose
  2624. def dispose
  2625. mog_monogatari_item_window_dispose
  2626. dispose_layout
  2627. end
  2628.  
  2629. #--------------------------------------------------------------------------
  2630. # * Create Layout
  2631. #--------------------------------------------------------------------------
  2632. def create_layout
  2633. return if @layout != nil
  2634. return if !ITEM_WINDOW_LAYOUT
  2635. return if $game_temp.mbhud_window[6]
  2636. $game_temp.mbhud_window[6] = true
  2637. @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
  2638. @layout = Sprite.new
  2639. @layout.bitmap = Cache.battle_hud("Layout_Item")
  2640. @layout.z = self.z - 1
  2641. refresh_layout
  2642. @layout.visible = false
  2643. end
  2644.  
  2645. #--------------------------------------------------------------------------
  2646. # * Dispose Layout
  2647. #--------------------------------------------------------------------------
  2648. def dispose_layout
  2649. return if @layout == nil
  2650. @layout.dispose
  2651. @layout = nil
  2652. end
  2653.  
  2654. #--------------------------------------------------------------------------
  2655. # * Refresh Layout
  2656. #--------------------------------------------------------------------------
  2657. def refresh_layout
  2658. return if @layout == nil
  2659. @layout.x = @org_position_2[0]
  2660. @layout.y = @org_position_2[1]
  2661. @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
  2662. @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
  2663. @layout.visible = self.visible
  2664. end
  2665.  
  2666. #--------------------------------------------------------------------------
  2667. # * Show
  2668. #--------------------------------------------------------------------------
  2669. alias mog_bg_ex_slide_show_item show
  2670. def show
  2671. self.viewport = nil
  2672. self.x = @org_position[0] ; self.y = @org_position[1]
  2673. if ITEM_WINDOW_SLIDE_EFFECT
  2674. self.x += ITEM_WINDOW_SLIDE_POSITION[0]
  2675. self.y += ITEM_WINDOW_SLIDE_POSITION[1]
  2676. end
  2677. self.opacity = ITEM_WINDOW_OPACITY
  2678. mog_bg_ex_slide_show_item
  2679. end
  2680.  
  2681. #--------------------------------------------------------------------------
  2682. # * Update
  2683. #--------------------------------------------------------------------------
  2684. alias mog_monogatari_item_window_update update
  2685. def update
  2686. mog_monogatari_item_window_update
  2687. self.visible = self.active if @force_hide_active
  2688. self.visible = false if @force_hide
  2689. if @layout != nil
  2690. refresh_layout if @layout.visible != self.visible
  2691. end
  2692. self.visible = false if !$game_temp.sprite_visible
  2693. execute_slide_effect if self.visible
  2694. end
  2695.  
  2696. end
  2697.  
  2698. end
  2699.  
  2700. #--------------------------------------------------------------------------
  2701. #--------------------------------------------------------------------------
  2702. #################################
  2703. if $imported["YEA-BattleEngine"]
  2704. #################################
  2705.  
  2706. #==============================================================================
  2707. # ** Window_BattleStatusAid
  2708. #==============================================================================
  2709. class Window_BattleStatusAid < Window_BattleStatus
  2710.  
  2711. #--------------------------------------------------------------------------
  2712. # * Refresh
  2713. #--------------------------------------------------------------------------
  2714. def refresh
  2715. contents.clear
  2716. self.visible = false
  2717. end
  2718.  
  2719. end
  2720.  
  2721. #==============================================================================
  2722. # ** Window_BattleStatus
  2723. #==============================================================================
  2724. class Window_BattleStatus < Window_Selectable
  2725.  
  2726. #--------------------------------------------------------------------------
  2727. # * Update
  2728. #--------------------------------------------------------------------------
  2729. alias mog_monogatari_bhud_yf_update update
  2730. def update
  2731. mog_monogatari_bhud_yf_update
  2732. update_visible_yf
  2733. end
  2734.  
  2735. #--------------------------------------------------------------------------
  2736. # * Update Visible Yf
  2737. #--------------------------------------------------------------------------
  2738. def update_visible_yf
  2739. self.visible = self.active
  2740. self.visible = false if !$game_temp.sprite_visible
  2741. end
  2742.  
  2743. end
  2744.  
  2745. #==============================================================================
  2746. # ■ Window ActorCommand
  2747. #==============================================================================
  2748. class Window_ActorCommand < Window_Command
  2749.  
  2750. #--------------------------------------------------------------------------
  2751. # * Show
  2752. #--------------------------------------------------------------------------
  2753. alias mog_bhud_yf_command_show show
  2754. def show
  2755. return if !BattleManager.can_enable_window?
  2756. mog_bhud_yf_command_show
  2757. end
  2758.  
  2759. #--------------------------------------------------------------------------
  2760. # * Update
  2761. #--------------------------------------------------------------------------
  2762. alias mog_monogatari_bhud_yf_actorcommand_update update
  2763. def update
  2764. mog_monogatari_bhud_yf_actorcommand_update
  2765. update_visible_yf
  2766. end
  2767.  
  2768. #--------------------------------------------------------------------------
  2769. # * Update Visible Yf
  2770. #--------------------------------------------------------------------------
  2771. def update_visible_yf
  2772. self.visible = self.active
  2773. self.visible = false if !$game_temp.sprite_visible
  2774. end
  2775.  
  2776. end
  2777.  
  2778. #==============================================================================
  2779. # ** Scene Battle
  2780. #==============================================================================
  2781. class Scene_Battle < Scene_Base
  2782.  
  2783. include MOG_BATTLE_HUD_EX
  2784.  
  2785. #--------------------------------------------------------------------------
  2786. # alias method: create_skill_window
  2787. #--------------------------------------------------------------------------
  2788. alias mog_yf_scene_battle_create_skill_window create_skill_window
  2789. def create_skill_window
  2790. mog_yf_scene_battle_create_skill_window
  2791. @skill_window.width = SKILL_WINDOW_SIZE[0]
  2792. @skill_window.height = SKILL_WINDOW_SIZE[1]
  2793. @skill_window.x = SKILL_WINDOW_POSITION[0]
  2794. @skill_window.y = SKILL_WINDOW_POSITION[1]
  2795. end
  2796.  
  2797. #--------------------------------------------------------------------------
  2798. # alias method: create_item_window
  2799. #--------------------------------------------------------------------------
  2800. alias mog_yf_scene_battle_create_item_window create_item_window
  2801. def create_item_window
  2802. mog_yf_scene_battle_create_item_window
  2803. @item_window.width = ITEM_WINDOW_SIZE[0]
  2804. @item_window.height = ITEM_WINDOW_SIZE[1]
  2805. @item_window.x = ITEM_WINDOW_POSITION[0]
  2806. @item_window.y = ITEM_WINDOW_POSITION[1]
  2807. end
  2808.  
  2809. if !$imported[:mog_atb_system]
  2810. #--------------------------------------------------------------------------
  2811. # * Next Command
  2812. #--------------------------------------------------------------------------
  2813. def next_command
  2814. if BattleManager.next_command
  2815. @status_window.show
  2816. redraw_current_status
  2817. @actor_command_window.show
  2818. @status_aid_window.hide
  2819. start_actor_command_selection
  2820. else
  2821. turn_start
  2822. end
  2823. end
  2824. end
  2825.  
  2826. #--------------------------------------------------------------------------
  2827. # * STW Can Visible
  2828. #--------------------------------------------------------------------------
  2829. def stw_can_visible?
  2830. return false if !BattleManager.can_enable_window?
  2831. return false if @item_window.visible
  2832. return false if @skill_window.visible
  2833. return true if @actor_window.active
  2834. return false
  2835. end
  2836.  
  2837. if $imported["YEA-CommandEquip"]
  2838. #--------------------------------------------------------------------------
  2839. # * Command Equip
  2840. #--------------------------------------------------------------------------
  2841. alias mog_yf_command_equip command_equip
  2842. def command_equip
  2843. @actor_command_window.visible = false
  2844. @actor_command_window.update
  2845. $game_temp.battle_hud_visible_refresh = [true,false]
  2846. @spriteset.update_battle_hud_ex
  2847. @spriteset.battler_sprites.each do |s| s.dispose_animation end
  2848. mog_yf_command_equip
  2849. $game_temp.battle_hud_visible_refresh = [true,true]
  2850. end
  2851. end
  2852.  
  2853. end
  2854.  
  2855. end
  2856. #--------------------------------------------------------------------------
  2857.  
  2858.  
  2859. ######################################
  2860. if $imported["YEA-EnemyTargetInfo"]
  2861. ######################################
  2862.  
  2863. #==============================================================================
  2864. # ■ Window_Comparison
  2865. #==============================================================================
  2866. class Window_Comparison < Window_Base
  2867.  
  2868. #--------------------------------------------------------------------------
  2869. # * Refresh
  2870. #--------------------------------------------------------------------------
  2871. alias mog_battle_hud_ex_yf_refresh refresh
  2872. def refresh
  2873. mog_battle_hud_ex_yf_refresh
  2874. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2875. self.viewport = nil
  2876. end
  2877.  
  2878. end
  2879.  
  2880. #==============================================================================
  2881. # ■ Window_ComparisonHelp
  2882. #==============================================================================
  2883. class Window_ComparisonHelp < Window_Base
  2884.  
  2885. #--------------------------------------------------------------------------
  2886. # * Refresh
  2887. #--------------------------------------------------------------------------
  2888. alias mog_battle_hud_ex_yf_refresh refresh
  2889. def refresh
  2890. mog_battle_hud_ex_yf_refresh
  2891. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2892. self.viewport = nil
  2893. end
  2894.  
  2895. end
  2896. end
  2897. #--------------------------------------------------------------------------
  2898. #--------------------------------------------------------------------------
  2899.  
  2900.  
  2901. #################################
  2902. if $imported["YEA-EnemyTargetInfo"]
  2903. #################################
  2904. class Window_Comparison < Window_Base
  2905.  
  2906. #--------------------------------------------------------------------------
  2907. # initialize
  2908. #--------------------------------------------------------------------------
  2909. alias mog_battle_hud_yf_wcomparison_initialize initialize
  2910. def initialize(type)
  2911. mog_battle_hud_yf_wcomparison_initialize(type)
  2912. self.z = 102
  2913. end
  2914.  
  2915. end
  2916. end
  2917. #--------------------------------------------------------------------------
  2918. #--------------------------------------------------------------------------
  2919.  
  2920. #--------------------------------------------------------------------------
  2921. #--------------------------------------------------------------------------
  2922. #################################
  2923. if $imported["YSA-CATB"]
  2924. #################################
  2925.  
  2926. #==============================================================================
  2927. # ■ Enemy CATB Gauge Viewport
  2928. #==============================================================================
  2929. class Enemy_CATB_Gauge_Viewport < Viewport
  2930.  
  2931. #--------------------------------------------------------------------------
  2932. # initialize
  2933. #--------------------------------------------------------------------------
  2934. alias mog_battle_hud_ex_yami_initialize initialize
  2935. def initialize(battler, sprite, type)
  2936. mog_battle_hud_ex_yami_initialize(battler, sprite, type)
  2937. self.z = 90
  2938. end
  2939.  
  2940. end
  2941.  
  2942. #==============================================================================
  2943. # ■ Game_Battler
  2944. #==============================================================================
  2945. class Game_Battler < Game_BattlerBase
  2946.  
  2947. attr_accessor :catb_value
  2948. attr_accessor :max_atb
  2949.  
  2950. #--------------------------------------------------------------------------
  2951. # * Max ATB
  2952. #--------------------------------------------------------------------------
  2953. def max_atb
  2954. return MAX_CATB_VALUE
  2955. return 1
  2956. end
  2957.  
  2958. end
  2959.  
  2960. end
  2961. #--------------------------------------------------------------------------
  2962. #--------------------------------------------------------------------------
  2963.  
  2964. #==============================================================================
  2965. # ** Window Base
  2966. #==============================================================================
  2967. class Window_Base < Window
  2968.  
  2969. #--------------------------------------------------------------------------
  2970. # * Execute Move W
  2971. #--------------------------------------------------------------------------
  2972. def execute_move_w(sprite,type,cp,np)
  2973. sp = 6 + ((cp - np).abs / 10)
  2974. if cp > np ; cp -= sp ; cp = np if cp < np
  2975. elsif cp < np ; cp += sp ; cp = np if cp > np
  2976. end
  2977. sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  2978. end
  2979.  
  2980. #--------------------------------------------------------------------------
  2981. # * Set BH EX Font
  2982. #--------------------------------------------------------------------------
  2983. def set_bh_ex_font
  2984. return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
  2985. self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
  2986. self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
  2987. self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
  2988. self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
  2989. end
  2990.  
  2991. #--------------------------------------------------------------------------
  2992. # * Execute Slide Effect
  2993. #--------------------------------------------------------------------------
  2994. def execute_slide_effect
  2995. return if @org_position == nil
  2996. execute_move_w(self,0,self.x,@org_position[0])
  2997. execute_move_w(self,1,self.y,@org_position[1])
  2998. return if @layout == nil
  2999. execute_move_w(@layout,0,@layout.x,@org_position_2[0])
  3000. execute_move_w(@layout,1,@layout.y,@org_position_2[1])
  3001. end
  3002.  
  3003. end
  3004.  
  3005. #==============================================================================
  3006. # ** Window Help
  3007. #==============================================================================
  3008. class Window_Help < Window_Base
  3009.  
  3010. #--------------------------------------------------------------------------
  3011. # * Draw Text
  3012. #--------------------------------------------------------------------------
  3013. alias mog_bh_ex_draw_text_help draw_text
  3014. def draw_text(*args)
  3015. set_bh_ex_font
  3016. mog_bh_ex_draw_text_help(*args)
  3017. end
  3018.  
  3019. end
  3020.  
  3021. #==============================================================================
  3022. # ** Window BattleActor
  3023. #==============================================================================
  3024. class Window_BattleActor < Window_BattleStatus
  3025.  
  3026. #--------------------------------------------------------------------------
  3027. # * Draw Item
  3028. #--------------------------------------------------------------------------
  3029. alias mog_bbex_draw_item_actor draw_item
  3030. def draw_item(index)
  3031. set_bh_ex_font
  3032. mog_bbex_draw_item_actor(index)
  3033. end
  3034.  
  3035. end
  3036.  
  3037. #==============================================================================
  3038. # ** Window BattleEnemy
  3039. #==============================================================================
  3040. class Window_BattleEnemy < Window_Selectable
  3041.  
  3042. #--------------------------------------------------------------------------
  3043. # * Draw Item
  3044. #--------------------------------------------------------------------------
  3045. alias mog_bbex_draw_item_enemy draw_item
  3046. def draw_item(index)
  3047. set_bh_ex_font
  3048. mog_bbex_draw_item_enemy(index)
  3049. end
  3050.  
  3051. end
  3052.  
  3053. #==============================================================================
  3054. # ** Window ItemList
  3055. #==============================================================================
  3056. class Window_ItemList < Window_Selectable
  3057.  
  3058. #--------------------------------------------------------------------------
  3059. # * Draw Item Name
  3060. #--------------------------------------------------------------------------
  3061. alias mog_bhex_draw_item_name_item draw_item_name
  3062. def draw_item_name(item, x, y, enabled = true, width = 172)
  3063. set_bh_ex_font
  3064. mog_bhex_draw_item_name_item(item, x, y, enabled , width )
  3065. end
  3066.  
  3067. end
  3068.  
  3069. #==============================================================================
  3070. # ** Window SkillList
  3071. #==============================================================================
  3072. class Window_SkillList < Window_Selectable
  3073.  
  3074. #--------------------------------------------------------------------------
  3075. # * Draw Item Name
  3076. #--------------------------------------------------------------------------
  3077. alias mog_bhex_draw_item_name_skill draw_item_name
  3078. def draw_item_name(item, x, y, enabled = true, width = 172)
  3079. set_bh_ex_font
  3080. mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
  3081. end
  3082.  
  3083. end
  3084.  
  3085. #==============================================================================
  3086. # ** Spriteset_Battle
  3087. #==============================================================================
  3088. class Spriteset_Battle
  3089.  
  3090. #--------------------------------------------------------------------------
  3091. # * Initialize
  3092. #--------------------------------------------------------------------------
  3093. alias mog_battle_hud_ex_initialize initialize
  3094. def initialize
  3095. check_screen_xyz_nil rescue nil
  3096. mog_battle_hud_ex_initialize
  3097. create_battle_hud_ex
  3098. end
  3099.  
  3100. #--------------------------------------------------------------------------
  3101. # * Check Screen Xyz
  3102. #--------------------------------------------------------------------------
  3103. def check_screen_xyz_nil
  3104. return if !SceneManager.face_battler?
  3105. for actor in $game_party.battle_members
  3106. actor.screen_x = 0 if actor.screen_x == nil
  3107. actor.screen_y = 0 if actor.screen_y == nil
  3108. actor.screen_z = 0 if actor.screen_z == nil
  3109. end
  3110. end
  3111.  
  3112. #--------------------------------------------------------------------------
  3113. # * Check Screen Xyz after
  3114. #--------------------------------------------------------------------------
  3115. def check_screen_xyz_after
  3116. return if !SceneManager.face_battler?
  3117. $game_party.battle_members.each_with_index do |actor, index|
  3118. actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  3119. actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  3120. actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  3121. end
  3122. end
  3123.  
  3124. #--------------------------------------------------------------------------
  3125. # * Dispose
  3126. #--------------------------------------------------------------------------
  3127. alias mog_battle_hud_ex_dispose dispose
  3128. def dispose
  3129. dispose_battle_hud_ex
  3130. mog_battle_hud_ex_dispose
  3131. end
  3132.  
  3133. #--------------------------------------------------------------------------
  3134. # * Update
  3135. #--------------------------------------------------------------------------
  3136. alias mog_battle_hud_ex_update update
  3137. def update
  3138. mog_battle_hud_ex_update
  3139. update_battle_hud_ex
  3140. end
  3141.  
  3142. #--------------------------------------------------------------------------
  3143. # * Create Battle Hud EX
  3144. #--------------------------------------------------------------------------
  3145. def create_battle_hud_ex
  3146. return if @battle_hud_ex != nil
  3147. $game_temp.battle_hud_visible = true
  3148. @battle_hud_ex = Monogatari_Bhud.new(nil)
  3149. check_screen_xyz_after
  3150. end
  3151.  
  3152. #--------------------------------------------------------------------------
  3153. # * Dispose Battle Hud EX
  3154. #--------------------------------------------------------------------------
  3155. def dispose_battle_hud_ex
  3156. return if @battle_hud_ex == nil
  3157. @battle_hud_ex.dispose
  3158. @battle_hud_ex = nil
  3159. $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  3160. end
  3161.  
  3162. #--------------------------------------------------------------------------
  3163. # * Update Battle Hud EX
  3164. #--------------------------------------------------------------------------
  3165. def update_battle_hud_ex
  3166. refresh_battle_hud if $game_temp.mbhud_force_refresh
  3167. return if @battle_hud_ex == nil
  3168. @battle_hud_ex.update
  3169. end
  3170.  
  3171. #--------------------------------------------------------------------------
  3172. # * Refresh Battle Hud
  3173. #--------------------------------------------------------------------------
  3174. def refresh_battle_hud
  3175. $game_temp.mbhud_force_refresh = false
  3176. check_screen_xyz_nil rescue nil
  3177. dispose_battle_hud_ex
  3178. create_battle_hud_ex
  3179. end
  3180.  
  3181. end
  3182.  
  3183. #==============================================================================
  3184. # ** Monogatari Bhud
  3185. #==============================================================================
  3186. class Monogatari_Bhud
  3187.  
  3188. include MOG_BATTLE_HUD_EX
  3189.  
  3190. #--------------------------------------------------------------------------
  3191. # * Initialize
  3192. #--------------------------------------------------------------------------
  3193. def initialize(viewport)
  3194. @battle_hud = [] ; @sprite_visitle_wait = 0
  3195. $game_party.battle_members.each_with_index do |actor, index|
  3196. @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
  3197. create_turn_sprite(nil)
  3198. create_screen_layout(nil)
  3199. end
  3200.  
  3201. #--------------------------------------------------------------------------
  3202. # * Max members
  3203. #--------------------------------------------------------------------------
  3204. def max_members
  3205. if $game_party.members.size > $game_party.max_battle_members
  3206. return $game_party.max_battle_members
  3207. end
  3208. return $game_party.members.size
  3209. end
  3210.  
  3211. #--------------------------------------------------------------------------
  3212. # * Dispose
  3213. #--------------------------------------------------------------------------
  3214. def dispose
  3215. @battle_hud.each {|sprite| sprite.dispose }
  3216. dispose_turn_sprite
  3217. dispose_screen_layout
  3218. end
  3219.  
  3220. #--------------------------------------------------------------------------
  3221. # * Update
  3222. #--------------------------------------------------------------------------
  3223. def update
  3224. @battle_hud.each {|sprite| sprite.update }
  3225. update_turn_sprite
  3226. update_screen_layout
  3227. refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
  3228. end
  3229.  
  3230. #--------------------------------------------------------------------------
  3231. # * Update
  3232. #--------------------------------------------------------------------------
  3233. def refresh_battle_hud_visible
  3234. $game_temp.battle_hud_visible_refresh[0] = false
  3235. @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
  3236. @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
  3237. @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
  3238. @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
  3239. end
  3240.  
  3241. end
  3242.  
  3243. #==============================================================================
  3244. # ** Monogatari Bhud
  3245. #==============================================================================
  3246. class Monogatari_Bhud
  3247.  
  3248. #--------------------------------------------------------------------------
  3249. # * Can Update Turn Sprite
  3250. #--------------------------------------------------------------------------
  3251. def can_refresh_turn_sprite?
  3252. return true if @turn_sprite.visible != $game_temp.command_visible
  3253. return true if $game_temp.refresh_turn_sprite
  3254. return false
  3255. end
  3256.  
  3257. #--------------------------------------------------------------------------
  3258. # * Create Turn Sprite
  3259. #--------------------------------------------------------------------------
  3260. def create_turn_sprite(viewport)
  3261. return if !TURN_SPRITE_VISIBLE
  3262. return if @turn_sprite != nil
  3263. @turn_sprite = Sprite.new
  3264. @turn_sprite.bitmap = Cache.battle_hud("Turn")
  3265. @turn_sprite.viewport = viewport
  3266. @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
  3267. @turn_sprite.visible = false
  3268. @turn_sprite_update_time = 5
  3269. @turn_sprite_blink = [0,0]
  3270. end
  3271.  
  3272. #--------------------------------------------------------------------------
  3273. # * Dispose Turn Sprite
  3274. #--------------------------------------------------------------------------
  3275. def dispose_turn_sprite
  3276. return if @turn_sprite == nil
  3277. @turn_sprite.dispose
  3278. @turn_sprite = nil
  3279. end
  3280.  
  3281. #--------------------------------------------------------------------------
  3282. # * Update Turn Sprite
  3283. #--------------------------------------------------------------------------
  3284. def update_turn_sprite
  3285. return if @turn_sprite == nil
  3286. if @turn_sprite_update_time > 0
  3287. @turn_sprite_update_time -= 1
  3288. return
  3289. end
  3290. update_turn_visible
  3291. update_turn_blink
  3292. end
  3293.  
  3294. #--------------------------------------------------------------------------
  3295. # * Update Turn Visible
  3296. #--------------------------------------------------------------------------
  3297. def update_turn_visible
  3298. $game_temp.refresh_turn_sprite = false
  3299. @turn_sprite.visible = can_turn_sprite_visible?
  3300. return if BattleManager.actor == nil
  3301. x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
  3302. y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
  3303. x = -1000 if x == nil ; y = -1000 if y == nil
  3304. @turn_sprite.x = x ; @turn_sprite.y = y
  3305. end
  3306.  
  3307. #--------------------------------------------------------------------------
  3308. # * Can Turn Sprite Visible?
  3309. #--------------------------------------------------------------------------
  3310. def can_turn_sprite_visible?
  3311. return false if BattleManager.actor == nil
  3312. return false if $game_temp.battle_end
  3313. return false if $game_message.visible
  3314. return true
  3315. end
  3316.  
  3317. #--------------------------------------------------------------------------
  3318. # * Update Turn Blink
  3319. #--------------------------------------------------------------------------
  3320. def update_turn_blink
  3321. return if !TURN_BLINK_EFFECT
  3322. return if !@turn_sprite.visible
  3323. @turn_sprite_blink[0] += 1
  3324. case @turn_sprite_blink[0]
  3325. when 0..30
  3326. @turn_sprite_blink[1] += 3
  3327. when 31..60
  3328. @turn_sprite_blink[1] -= 3
  3329. else
  3330. @turn_sprite_blink = [0,0]
  3331. end
  3332. @turn_sprite.opacity = 150 + @turn_sprite_blink[1]
  3333. end
  3334.  
  3335.  
  3336. end
  3337.  
  3338. #==============================================================================
  3339. # ** Monogatari Bhud
  3340. #==============================================================================
  3341. class Monogatari_Bhud
  3342.  
  3343. #--------------------------------------------------------------------------
  3344. # * Create Screen Layout
  3345. #--------------------------------------------------------------------------
  3346. def create_screen_layout(viewport)
  3347. return if !SCREEN_LAYOUT
  3348. @screen_layout = Sprite.new
  3349. @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
  3350. @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
  3351. @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
  3352. @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
  3353. @screen_layout.opacity = 0
  3354. @screen_layout.viewport = viewport
  3355. end
  3356.  
  3357. #--------------------------------------------------------------------------
  3358. # * Dispose Screen Layout
  3359. #--------------------------------------------------------------------------
  3360. def dispose_screen_layout
  3361. return if @screen_layout == nil
  3362. @screen_layout.dispose ; @screen_layout = nil
  3363. end
  3364.  
  3365. #--------------------------------------------------------------------------
  3366. # * Update Screen Layout
  3367. #--------------------------------------------------------------------------
  3368. def update_screen_layout
  3369. return if @screen_layout == nil
  3370. @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  3371. sprite_visible(@screen_layout)
  3372. end
  3373.  
  3374. #--------------------------------------------------------------------------
  3375. # * Sprite Visible
  3376. #--------------------------------------------------------------------------
  3377. def sprite_visible?
  3378. return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3379. return false if !$game_temp.battle_hud_visible
  3380. return false if !$game_temp.sprite_visible
  3381. return true
  3382. end
  3383.  
  3384. #--------------------------------------------------------------------------
  3385. # * Sprite Visible
  3386. #--------------------------------------------------------------------------
  3387. def sprite_visible(sprite)
  3388. if sprite_visible?
  3389. sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3390. else
  3391. sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3392. end
  3393. end
  3394.  
  3395. end
  3396.  
  3397. #==============================================================================
  3398. #==============================================================================
  3399. # ** Battle Hud EX
  3400. #==============================================================================
  3401. #==============================================================================
  3402. class Battle_Hud_EX
  3403. include MOG_BATTLE_HUD_EX
  3404.  
  3405. #--------------------------------------------------------------------------
  3406. # * Initialize
  3407. #--------------------------------------------------------------------------
  3408. def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  3409. pre_cache
  3410. setup(actor,index,max_members)
  3411. create_sprites(viewport)
  3412. end
  3413.  
  3414. #--------------------------------------------------------------------------
  3415. # * Setup
  3416. #--------------------------------------------------------------------------
  3417. def setup(actor,index,max_members)
  3418. $game_temp.battle_end = false
  3419. @actor = actor
  3420. @actor_index = index
  3421. @max_members = max_members
  3422. @actor.face_animation = [0,0,0]
  3423. @hp_icon_max = -1
  3424. @hp_icon_old = -1
  3425. @hp_icon_col_max = HP_ICON_COL_MAX
  3426. @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  3427. @hp_icon_row_max = HP_ICON_ROW_MAX
  3428. @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  3429. @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  3430. @mp_icon_max = -1
  3431. @mp_icon_old = -1
  3432. @mp_icon_col_max = MP_ICON_COL_MAX
  3433. @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  3434. @mp_icon_row_max = MP_ICON_ROW_MAX
  3435. @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  3436. @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  3437. @tp_icon_max = -1
  3438. @tp_icon_old = -1
  3439. @tp_icon_col_max = TP_ICON_COL_MAX
  3440. @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  3441. @tp_icon_row_max = TP_ICON_ROW_MAX
  3442. @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  3443. @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  3444. @sprite_visible = true
  3445. @sprite_visitle_wait = 0
  3446. setup_actor
  3447. setup_position
  3448. end
  3449.  
  3450. #--------------------------------------------------------------------------
  3451. # * Setup Actor
  3452. #--------------------------------------------------------------------------
  3453. def setup_actor
  3454. return if @actor == nil
  3455. @hp_number_refresh = true
  3456. @hp_number2_refresh = true
  3457. @hp_number_old = @actor.hp
  3458. @hp_number2_old = @actor.mhp
  3459. @hp_old_meter = 0
  3460. @mp_number_refresh = true
  3461. @mp_number2_refresh = true
  3462. @mp_number_old = @actor.mp
  3463. @mp_number2_old = @actor.mmp
  3464. @mp_old_meter = 0
  3465. @tp_number_refresh = true
  3466. @tp_number2_refresh = true
  3467. @tp_number_old = @actor.tp
  3468. @tp_number2_old = @actor.max_tp
  3469. @tp_old_meter = 0
  3470. @at_number_refresh = true
  3471. @at_number2_refresh = true
  3472. @at_number_old = actor_at
  3473. @at_number2_old = actor_max_at
  3474. @at_old_meter = 0
  3475. catb = ATB::MAX_AP rescue nil
  3476. @ccwinter_atb = true if catb != nil
  3477. end
  3478.  
  3479. #--------------------------------------------------------------------------
  3480. # * Terminate
  3481. #--------------------------------------------------------------------------
  3482. def terminate
  3483. @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
  3484. end
  3485.  
  3486. #--------------------------------------------------------------------------
  3487. # * AT
  3488. #--------------------------------------------------------------------------
  3489. def actor_at
  3490. return @actor.atb if $imported[:mog_atb_system]
  3491. return @actor.atb if $imported[:ve_active_time_battle]
  3492. return @actor.catb_value if $imported["YSA-CATB"]
  3493. return @actor.ap if @ccwinter_atb != nil
  3494. return 0
  3495. end
  3496.  
  3497. #--------------------------------------------------------------------------
  3498. # * Max AT
  3499. #--------------------------------------------------------------------------
  3500. def actor_max_at
  3501. return @actor.atb_max if $imported[:mog_atb_system]
  3502. return @actor.max_atb if $imported[:ve_active_time_battle]
  3503. return @actor.max_atb if $imported["YSA-CATB"]
  3504. return ATB::MAX_AP if @ccwinter_atb != nil
  3505. return 1
  3506. end
  3507.  
  3508. #--------------------------------------------------------------------------
  3509. # ● Actor Cast
  3510. #--------------------------------------------------------------------------
  3511. def actor_cast
  3512. return @actor.atb_cast[1] if $imported[:mog_atb_system]
  3513. return @actor.atb if $imported[:ve_active_time_battle]
  3514. return @actor.chant_count rescue 0 if @ccwinter_atb != nil
  3515. return 0
  3516. end
  3517.  
  3518. #--------------------------------------------------------------------------
  3519. # ● Actor Max Cast
  3520. #--------------------------------------------------------------------------
  3521. def actor_max_cast
  3522. if $imported[:mog_atb_system]
  3523. return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
  3524. return @actor.atb_cast[0].speed.abs
  3525. end
  3526. return @actor.max_atb if $imported[:ve_active_time_battle]
  3527. return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
  3528. return 1
  3529. end
  3530.  
  3531. #--------------------------------------------------------------------------
  3532. # ● Actor Cast?
  3533. #--------------------------------------------------------------------------
  3534. def actor_cast?
  3535. if $imported[:mog_atb_system]
  3536. return true if !@actor.atb_cast.empty?
  3537. end
  3538. if $imported[:ve_active_time_battle]
  3539. return true if @actor.cast_action?
  3540. end
  3541. if @ccwinter_atb
  3542. return true if @actor.chanting?
  3543. end
  3544. return false
  3545. end
  3546.  
  3547. #--------------------------------------------------------------------------
  3548. # * Create Sprites
  3549. #--------------------------------------------------------------------------
  3550. def create_sprites(viewport)
  3551. dispose
  3552. return if @actor == nil
  3553. create_layout(viewport)
  3554. create_layout_2(viewport)
  3555. create_name(viewport)
  3556. create_face(viewport)
  3557. create_hp_number(viewport)
  3558. create_hp_number_max(viewport)
  3559. create_hp_meter(viewport)
  3560. create_hp_icon(viewport)
  3561. create_hp_icon_ex(viewport)
  3562. create_hp_icon_number(viewport)
  3563. create_mp_number(viewport)
  3564. create_mp_number_max(viewport)
  3565. create_mp_meter(viewport)
  3566. create_mp_icon(viewport)
  3567. create_mp_icon_ex(viewport)
  3568. create_mp_icon_number(viewport)
  3569. create_tp_number(viewport)
  3570. create_tp_number_max(viewport)
  3571. create_tp_meter(viewport)
  3572. create_tp_icon(viewport)
  3573. create_tp_icon_ex(viewport)
  3574. create_tp_icon_number(viewport)
  3575. create_at_number(viewport)
  3576. create_at_number_max(viewport)
  3577. create_at_meter(viewport)
  3578. create_level_number(viewport)
  3579. create_states(viewport)
  3580. update
  3581. end
  3582.  
  3583. #--------------------------------------------------------------------------
  3584. # * Sprite Visible
  3585. #--------------------------------------------------------------------------
  3586. def sprite_visible?
  3587. return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3588. return false if !$game_temp.battle_hud_visible
  3589. return false if !$game_temp.sprite_visible
  3590. return true
  3591. end
  3592.  
  3593. #--------------------------------------------------------------------------
  3594. # * Sprite Visible
  3595. #--------------------------------------------------------------------------
  3596. def sprite_visible(sprite)
  3597. if @sprite_visible
  3598. sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3599. else
  3600. sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3601. end
  3602. end
  3603.  
  3604. end
  3605.  
  3606. #==============================================================================
  3607. #==============================================================================
  3608. # ** Battle Hud EX
  3609. #==============================================================================
  3610. #==============================================================================
  3611. class Battle_Hud_EX
  3612.  
  3613. #--------------------------------------------------------------------------
  3614. # * Setup Position
  3615. #--------------------------------------------------------------------------
  3616. def setup_position
  3617. sprite_width = (Graphics.width - 64) / 4
  3618. sprite_center = sprite_width / 2
  3619. if $game_party.battle_members.size > 4
  3620. members = $game_party.battle_members.size - 4
  3621. fx = 32 * members
  3622. else
  3623. fx = 0
  3624. end
  3625. space_x = MEMBERS_SPACE[0] - fx
  3626. space_y = MEMBERS_SPACE[1]
  3627. center = Graphics.width / 2
  3628. members_space = (Graphics.width + space_x) / @max_members
  3629. members_space2 = (members_space * @actor_index)
  3630. members_space3 = ((members_space / 2) * (@max_members - 1))
  3631. members_space_y = space_y * @actor_index
  3632. x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  3633. screen_resize_y = 0
  3634. screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  3635. y = HUD_POSITION[1] + members_space_y + screen_resize_y
  3636. @hud_position = [x,y]
  3637. $game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
  3638. $game_temp.hud_pos_real[@actor_index] = [x,y]
  3639. x2 = x + sprite_center
  3640. $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3641. $game_temp.hud_pos[@actor_index] = [x2,y]
  3642. if FIXED_HUD_POSITION[@actor_index] != nil
  3643. @hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
  3644. $game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
  3645. $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3646. $game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]
  3647. end
  3648. end
  3649.  
  3650. end
  3651.  
  3652. #==============================================================================
  3653. # ** Game Temp
  3654. #==============================================================================
  3655. class Game_Temp
  3656.  
  3657. attr_accessor :cache_bhud_sprites
  3658.  
  3659. #--------------------------------------------------------------------------
  3660. # * Cache Battle Hud
  3661. #--------------------------------------------------------------------------
  3662. def cache_battle_hud
  3663. execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  3664. end
  3665.  
  3666. #--------------------------------------------------------------------------
  3667. # * Execute Cache Bhud Sprites
  3668. #--------------------------------------------------------------------------
  3669. def execute_cache_bhud_sprites
  3670. @cache_bhud_sprites = []
  3671. windows = ["Layout_Command","Layout_Party","Layout_Help",
  3672. "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  3673. "Layout_Item"]
  3674. for s in windows
  3675. @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3676. end
  3677. sprites = ["Layout","Layout_2",
  3678. "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  3679. "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",
  3680. "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",
  3681. "LV_Number","Turn","Iconset","Layout_Screen"
  3682. ]
  3683. for s in sprites
  3684. @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3685. end
  3686. end
  3687.  
  3688. end
  3689.  
  3690. #==============================================================================
  3691. # ** Spriteset_Map
  3692. #==============================================================================
  3693. class Spriteset_Map
  3694.  
  3695. #--------------------------------------------------------------------------
  3696. # * Initialize
  3697. #--------------------------------------------------------------------------
  3698. alias mog_monogatari_bhud_initialize initialize
  3699. def initialize
  3700. $game_temp.cache_battle_hud
  3701. mog_monogatari_bhud_initialize
  3702. end
  3703.  
  3704. end
  3705.  
  3706. #==============================================================================
  3707. #==============================================================================
  3708. # ** Battle Hud EX
  3709. #==============================================================================
  3710. #==============================================================================
  3711. class Battle_Hud_EX
  3712.  
  3713. #--------------------------------------------------------------------------
  3714. # * Pre Cache
  3715. #--------------------------------------------------------------------------
  3716. def pre_cache
  3717. $game_temp.cache_battle_hud
  3718. @force_hide = false
  3719. @force_hide_time = 0
  3720. @fade_hud = false
  3721. @fade_hud_gold = false
  3722. @fade_hud_equip = false
  3723. @layout_image = Cache.battle_hud("Layout")
  3724. @layout_cw = @layout_image.width
  3725. @layout_ch = @layout_image.height
  3726. @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  3727. @layout2_cw = @layout2_image.width if @layout2_image != nil
  3728. @layout2_ch = @layout2_image.height if @layout2_image != nil
  3729. @layout2_cw = 0 if @layout2_cw == nil
  3730. #------------------------------------------------
  3731. # HP
  3732. #------------------------------------------------
  3733. if HP_NUMBER_VISIBLE
  3734. @hp_number_image = Cache.battle_hud("HP_Number")
  3735. @hp_number_cw = @hp_number_image.width / 10
  3736. if HP_NUMBER_LOW_COLOR
  3737. @hp_number_ch = @hp_number_image.height / 2
  3738. else
  3739. @hp_number_ch = @hp_number_image.height
  3740. end
  3741. @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  3742. @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number
  3743. end
  3744. if HP_NUMBER_MAX_VISIBLE
  3745. @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  3746. @hp_number2_cw = @hp_number2_image.width / 10
  3747. @hp_number2_ch = @hp_number2_image.height
  3748. end
  3749. if HP_METER_VISIBLE
  3750. @hp_meter_image = Cache.battle_hud("HP_Meter")
  3751. if HP_METER_GRADIENT_ANIMATION
  3752. @hp_meter_cw = @hp_meter_image.width / 3
  3753. else
  3754. @hp_meter_cw = @hp_meter_image.width
  3755. end
  3756. if HP_METER_REDUCTION_ANIMATION
  3757. @hp_meter_ch = @hp_meter_image.height / 2
  3758. else
  3759. @hp_meter_ch = @hp_meter_image.height
  3760. end
  3761. end
  3762. if HP_ICON_VISIBLE
  3763. @hp_icon_image = Cache.battle_hud("HP_Icon")
  3764. @hp_icon_cw = @hp_icon_image.width / 2
  3765. @hp_icon_ch = @hp_icon_image.height
  3766. end
  3767. if HP_ICON_EX_VISIBLE
  3768. @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  3769. @hp_icon2_cw = @hp_icon2_image.width
  3770. @hp_icon2_ch = @hp_icon2_image.height
  3771. end
  3772. if HP_ICON_NUMBER_VISIBLE
  3773. @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  3774. @hp_icon_number_cw = @hp_icon_number_image.width / 10
  3775. @hp_icon_number_ch = @hp_icon_number_image.height
  3776. end
  3777. #------------------------------------------------
  3778. # MP
  3779. #------------------------------------------------
  3780. if MP_NUMBER_VISIBLE
  3781. @mp_number_image = Cache.battle_hud("MP_Number")
  3782. @mp_number_cw = @mp_number_image.width / 10
  3783. if MP_NUMBER_LOW_COLOR
  3784. @mp_number_ch = @mp_number_image.height / 2
  3785. else
  3786. @mp_number_ch = @mp_number_image.height
  3787. end
  3788. @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  3789. @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  3790. end
  3791. if MP_NUMBER_MAX_VISIBLE
  3792. @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  3793. @mp_number2_cw = @mp_number2_image.width / 10
  3794. @mp_number2_ch = @mp_number2_image.height
  3795. end
  3796. if MP_METER_VISIBLE
  3797. @mp_meter_image = Cache.battle_hud("MP_Meter")
  3798. if MP_METER_GRADIENT_ANIMATION
  3799. @mp_meter_cw = @mp_meter_image.width / 3
  3800. else
  3801. @mp_meter_cw = @mp_meter_image.width
  3802. end
  3803. if MP_METER_REDUCTION_ANIMATION
  3804. @mp_meter_ch = @mp_meter_image.height / 2
  3805. else
  3806. @mp_meter_ch = @mp_meter_image.height
  3807. end
  3808. end
  3809. if MP_ICON_VISIBLE
  3810. @mp_icon_image = Cache.battle_hud("MP_Icon")
  3811. @mp_icon_cw = @mp_icon_image.width / 2
  3812. @mp_icon_ch = @mp_icon_image.height
  3813. end
  3814. if MP_ICON_EX_VISIBLE
  3815. @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  3816. @mp_icon2_cw = @mp_icon2_image.width
  3817. @mp_icon2_ch = @mp_icon2_image.height
  3818. end
  3819. if MP_ICON_NUMBER_VISIBLE
  3820. @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  3821. @mp_icon_number_cw = @mp_icon_number_image.width / 10
  3822. @mp_icon_number_ch = @mp_icon_number_image.height
  3823. end
  3824. #------------------------------------------------
  3825. # TP
  3826. #------------------------------------------------
  3827. if TP_NUMBER_VISIBLE
  3828. @tp_number_image = Cache.battle_hud("TP_Number")
  3829. @tp_number_cw = @tp_number_image.width / 10
  3830. if TP_NUMBER_LOW_COLOR
  3831. @tp_number_ch = @tp_number_image.height / 2
  3832. else
  3833. @tp_number_ch = @tp_number_image.height
  3834. end
  3835. @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  3836. @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number
  3837. end
  3838. if TP_NUMBER_MAX_VISIBLE
  3839. @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  3840. @tp_number2_cw = @tp_number2_image.width / 10
  3841. @tp_number2_ch = @tp_number2_image.height
  3842. end
  3843. if TP_METER_VISIBLE
  3844. @tp_meter_image = Cache.battle_hud("TP_Meter")
  3845. if TP_METER_GRADIENT_ANIMATION
  3846. @tp_meter_cw = @tp_meter_image.width / 3
  3847. else
  3848. @tp_meter_cw = @tp_meter_image.width
  3849. end
  3850. if TP_METER_REDUCTION_ANIMATION
  3851. @tp_meter_ch = @tp_meter_image.height / 2
  3852. else
  3853. @tp_meter_ch = @tp_meter_image.height
  3854. end
  3855. end
  3856. if TP_ICON_VISIBLE
  3857. @tp_icon_image = Cache.battle_hud("TP_Icon")
  3858. @tp_icon_cw = @tp_icon_image.width / 2
  3859. @tp_icon_ch = @tp_icon_image.height
  3860. end
  3861. if TP_ICON_EX_VISIBLE
  3862. @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  3863. @tp_icon2_cw = @tp_icon2_image.width
  3864. @tp_icon2_ch = @tp_icon2_image.height
  3865. end
  3866. if TP_ICON_NUMBER_VISIBLE
  3867. @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  3868. @tp_icon_number_cw = @tp_icon_number_image.width / 10
  3869. @tp_icon_number_ch = @tp_icon_number_image.height
  3870. end
  3871. #------------------------------------------------
  3872. # AT
  3873. #------------------------------------------------
  3874. if AT_NUMBER_VISIBLE
  3875. @at_number_image = Cache.battle_hud("AT_Number")
  3876. @at_number_cw = @at_number_image.width / 10
  3877. @at_number_ch = @at_number_image.height
  3878. @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  3879. @at_number_ch += (@at_number_ch / 2) if @at_wave_number
  3880. end
  3881. if AT_NUMBER_MAX_VISIBLE
  3882. @at_number2_image = Cache.battle_hud("Max_AT_Number")
  3883. @at_number2_cw = @at_number2_image.width / 10
  3884. @at_number2_ch = @at_number2_image.height
  3885. end
  3886. if AT_METER_VISIBLE
  3887. @at_meter_image = Cache.battle_hud("AT_Meter")
  3888. if AT_METER_GRADIENT_ANIMATION
  3889. @at_meter_cw = @at_meter_image.width / 3
  3890. else
  3891. @at_meter_cw = @at_meter_image.width
  3892. end
  3893. @at_meter_ch = @at_meter_image.height / 3
  3894. end
  3895. #------------------------------------------------
  3896. # LV
  3897. #------------------------------------------------
  3898. if LEVEL_NUMBER_VISIBLE
  3899. @lv_number_image = Cache.battle_hud("LV_Number")
  3900. @lv_number_cw = @lv_number_image.width / 10
  3901. @lv_number_ch = @lv_number_image.height
  3902. end
  3903. #------------------------------------------------
  3904. # ICON
  3905. #------------------------------------------------
  3906. if STATES_VISIBLE or EQUIPMENT_VISIBLE
  3907. @icon_image = Cache.system("Iconset")
  3908. end
  3909. end
  3910.  
  3911. #--------------------------------------------------------------------------
  3912. # * Check Icon Image
  3913. #--------------------------------------------------------------------------
  3914. def check_icon_image
  3915. if @icon_image == nil or @icon_image.disposed?
  3916. @icon_image = Cache.system("Iconset")
  3917. end
  3918. end
  3919.  
  3920. end
  3921.  
  3922. #==============================================================================
  3923. #==============================================================================
  3924. # ** Battle Hud EX
  3925. #==============================================================================
  3926. #==============================================================================
  3927. class Battle_Hud_EX
  3928.  
  3929. #--------------------------------------------------------------------------
  3930. # * Update Number
  3931. #--------------------------------------------------------------------------
  3932. def update_number(type,value)
  3933. actor_value = @actor.hp if type == 0
  3934. actor_value = @actor.mp if type == 1
  3935. actor_value = @actor.tp if type == 2
  3936. actor_value = @actor.mhp if type == 3
  3937. actor_value = @actor.mmp if type == 4
  3938. actor_value = @actor.max_tp if type == 5
  3939. actor_value = actor_at if type == 6
  3940. actor_value = actor_max_at if type == 7
  3941. if value < actor_value
  3942. value += number_refresh_speed(actor_value,value)
  3943. value = actor_value if value >= actor_value
  3944. refresh_sprite_number(type,value)
  3945. elsif value > actor_value
  3946. value -= number_refresh_speed(actor_value,value)
  3947. value = actor_value if value <= actor_value
  3948. refresh_sprite_number(type,value)
  3949. end
  3950. end
  3951.  
  3952. #--------------------------------------------------------------------------
  3953. # * Number Refresh Speed
  3954. #--------------------------------------------------------------------------
  3955. def number_refresh_speed(actor_value,value)
  3956. n = 1 * (actor_value - value).abs / 10
  3957. return [[n, 99999999].min,1].max
  3958. end
  3959.  
  3960. #--------------------------------------------------------------------------
  3961. # * Update Number Fix
  3962. #--------------------------------------------------------------------------
  3963. def update_number_fix(type)
  3964. if type == 0
  3965. @hp_number_old = @actor.hp
  3966. @hp_number_refresh = true
  3967. elsif type == 1
  3968. @mp_number_old = @actor.mp
  3969. @mp_number_refresh = true
  3970. elsif type == 2
  3971. @tp_number_old = @actor.tp
  3972. @tp_number_refresh = true
  3973. elsif type == 3
  3974. @hp_number2_old = @actor.mhp
  3975. @hp_number2_refresh = true
  3976. elsif type == 4
  3977. @mp_number2_old = @actor.mmp
  3978. @mp_number2_refresh = true
  3979. elsif type == 5
  3980. @tp_number2_old = @actor.max_tp
  3981. @tp_number2_refresh = true
  3982. elsif type == 6
  3983. @at_number_old = actor_at
  3984. @at_number_refresh = true
  3985. elsif type == 7
  3986. @at_number2_old = actor_max_at
  3987. @at_number2_refresh = true
  3988. end
  3989. end
  3990.  
  3991. #--------------------------------------------------------------------------
  3992. # * Refresh Sprite Number
  3993. #--------------------------------------------------------------------------
  3994. def refresh_sprite_number(type,value)
  3995. @hp_number_refresh = true if type == 0
  3996. @hp_number_old = value if type == 0
  3997. @mp_number_refresh = true if type == 1
  3998. @mp_number_old = value if type == 1
  3999. @tp_number_refresh = true if type == 2
  4000. @tp_number_old = value if type == 2
  4001. @hp_number2_refresh = true if type == 3
  4002. @hp_number2_old = value if type == 3
  4003. @mp_number2_refresh = true if type == 4
  4004. @mp_number2_old = value if type == 4
  4005. @tp_number2_refresh = true if type == 5
  4006. @tp_number2_old = value if type == 5
  4007. @at_number_refresh = true if type == 6
  4008. @at_number_old = value if type == 6
  4009. @at_number2_refresh = true if type == 7
  4010. @at_number2_old = value if type == 7
  4011. end
  4012.  
  4013. #--------------------------------------------------------------------------
  4014. # * Refresh Number
  4015. #--------------------------------------------------------------------------
  4016. def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  4017. sprite.bitmap.clear
  4018. clear_number_refresh(type)
  4019. number_color = low_number_color(type,number_ch)
  4020. if type == 0 and HP_NUMBER_PERCENTAGE
  4021. value_max = @actor.mhp
  4022. value = value.to_f / value_max.to_f * 100
  4023. value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  4024. elsif type == 1 and MP_NUMBER_PERCENTAGE
  4025. value_max = @actor.mmp
  4026. value = value.to_f / value_max.to_f * 100
  4027. elsif type == 2 and TP_NUMBER_PERCENTAGE
  4028. value_max = @actor.max_tp
  4029. value = value.to_f / value_max.to_f * 100
  4030. elsif type == 3 and HP_NUMBER_PERCENTAGE
  4031. value = 100
  4032. elsif type == 4 and MP_NUMBER_PERCENTAGE
  4033. value = 100
  4034. elsif type == 5 and TP_NUMBER_PERCENTAGE
  4035. value = 100
  4036. elsif type == 6 and AT_NUMBER_PERCENTAGE
  4037. value_max = actor_max_at
  4038. value = value.to_f / value_max.to_f * 100
  4039. elsif type == 7 and AT_NUMBER_PERCENTAGE
  4040. value = 100
  4041. end
  4042. value = 9999999 if value > 9999999
  4043. number_value = value.truncate.abs.to_s.split(//)
  4044. wave_h = 0
  4045. wave_h2 = wave_number ? (number_ch / 3) : 0
  4046. wave_h3 = number_color != 0 ? wave_h2 : 0
  4047. for r in 0..number_value.size - 1
  4048. number_value_abs = number_value[r].to_i
  4049. wh = wave_h2 * wave_h
  4050. wh2 = wave_h == 0 ? wave_h2 : 0
  4051. nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  4052. sprite.bitmap.blt(number_cw * r, wh, image, nsrc_rect)
  4053. wave_h = wave_h == 0 ? 1 : 0
  4054. end
  4055. refresh_number_position(type,number_value.size,number_cw)
  4056. end
  4057.  
  4058. #--------------------------------------------------------------------------
  4059. # * Refresh Number
  4060. #--------------------------------------------------------------------------
  4061. def refresh_number_position(type,number_value,number_cw)
  4062. cx = number_value * number_cw
  4063. if type == 0
  4064. case HP_NUMBER_ALIGN_TYPE
  4065. when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4066. when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  4067. when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  4068. end
  4069. elsif type == 1
  4070. case MP_NUMBER_ALIGN_TYPE
  4071. when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4072. when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  4073. when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  4074. end
  4075. elsif type == 2
  4076. case TP_NUMBER_ALIGN_TYPE
  4077. when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4078. when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  4079. when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  4080. end
  4081. elsif type == 3
  4082. case HP_NUMBER_ALIGN_TYPE
  4083. when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4084. when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4085. when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  4086. end
  4087. elsif type == 4
  4088. case MP_NUMBER_ALIGN_TYPE
  4089. when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4090. when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4091. when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  4092. end
  4093. elsif type == 5
  4094. case TP_NUMBER_ALIGN_TYPE
  4095. when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4096. when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4097. when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  4098. end
  4099. elsif type == 6
  4100. case MP_NUMBER_ALIGN_TYPE
  4101. when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4102. when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4103. when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4104. end
  4105. elsif type == 7
  4106. case AT_NUMBER_ALIGN_TYPE
  4107. when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4108. when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4109. when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4110. end
  4111. end
  4112. end
  4113.  
  4114. #--------------------------------------------------------------------------
  4115. # * Low Number Color
  4116. #--------------------------------------------------------------------------
  4117. def low_number_color(type,number_ch)
  4118. if type == 0
  4119. if HP_NUMBER_LOW_COLOR
  4120. return @actor.low_hp? ? number_ch : 0
  4121. else
  4122. return 0
  4123. end
  4124. elsif type == 1
  4125. if MP_NUMBER_LOW_COLOR
  4126. return @actor.low_mp? ? number_ch : 0
  4127. else
  4128. return 0
  4129. end
  4130. elsif type == 2
  4131. if TP_NUMBER_LOW_COLOR
  4132. return @actor.low_tp? ? number_ch : 0
  4133. else
  4134. return 0
  4135. end
  4136. else
  4137. return 0
  4138. end
  4139. end
  4140.  
  4141. #--------------------------------------------------------------------------
  4142. # * Clear Number Refresh
  4143. #--------------------------------------------------------------------------
  4144. def clear_number_refresh(type)
  4145. @hp_number_refresh = false if type == 0
  4146. @mp_number_refresh = false if type == 1
  4147. @tp_number_refresh = false if type == 2
  4148. @hp_number2_refresh = false if type == 3
  4149. @mp_number2_refresh = false if type == 4
  4150. @tp_number2_refresh = false if type == 5
  4151. @at_number_refresh = false if type == 6
  4152. @at_number2_refresh = false if type == 7
  4153. end
  4154.  
  4155. #--------------------------------------------------------------------------
  4156. # * Icon Limit
  4157. #--------------------------------------------------------------------------
  4158. def icon_limit(value,value_max)
  4159. n1 = value / value_max
  4160. n2 = value - (n1 * value_max)
  4161. n2 = value_max if (n2 == 0 and value > 0)
  4162. return n2
  4163. end
  4164.  
  4165. end
  4166.  
  4167. #==============================================================================
  4168. #==============================================================================
  4169. # ** Battle Hud EX
  4170. #==============================================================================
  4171. #==============================================================================
  4172. class Battle_Hud_EX
  4173.  
  4174. #--------------------------------------------------------------------------
  4175. # * Create Layout
  4176. #--------------------------------------------------------------------------
  4177. def create_layout(viewport)
  4178. @layout = Sprite.new
  4179. @layout.bitmap = @layout_image
  4180. @layout.z = HUD_Z
  4181. @layout.x = @hud_position[0]
  4182. @layout.y = @hud_position[1]
  4183. @layout.opacity = 0
  4184. @layout.viewport = viewport
  4185. end
  4186.  
  4187. #--------------------------------------------------------------------------
  4188. # * Update Layout
  4189. #--------------------------------------------------------------------------
  4190. def update_layout
  4191. return if @layout == nil
  4192. sprite_visible(@layout)
  4193. end
  4194.  
  4195. #--------------------------------------------------------------------------
  4196. # * Create Layout
  4197. #--------------------------------------------------------------------------
  4198. def create_layout_2(viewport)
  4199. return if !SECOND_LAYOUT
  4200. @layout2 = Sprite.new
  4201. @layout2.bitmap = @layout2_image
  4202. @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  4203. @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  4204. @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  4205. @layout2.opacity = 0
  4206. @layout2.viewport = viewport
  4207. end
  4208.  
  4209. #--------------------------------------------------------------------------
  4210. # * Update Layout
  4211. #--------------------------------------------------------------------------
  4212. def update_layout_2
  4213. return if @layout2 == nil
  4214. sprite_visible(@layout2)
  4215. end
  4216.  
  4217. end
  4218.  
  4219. #==============================================================================
  4220. #==============================================================================
  4221. # ** Battle Hud EX
  4222. #==============================================================================
  4223. #==============================================================================
  4224. class Battle_Hud_EX
  4225.  
  4226. #--------------------------------------------------------------------------
  4227. # * Create Name
  4228. #--------------------------------------------------------------------------
  4229. def create_name(viewport)
  4230. return if !NAME_VISIBLE
  4231. @name = Sprite.new
  4232. @name.bitmap = Bitmap.new(160,32)
  4233. @name.bitmap.font.size = NAME_FONT_SIZE
  4234. @name.bitmap.font.bold = NAME_FONT_BOLD
  4235. @name.bitmap.font.italic = NAME_FONT_ITALIC
  4236. @name.bitmap.font.color = NAME_FONT_COLOR
  4237. @name.z = HUD_Z + NAME_Z
  4238. @name.x = @hud_position[0] + NAME_POSITION[0]
  4239. @name.y = @hud_position[1] + NAME_POSITION[1]
  4240. @name.viewport = viewport
  4241. @name.opacity = 0
  4242. refresh_name
  4243. end
  4244.  
  4245. #--------------------------------------------------------------------------
  4246. # * Refresh Name
  4247. #--------------------------------------------------------------------------
  4248. def refresh_name
  4249. return if @name == nil
  4250. @name.bitmap.clear
  4251. if NAME_FONT_SHADOW
  4252. @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  4253. @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  4254. @name.bitmap.font.color = NAME_FONT_COLOR
  4255. end
  4256. @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  4257. end
  4258.  
  4259. #--------------------------------------------------------------------------
  4260. # * Update Name
  4261. #--------------------------------------------------------------------------
  4262. def update_name
  4263. return if @name == nil
  4264. sprite_visible(@name)
  4265. end
  4266.  
  4267. end
  4268.  
  4269. #==============================================================================
  4270. #==============================================================================
  4271. # ** Battle Hud EX
  4272. #==============================================================================
  4273. #==============================================================================
  4274. class Battle_Hud_EX
  4275.  
  4276. #--------------------------------------------------------------------------
  4277. # * Create HP Number
  4278. #--------------------------------------------------------------------------
  4279. def create_hp_number(viewport)
  4280. return if !HP_NUMBER_VISIBLE
  4281. @hp_number = Sprite.new
  4282. @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
  4283. @hp_number.z = HUD_Z + HP_NUMBER_Z
  4284. @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4285. @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  4286. @hp_number.viewport = viewport
  4287. @hp_number.opacity = 0
  4288. end
  4289.  
  4290. #--------------------------------------------------------------------------
  4291. # * Create HP Number Max
  4292. #--------------------------------------------------------------------------
  4293. def create_hp_number_max(viewport)
  4294. return if !HP_NUMBER_MAX_VISIBLE
  4295. @hp_number2 = Sprite.new
  4296. @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
  4297. @hp_number2.z = HUD_Z + HP_NUMBER_Z
  4298. @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4299. @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  4300. @hp_number2.viewport = viewport
  4301. @hp_number2.opacity = 0
  4302. end
  4303.  
  4304. #--------------------------------------------------------------------------
  4305. # * Create HP Meter
  4306. #--------------------------------------------------------------------------
  4307. def create_hp_meter(viewport)
  4308. return if !HP_METER_VISIBLE
  4309. @hp_flow_max = @hp_meter_cw * 2
  4310. @hp_flow = rand(@hp_flow_max)
  4311. @hp_meter = Sprite.new
  4312. @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  4313. @hp_meter.z = HUD_Z + HP_METER_Z
  4314. @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  4315. @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  4316. @hp_meter.angle = HP_METER_ANGLE
  4317. @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  4318. @hp_meter.viewport = viewport
  4319. @hp_meter.opacity = 0
  4320. end
  4321.  
  4322. #--------------------------------------------------------------------------
  4323. # ● Update Flow HP
  4324. #--------------------------------------------------------------------------
  4325. def update_flow_hp
  4326. @hp_meter.bitmap.clear
  4327. @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  4328. meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  4329. meter_width = 0 if meter_width == nil
  4330. execute_hp_damage_flow(meter_width)
  4331. meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  4332. @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)
  4333. @hp_flow += 1
  4334. @hp_flow = 0 if @hp_flow >= @hp_flow_max
  4335. end
  4336.  
  4337. #--------------------------------------------------------------------------
  4338. # ● Execute HP Damage Flow
  4339. #--------------------------------------------------------------------------
  4340. def execute_hp_damage_flow(meter_width)
  4341. return if !HP_METER_REDUCTION_ANIMATION
  4342. return if @hp_old_meter == meter_width
  4343. n = (@hp_old_meter - meter_width).abs * 3 / 100
  4344. damage_flow = [[n, 2].min,0.5].max
  4345. @hp_old_meter -= damage_flow
  4346. @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  4347. src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  4348. @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)
  4349. end
  4350.  
  4351. #--------------------------------------------------------------------------
  4352. # * Create HP Icon
  4353. #--------------------------------------------------------------------------
  4354. def create_hp_icon(viewport)
  4355. return if !HP_ICON_VISIBLE
  4356. @hp_icon = Sprite.new
  4357. icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  4358. icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  4359. @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4360. @hp_icon.z = HUD_Z + HP_ICON_Z
  4361. @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  4362. @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  4363. @hp_icon.viewport = viewport
  4364. @hp_icon.opacity = 0
  4365. end
  4366.  
  4367. #--------------------------------------------------------------------------
  4368. # * Refresh HP Icon
  4369. #--------------------------------------------------------------------------
  4370. def refresh_hp_icon
  4371. @hp_icon_old = @actor.hp
  4372. @hp_icon.bitmap.clear
  4373. max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  4374. if @actor.hp > max_value
  4375. icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  4376. else
  4377. icon_max = @actor.mhp
  4378. end
  4379. for i in 0...icon_max
  4380. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4381. 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)
  4382. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4383. i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  4384. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4385. end
  4386. icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  4387. rx = 0
  4388. ry = 0
  4389. for i in 0...icon_max
  4390. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4391. 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)
  4392. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4393. i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  4394. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4395. end
  4396. refresh_hp_icon_ex(rx,ry)
  4397. end
  4398.  
  4399. #--------------------------------------------------------------------------
  4400. # * Create HP Icon EX
  4401. #--------------------------------------------------------------------------
  4402. def create_hp_icon_ex(viewport)
  4403. return if !HP_ICON_EX_VISIBLE
  4404. @hp_icon3_anime_phase = 0
  4405. @hp_icon3 = Sprite.new
  4406. @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  4407. @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  4408. @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  4409. @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  4410. @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  4411. @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  4412. @hp_icon3.x = @hp_icon3_org[0]
  4413. @hp_icon3.y = @hp_icon3_org[1]
  4414. @hp_icon3.viewport = viewport
  4415. @hp_icon3.opacity = 0
  4416. end
  4417.  
  4418. #--------------------------------------------------------------------------
  4419. # * Refresh HP Icon EX
  4420. #--------------------------------------------------------------------------
  4421. def refresh_hp_icon_ex(rx,ry)
  4422. return if @hp_icon3 == nil
  4423. @hp_icon3.bitmap.clear
  4424. return if @actor.hp == 0
  4425. i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  4426. @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  4427. @hp_icon3.x = @hp_icon3_org[0] + rx
  4428. @hp_icon3.y = @hp_icon3_org[1] + ry
  4429. end
  4430.  
  4431. #--------------------------------------------------------------------------
  4432. # * Update Icon HP EX Anime
  4433. #--------------------------------------------------------------------------
  4434. def update_icon_hp_ex_anime
  4435. return if !HP_ICON_EX_ZOOM_EFFECT
  4436. if @hp_icon3_anime_phase == 0
  4437. @hp_icon3.zoom_x += 0.01
  4438. if @hp_icon3.zoom_x >= 1.30
  4439. @hp_icon3.zoom_x = 1.30
  4440. @hp_icon3_anime_phase = 1
  4441. end
  4442. else
  4443. @hp_icon3.zoom_x -= 0.01
  4444. if @hp_icon3.zoom_x <= 1.05
  4445. @hp_icon3.zoom_x = 1.05
  4446. @hp_icon3_anime_phase = 0
  4447. end
  4448. end
  4449. @hp_icon3.zoom_y = @hp_icon3.zoom_x
  4450. end
  4451.  
  4452. #--------------------------------------------------------------------------
  4453. # * Create HP Icon Nummber
  4454. #--------------------------------------------------------------------------
  4455. def create_hp_icon_number(viewport)
  4456. return if !HP_ICON_NUMBER_VISIBLE
  4457. @hp_icon_number_old = [-1,-1]
  4458. @hp_icon_number = Sprite.new
  4459. @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  4460. @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  4461. @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4462. @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  4463. @hp_icon_number.viewport = viewport
  4464. @hp_icon_number.opacity = 0
  4465. end
  4466.  
  4467. #--------------------------------------------------------------------------
  4468. # * Refresh Icon Number HP
  4469. #--------------------------------------------------------------------------
  4470. def refresh_icon_number_hp
  4471. @hp_icon_number_old[0] = @actor.hp
  4472. @hp_icon_number_old[1] = @actor.mhp
  4473. @hp_icon_number.bitmap.clear
  4474. value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  4475. value = 0 if value < 0
  4476. number_value = value.truncate.abs.to_s.split(//)
  4477. for r in 0..number_value.size - 1
  4478. number_value_abs = number_value[r].to_i
  4479. nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  4480. @hp_icon_number.bitmap.blt(@hp_icon_number_cw * r, 0, @hp_icon_number_image, nsrc_rect)
  4481. end
  4482. cx = (number_value.size * @hp_icon_number_cw)
  4483. case HP_ICON_NUMBER_ALIGN_TYPE
  4484. when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4485. when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4486. when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  4487. end
  4488. end
  4489.  
  4490. #--------------------------------------------------------------------------
  4491. # * Can Refresh Icon Number HP
  4492. #--------------------------------------------------------------------------
  4493. def can_refresh_icon_number_hp?
  4494. return true if @hp_icon_number_old[0] != @actor.hp
  4495. return true if @hp_icon_number_old[1] != @actor.mhp
  4496. return false
  4497. end
  4498.  
  4499. #--------------------------------------------------------------------------
  4500. # * Update HP
  4501. #--------------------------------------------------------------------------
  4502. def update_hp
  4503. if @hp_number != nil
  4504. if HP_NUMBER_ANIMATION
  4505. update_number(0,@hp_number_old)
  4506. else
  4507. update_number_fix(0) if @hp_number_old != @actor.hp
  4508. end
  4509. sprite_visible(@hp_number)
  4510. refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  4511. end
  4512. if @hp_number2 != nil
  4513. if HP_NUMBER_ANIMATION
  4514. update_number(3,@hp_number2_old)
  4515. else
  4516. update_number_fix(3) if @hp_number2_old != @actor.mhp
  4517. end
  4518. refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  4519. sprite_visible(@hp_number2)
  4520. end
  4521. if @hp_meter != nil
  4522. sprite_visible(@hp_meter)
  4523. update_flow_hp
  4524. end
  4525. if @hp_icon != nil
  4526. sprite_visible(@hp_icon)
  4527. refresh_hp_icon if @hp_icon_old != @actor.hp
  4528. end
  4529. if @hp_icon3 != nil
  4530. sprite_visible(@hp_icon3)
  4531. update_icon_hp_ex_anime
  4532. end
  4533. if @hp_icon_number != nil
  4534. sprite_visible(@hp_icon_number)
  4535. refresh_icon_number_hp if can_refresh_icon_number_hp?
  4536. end
  4537. end
  4538.  
  4539. end
  4540.  
  4541. #==============================================================================
  4542. #==============================================================================
  4543. # ** Battle Hud EX
  4544. #==============================================================================
  4545. #==============================================================================
  4546. class Battle_Hud_EX
  4547.  
  4548. #--------------------------------------------------------------------------
  4549. # * Create MP Number
  4550. #--------------------------------------------------------------------------
  4551. def create_mp_number(viewport)
  4552. return if !MP_NUMBER_VISIBLE
  4553. @mp_number = Sprite.new
  4554. @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
  4555. @mp_number.z = HUD_Z + MP_NUMBER_Z
  4556. @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4557. @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  4558. @mp_number.viewport = viewport
  4559. @mp_number.opacity = 0
  4560. end
  4561.  
  4562. #--------------------------------------------------------------------------
  4563. # * Create MP Number Max
  4564. #--------------------------------------------------------------------------
  4565. def create_mp_number_max(viewport)
  4566. return if !MP_NUMBER_MAX_VISIBLE
  4567. @mp_number2 = Sprite.new
  4568. @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
  4569. @mp_number2.z = HUD_Z + MP_NUMBER_Z
  4570. @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4571. @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  4572. @mp_number2.viewport = viewport
  4573. @mp_number2.opacity = 0
  4574. end
  4575.  
  4576. #--------------------------------------------------------------------------
  4577. # * Create MP Meter
  4578. #--------------------------------------------------------------------------
  4579. def create_mp_meter(viewport)
  4580. return if !MP_METER_VISIBLE
  4581. @mp_flow_max = @mp_meter_cw * 2
  4582. @mp_flow = rand(@mp_flow_max)
  4583. @mp_meter = Sprite.new
  4584. @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  4585. @mp_meter.z = HUD_Z + MP_METER_Z
  4586. @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  4587. @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  4588. @mp_meter.angle = MP_METER_ANGLE
  4589. @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  4590. @mp_meter.viewport = viewport
  4591. @mp_meter.opacity = 0
  4592. end
  4593.  
  4594. #--------------------------------------------------------------------------
  4595. # ● Update Flow MP
  4596. #--------------------------------------------------------------------------
  4597. def update_flow_mp
  4598. @mp_meter.bitmap.clear
  4599. @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  4600. meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  4601. meter_width = 0 if meter_width == nil
  4602. execute_mp_damage_flow(meter_width)
  4603. meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  4604. @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)
  4605. @mp_flow += 1
  4606. @mp_flow = 0 if @mp_flow >= @mp_flow_max
  4607. end
  4608.  
  4609. #--------------------------------------------------------------------------
  4610. # ● Execute MP Damage Flow
  4611. #--------------------------------------------------------------------------
  4612. def execute_mp_damage_flow(meter_width)
  4613. return if !MP_METER_REDUCTION_ANIMATION
  4614. return if @mp_old_meter == meter_width
  4615. n = (@mp_old_meter - meter_width).abs * 3 / 100
  4616. damage_flow = [[n, 2].min,0.5].max
  4617. @mp_old_meter -= damage_flow
  4618. @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  4619. src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  4620. @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)
  4621. end
  4622.  
  4623. #--------------------------------------------------------------------------
  4624. # * Create MP Icon
  4625. #--------------------------------------------------------------------------
  4626. def create_mp_icon(viewport)
  4627. return if !MP_ICON_VISIBLE
  4628. @mp_icon = Sprite.new
  4629. icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  4630. icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  4631. @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4632. @mp_icon.z = HUD_Z + MP_ICON_Z
  4633. @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  4634. @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  4635. @mp_icon.viewport = viewport
  4636. @mp_icon.opacity = 0
  4637. end
  4638.  
  4639. #--------------------------------------------------------------------------
  4640. # * Refresh MP Icon
  4641. #--------------------------------------------------------------------------
  4642. def refresh_mp_icon
  4643. @mp_icon_old = @actor.mp
  4644. @mp_icon.bitmap.clear
  4645. max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  4646. if @actor.mp > max_value
  4647. icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  4648. else
  4649. icon_max = @actor.mmp
  4650. end
  4651. for i in 0...icon_max
  4652. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4653. 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)
  4654. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4655. i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  4656. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4657. end
  4658. icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  4659. rx = 0
  4660. ry = 0
  4661. for i in 0...icon_max
  4662. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4663. 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)
  4664. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4665. i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  4666. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4667. end
  4668. refresh_mp_icon_ex(rx,ry)
  4669. end
  4670.  
  4671. #--------------------------------------------------------------------------
  4672. # * Create MP Icon EX
  4673. #--------------------------------------------------------------------------
  4674. def create_mp_icon_ex(viewport)
  4675. return if !MP_ICON_EX_VISIBLE
  4676. @mp_icon3_anime_phase = 0
  4677. @mp_icon3 = Sprite.new
  4678. @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  4679. @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  4680. @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  4681. @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  4682. @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  4683. @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  4684. @mp_icon3.x = @mp_icon3_org[0]
  4685. @mp_icon3.y = @mp_icon3_org[1]
  4686. @mp_icon3.viewport = viewport
  4687. @mp_icon3.opacity = 0
  4688. end
  4689.  
  4690. #--------------------------------------------------------------------------
  4691. # * Refresh MP Icon EX
  4692. #--------------------------------------------------------------------------
  4693. def refresh_mp_icon_ex(rx,ry)
  4694. return if @mp_icon3 == nil
  4695. @mp_icon3.bitmap.clear
  4696. return if @actor.mp == 0
  4697. i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  4698. @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  4699. @mp_icon3.x = @mp_icon3_org[0] + rx
  4700. @mp_icon3.y = @mp_icon3_org[1] + ry
  4701. end
  4702.  
  4703. #--------------------------------------------------------------------------
  4704. # * Update Icon MP EX Anime
  4705. #--------------------------------------------------------------------------
  4706. def update_icon_mp_ex_anime
  4707. return if !MP_ICON_EX_ZOOM_EFFECT
  4708. if @mp_icon3_anime_phase == 0
  4709. @mp_icon3.zoom_x += 0.01
  4710. if @mp_icon3.zoom_x >= 1.30
  4711. @mp_icon3.zoom_x = 1.30
  4712. @mp_icon3_anime_phase = 1
  4713. end
  4714. else
  4715. @mp_icon3.zoom_x -= 0.01
  4716. if @mp_icon3.zoom_x <= 1.05
  4717. @mp_icon3.zoom_x = 1.05
  4718. @mp_icon3_anime_phase = 0
  4719. end
  4720. end
  4721. @mp_icon3.zoom_y = @mp_icon3.zoom_x
  4722. end
  4723.  
  4724. #--------------------------------------------------------------------------
  4725. # * Create MP Icon Number
  4726. #--------------------------------------------------------------------------
  4727. def create_mp_icon_number(viewport)
  4728. return if !MP_ICON_NUMBER_VISIBLE
  4729. @mp_icon_number_old = [-1,-1]
  4730. @mp_icon_number = Sprite.new
  4731. @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  4732. @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  4733. @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4734. @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  4735. @mp_icon_number.viewport = viewport
  4736. @mp_icon_number.opacity = 0
  4737. end
  4738.  
  4739. #--------------------------------------------------------------------------
  4740. # * Refresh Icon Number MP
  4741. #--------------------------------------------------------------------------
  4742. def refresh_icon_number_mp
  4743. @mp_icon_number_old[0] = @actor.mp
  4744. @mp_icon_number_old[1] = @actor.mmp
  4745. @mp_icon_number.bitmap.clear
  4746. value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  4747. value = 0 if value < 0
  4748. number_value = value.truncate.abs.to_s.split(//)
  4749. for r in 0..number_value.size - 1
  4750. number_value_abs = number_value[r].to_i
  4751. nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  4752. @mp_icon_number.bitmap.blt(@mp_icon_number_cw * r, 0, @mp_icon_number_image, nsrc_rect)
  4753. end
  4754. cx = (number_value.size * @mp_icon_number_cw)
  4755. case MP_ICON_NUMBER_ALIGN_TYPE
  4756. when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4757. when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4758. when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  4759. end
  4760. end
  4761.  
  4762. #--------------------------------------------------------------------------
  4763. # * Can Refresh Icon Number MP
  4764. #--------------------------------------------------------------------------
  4765. def can_refresh_icon_number_mp?
  4766. return true if @mp_icon_number_old[0] != @actor.mp
  4767. return true if @mp_icon_number_old[1] != @actor.mmp
  4768. return false
  4769. end
  4770.  
  4771. #--------------------------------------------------------------------------
  4772. # * Update MP
  4773. #--------------------------------------------------------------------------
  4774. def update_mp
  4775. if @mp_number != nil
  4776. sprite_visible(@mp_number)
  4777. if MP_NUMBER_ANIMATION
  4778. update_number(1,@mp_number_old)
  4779. else
  4780. update_number_fix(1) if @mp_number_old != @actor.mp
  4781. end
  4782. refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  4783. end
  4784. if @mp_number2 != nil
  4785. sprite_visible(@mp_number2)
  4786. if MP_NUMBER_ANIMATION
  4787. update_number(4,@mp_number2_old)
  4788. else
  4789. update_number_fix(4) if @mp_number2_old != @actor.mmp
  4790. end
  4791. refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  4792. end
  4793. if @mp_meter != nil
  4794. sprite_visible(@mp_meter)
  4795. update_flow_mp
  4796. end
  4797. if @mp_icon != nil
  4798. sprite_visible(@mp_icon)
  4799. refresh_mp_icon if @mp_icon_old != @actor.mp
  4800. end
  4801. if @mp_icon3 != nil
  4802. sprite_visible(@mp_icon3)
  4803. update_icon_mp_ex_anime
  4804. end
  4805. if @mp_icon_number != nil
  4806. sprite_visible(@mp_icon_number)
  4807. refresh_icon_number_mp if can_refresh_icon_number_mp?
  4808. end
  4809. end
  4810.  
  4811. end
  4812.  
  4813. #==============================================================================
  4814. #==============================================================================
  4815. # ** Battle Hud EX
  4816. #==============================================================================
  4817. #==============================================================================
  4818. class Battle_Hud_EX
  4819.  
  4820. #--------------------------------------------------------------------------
  4821. # * Create TP Number
  4822. #--------------------------------------------------------------------------
  4823. def create_tp_number(viewport)
  4824. return if !TP_NUMBER_VISIBLE
  4825. @tp_number = Sprite.new
  4826. @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
  4827. @tp_number.z = HUD_Z + TP_NUMBER_Z
  4828. @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4829. @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  4830. @tp_number.viewport = viewport
  4831. @tp_number.opacity = 0
  4832. end
  4833.  
  4834. #--------------------------------------------------------------------------
  4835. # * Create TP Number MAX
  4836. #--------------------------------------------------------------------------
  4837. def create_tp_number_max(viewport)
  4838. return if !TP_NUMBER_MAX_VISIBLE
  4839. @tp_number2 = Sprite.new
  4840. @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
  4841. @tp_number2.z = HUD_Z + TP_NUMBER_Z
  4842. @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4843. @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  4844. @tp_number2.viewport = viewport
  4845. @tp_number2.opacity = 0
  4846. end
  4847.  
  4848. #--------------------------------------------------------------------------
  4849. # * Create TP Meter
  4850. #--------------------------------------------------------------------------
  4851. def create_tp_meter(viewport)
  4852. return if !TP_METER_VISIBLE
  4853. @tp_flow_max = @tp_meter_cw * 2
  4854. @tp_flow = rand(@tp_flow_max)
  4855. @tp_meter = Sprite.new
  4856. @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  4857. @tp_meter.z = HUD_Z + TP_METER_Z
  4858. @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  4859. @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  4860. @tp_meter.angle = TP_METER_ANGLE
  4861. @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  4862. @tp_meter.viewport = viewport
  4863. @tp_meter.opacity = 0
  4864. end
  4865.  
  4866. #--------------------------------------------------------------------------
  4867. # ● Update Flow TP
  4868. #--------------------------------------------------------------------------
  4869. def update_flow_tp
  4870. @tp_meter.bitmap.clear
  4871. @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  4872. meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil
  4873. meter_width = 0 if meter_width == nil
  4874. execute_tp_damage_flow(meter_width)
  4875. meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  4876. @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)
  4877. @tp_flow += 1
  4878. @tp_flow = 0 if @tp_flow >= @tp_flow_max
  4879. end
  4880.  
  4881. #--------------------------------------------------------------------------
  4882. # ● Execute TP Damage Flow
  4883. #--------------------------------------------------------------------------
  4884. def execute_tp_damage_flow(meter_width)
  4885. return if !TP_METER_REDUCTION_ANIMATION
  4886. return if @tp_old_meter == meter_width
  4887. n = (@tp_old_meter - meter_width).abs * 3 / 100
  4888. damage_flow = [[n, 2].min,0.5].max
  4889. @tp_old_meter -= damage_flow
  4890. @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  4891. src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  4892. @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)
  4893. end
  4894.  
  4895. #--------------------------------------------------------------------------
  4896. # * Create TP Icon
  4897. #--------------------------------------------------------------------------
  4898. def create_tp_icon(viewport)
  4899. return if !TP_ICON_VISIBLE
  4900. @tp_icon = Sprite.new
  4901. icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  4902. icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  4903. @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4904. @tp_icon.z = HUD_Z + TP_ICON_Z
  4905. @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  4906. @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  4907. @tp_icon.viewport = viewport
  4908. @tp_icon.opacity = 0
  4909. end
  4910.  
  4911. #--------------------------------------------------------------------------
  4912. # * Refresh TP Icon
  4913. #--------------------------------------------------------------------------
  4914. def refresh_tp_icon
  4915. @tp_icon_old = @actor.tp
  4916. @tp_icon.bitmap.clear
  4917. max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  4918. if @actor.mp > max_value
  4919. icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  4920. else
  4921. icon_max = @actor.max_tp
  4922. end
  4923. for i in 0...icon_max
  4924. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4925. 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)
  4926. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4927. i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  4928. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4929. end
  4930. icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  4931. rx = 0
  4932. ry = 0
  4933. for i in 0...icon_max
  4934. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4935. 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)
  4936. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4937. i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  4938. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4939. end
  4940. refresh_tp_icon_ex(rx,ry)
  4941. end
  4942.  
  4943. #--------------------------------------------------------------------------
  4944. # * Create TP Icon EX
  4945. #--------------------------------------------------------------------------
  4946. def create_tp_icon_ex(viewport)
  4947. return if !TP_ICON_EX_VISIBLE
  4948. @tp_icon3_anime_phase = 0
  4949. @tp_icon3 = Sprite.new
  4950. @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  4951. @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  4952. @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  4953. @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  4954. @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  4955. @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  4956. @tp_icon3.x = @tp_icon3_org[0]
  4957. @tp_icon3.y = @tp_icon3_org[1]
  4958. @tp_icon3.viewport = viewport
  4959. @tp_icon3.opacity = 0
  4960. end
  4961.  
  4962. #--------------------------------------------------------------------------
  4963. # * Refresh TP Icon EX
  4964. #--------------------------------------------------------------------------
  4965. def refresh_tp_icon_ex(rx,ry)
  4966. return if @tp_icon3 == nil
  4967. @tp_icon3.bitmap.clear
  4968. return if @actor.tp == 0
  4969. i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  4970. @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  4971. @tp_icon3.x = @tp_icon3_org[0] + rx
  4972. @tp_icon3.y = @tp_icon3_org[1] + ry
  4973. end
  4974.  
  4975. #--------------------------------------------------------------------------
  4976. # * Update Icon TP EX Anime
  4977. #--------------------------------------------------------------------------
  4978. def update_icon_tp_ex_anime
  4979. return if !MP_ICON_EX_ZOOM_EFFECT
  4980. if @tp_icon3_anime_phase == 0
  4981. @tp_icon3.zoom_x += 0.01
  4982. if @tp_icon3.zoom_x >= 1.30
  4983. @tp_icon3.zoom_x = 1.30
  4984. @tp_icon3_anime_phase = 1
  4985. end
  4986. else
  4987. @tp_icon3.zoom_x -= 0.01
  4988. if @tp_icon3.zoom_x <= 1.05
  4989. @tp_icon3.zoom_x = 1.05
  4990. @tp_icon3_anime_phase = 0
  4991. end
  4992. end
  4993. @tp_icon3.zoom_y = @tp_icon3.zoom_x
  4994. end
  4995.  
  4996. #--------------------------------------------------------------------------
  4997. # * Create HP Icon Number
  4998. #--------------------------------------------------------------------------
  4999. def create_tp_icon_number(viewport)
  5000. return if !TP_ICON_NUMBER_VISIBLE
  5001. @tp_icon_number_old = [-1,-1]
  5002. @tp_icon_number = Sprite.new
  5003. @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  5004. @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  5005. @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5006. @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  5007. @tp_icon_number.viewport = viewport
  5008. @tp_icon_number.opacity = 0
  5009. end
  5010.  
  5011. #--------------------------------------------------------------------------
  5012. # * Refresh Icon Number TP
  5013. #--------------------------------------------------------------------------
  5014. def refresh_icon_number_tp
  5015. @tp_icon_number_old[0] = @actor.tp
  5016. @tp_icon_number_old[1] = @actor.max_tp
  5017. @tp_icon_number.bitmap.clear
  5018. value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  5019. value = 0 if value < 0
  5020. number_value = value.truncate.abs.to_s.split(//)
  5021. for r in 0..number_value.size - 1
  5022. number_value_abs = number_value[r].to_i
  5023. nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  5024. @tp_icon_number.bitmap.blt(@tp_icon_number_cw * r, 0, @tp_icon_number_image, nsrc_rect)
  5025. end
  5026. cx = (number_value.size * @tp_icon_number_cw)
  5027. case TP_ICON_NUMBER_ALIGN_TYPE
  5028. when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5029. when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  5030. when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  5031. end
  5032. end
  5033.  
  5034. #--------------------------------------------------------------------------
  5035. # * Can Refresh Icon Number TP
  5036. #--------------------------------------------------------------------------
  5037. def can_refresh_icon_number_tp?
  5038. return true if @tp_icon_number_old[0] != @actor.tp
  5039. return true if @tp_icon_number_old[1] != @actor.max_tp
  5040. return false
  5041. end
  5042.  
  5043. #--------------------------------------------------------------------------
  5044. # * Update TP
  5045. #--------------------------------------------------------------------------
  5046. def update_tp
  5047. if @tp_number != nil
  5048. sprite_visible(@tp_number)
  5049. if MP_NUMBER_ANIMATION
  5050. update_number(2,@tp_number_old)
  5051. else
  5052. update_number_fix(2) if @tp_number_old != @actor.tp
  5053. end
  5054. refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh
  5055. end
  5056. if @tp_number2 != nil
  5057. sprite_visible(@tp_number2)
  5058. if MP_NUMBER_ANIMATION
  5059. update_number(5,@tp_number2_old)
  5060. else
  5061. update_number_fix(5) if @tp_number2_old != @actor.max_tp
  5062. end
  5063. refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  5064. end
  5065. if @tp_meter != nil
  5066. sprite_visible(@tp_meter)
  5067. update_flow_tp
  5068. end
  5069. if @tp_icon != nil
  5070. sprite_visible(@tp_icon)
  5071. refresh_tp_icon if @tp_icon_old != @actor.tp
  5072. end
  5073. if @tp_icon3 != nil
  5074. sprite_visible(@tp_icon3)
  5075. update_icon_tp_ex_anime
  5076. end
  5077. if @tp_icon_number != nil
  5078. sprite_visible(@tp_icon_number)
  5079. refresh_icon_number_tp if can_refresh_icon_number_tp?
  5080. end
  5081. end
  5082.  
  5083. end
  5084.  
  5085. #==============================================================================
  5086. #==============================================================================
  5087. # ** Battle Hud EX
  5088. #==============================================================================
  5089. #==============================================================================
  5090. class Battle_Hud_EX
  5091.  
  5092. #--------------------------------------------------------------------------
  5093. # * Create AT Number
  5094. #--------------------------------------------------------------------------
  5095. def create_at_number(viewport)
  5096. return if !AT_NUMBER_VISIBLE
  5097. @at_number = Sprite.new
  5098. @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  5099. @at_number.z = HUD_Z + AT_NUMBER_Z
  5100. @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  5101. @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  5102. @at_number.viewport = viewport
  5103. @at_number.opacity = 0
  5104. end
  5105.  
  5106. #--------------------------------------------------------------------------
  5107. # * Create AT Number Max
  5108. #--------------------------------------------------------------------------
  5109. def create_at_number_max(viewport)
  5110. return if !AT_NUMBER_MAX_VISIBLE
  5111. @at_number2 = Sprite.new
  5112. @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  5113. @at_number2.z = HUD_Z + AT_NUMBER_Z
  5114. @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  5115. @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  5116. @at_number2.viewport = viewport
  5117. @at_number2.opacity = 0
  5118. end
  5119.  
  5120. #--------------------------------------------------------------------------
  5121. # * Create AT Meter
  5122. #--------------------------------------------------------------------------
  5123. def create_at_meter(viewport)
  5124. return if !AT_METER_VISIBLE
  5125. @at_flow_max = @at_meter_cw * 2
  5126. @at_flow = rand(@at_flow_max)
  5127. @at_meter = Sprite.new
  5128. @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  5129. @at_meter.z = HUD_Z + AT_METER_Z
  5130. @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  5131. @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  5132. @at_meter.angle = AT_METER_ANGLE
  5133. @at_meter.mirror = AT_METER_MIRROR_EFFECT
  5134. @at_meter.viewport = viewport
  5135. @at_meter.opacity = 0
  5136. end
  5137.  
  5138. #--------------------------------------------------------------------------
  5139. # ● Update Flow AT
  5140. #--------------------------------------------------------------------------
  5141. def update_flow_at
  5142. @at_meter.bitmap.clear
  5143. @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  5144. if actor_cast?
  5145. meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  5146. meter_width = 0 if meter_width == nil
  5147. ch = @at_meter_ch * 2
  5148. else
  5149. meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  5150. meter_width = 0 if meter_width == nil
  5151. ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  5152. end
  5153. meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  5154. @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)
  5155. @at_flow += 1
  5156. @at_flow = 0 if @at_flow >= @at_flow_max
  5157. end
  5158.  
  5159. #--------------------------------------------------------------------------
  5160. # * Update AT
  5161. #--------------------------------------------------------------------------
  5162. def update_at
  5163. if @at_number != nil
  5164. sprite_visible(@at_number)
  5165. if AT_NUMBER_ANIMATION
  5166. update_number(6,@at_number_old)
  5167. else
  5168. update_number_fix(6) if @at_number_old != actor_at
  5169. end
  5170. refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  5171. end
  5172. if @at_number2 != nil
  5173. sprite_visible(@at_number2)
  5174. if AT_NUMBER_ANIMATION
  5175. update_number(7,@at_number2_old)
  5176. else
  5177. update_number_fix(7) if @at_number2_old != actor_max_at
  5178. end
  5179. refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  5180. end
  5181. if @at_meter != nil
  5182. sprite_visible(@at_meter)
  5183. update_flow_at
  5184. end
  5185. end
  5186.  
  5187. end
  5188.  
  5189. #==============================================================================
  5190. #==============================================================================
  5191. # ** Battle Hud EX
  5192. #==============================================================================
  5193. #==============================================================================
  5194. class Battle_Hud_EX
  5195.  
  5196. #--------------------------------------------------------------------------
  5197. # * Create Level Number
  5198. #--------------------------------------------------------------------------
  5199. def create_level_number(viewport)
  5200. return if !LEVEL_NUMBER_VISIBLE
  5201. @old_level = -1
  5202. @lv_number = Sprite.new
  5203. @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  5204. @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  5205. @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5206. @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  5207. @lv_number.viewport = viewport
  5208. @lv_number.opacity = 0
  5209. end
  5210.  
  5211. #--------------------------------------------------------------------------
  5212. # * Refresh Level Number
  5213. #--------------------------------------------------------------------------
  5214. def refresh_level_number
  5215. @lv_number.bitmap.clear
  5216. @old_level = @actor.level
  5217. number_value = @actor.level.abs.to_s.split(//)
  5218. for r in 0..number_value.size - 1
  5219. number_value_abs = number_value[r].to_i
  5220. nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  5221. @lv_number.bitmap.blt(@lv_number_cw * r, 0, @lv_number_image, nsrc_rect)
  5222. end
  5223. cx = (number_value.size * @lv_number_cw)
  5224. case LEVEL_NUMBER_ALIGN_TYPE
  5225. when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5226. when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  5227. when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  5228. end
  5229. end
  5230.  
  5231. #--------------------------------------------------------------------------
  5232. # * Update Level
  5233. #--------------------------------------------------------------------------
  5234. def update_level
  5235. return if @lv_number == nil
  5236. sprite_visible(@lv_number)
  5237. refresh_level_number if @old_level != @actor.level
  5238. end
  5239.  
  5240. end
  5241.  
  5242. #==============================================================================
  5243. #==============================================================================
  5244. # ** Battle Hud EX
  5245. #==============================================================================
  5246. #==============================================================================
  5247. class Battle_Hud_EX
  5248.  
  5249. #--------------------------------------------------------------------------
  5250. # * Create States
  5251. #--------------------------------------------------------------------------
  5252. def create_states(viewport)
  5253. return if !STATES_VISIBLE
  5254. @status_old = nil
  5255. @status_flow = [-24,0]
  5256. @status_size_real = 0
  5257. @status = Sprite.new
  5258. @status.bitmap = Bitmap.new(24,24)
  5259. @status.x = @hud_position[0] + STATES_POSITION[0]
  5260. @status.y = @hud_position[1] + STATES_POSITION[1]
  5261. @status.z = HUD_Z + STATES_Z
  5262. @status.angle = STATE_ANGLE
  5263. @status.viewport = viewport
  5264. @status.opacity = 0
  5265. end
  5266.  
  5267. #--------------------------------------------------------------------------
  5268. # * Refresh States
  5269. #--------------------------------------------------------------------------
  5270. def refresh_states
  5271. check_icon_image
  5272. @status_size_real = set_real_states_size
  5273. @status_old = @actor.states
  5274. @status_flow = [0,0]
  5275. @states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
  5276. @actor_status.dispose if @actor_status != nil
  5277. @actor_status = Bitmap.new(@states_size,24)
  5278. index = 0
  5279. for i in @actor.states
  5280. next if HIDE_STATES_ID.include?(i.id)
  5281. rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  5282. @actor_status.blt(26 * index , 0, @icon_image, rect)
  5283. index += 1
  5284. end
  5285. end
  5286.  
  5287. #--------------------------------------------------------------------------
  5288. # * Set Real States Size
  5289. #--------------------------------------------------------------------------
  5290. def set_real_states_size
  5291. n = 0
  5292. for i in @actor.states
  5293. next if HIDE_STATES_ID.include?(i.id)
  5294. n += 1
  5295. end
  5296. return n
  5297. end
  5298.  
  5299. #--------------------------------------------------------------------------
  5300. # * Flow_Status
  5301. #--------------------------------------------------------------------------
  5302. def flow_states
  5303. return if @actor_status == nil
  5304. @status.bitmap.clear
  5305. return if @actor.states.size == 0
  5306. st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  5307. @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  5308. if STATES_SCROLLING_ANIMATION
  5309. @status_flow[0] += 1
  5310. @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  5311. else
  5312. @status_flow[1] += 1 unless @actor.states.size <= 1
  5313. if @status_flow[1] > 30
  5314. @status_flow[1] = 0
  5315. @status_flow[0] += 26
  5316. @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  5317. end
  5318. end
  5319. end
  5320.  
  5321. #--------------------------------------------------------------------------
  5322. # * Update States
  5323. #--------------------------------------------------------------------------
  5324. def update_states
  5325. return if @status == nil
  5326. sprite_visible(@status)
  5327. refresh_states if @status_old != @actor.states
  5328. flow_states
  5329. end
  5330.  
  5331. end
  5332.  
  5333. #==============================================================================
  5334. #==============================================================================
  5335. # ** Battle Hud EX
  5336. #==============================================================================
  5337. #==============================================================================
  5338. class Battle_Hud_EX
  5339.  
  5340. #--------------------------------------------------------------------------
  5341. # * Create Face
  5342. #--------------------------------------------------------------------------
  5343. def create_face(viewport)
  5344. return if !FACE_VISIBLE
  5345. @face_old_hp = @actor.hp
  5346. @face_old_mp = @actor.mp
  5347. @face_old_tp = @actor.tp
  5348. @face_name = ""
  5349. @face = Sprite.new
  5350. @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  5351. @face.x = @face_org[0]
  5352. @face.y = @face_org[1]
  5353. @face.z = HUD_Z + FACE_Z
  5354. @face.viewport = viewport
  5355. @face.opacity = 0
  5356. refresh_face_name
  5357. end
  5358.  
  5359. #--------------------------------------------------------------------------
  5360. # * Refresh Face Name
  5361. #--------------------------------------------------------------------------
  5362. def refresh_face_name
  5363. @face_image.dispose if @face_image != nil
  5364. @face.bitmap.dispose if @face.bitmap != nil
  5365. return if @actor == nil or @actor.id == nil
  5366. @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5367. @face_image = Bitmap.new(32,32) if @face_image == nil
  5368. @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  5369. @face_ch = @face_image.height
  5370. @face.ox = @face_cw / 2
  5371. @face.oy = @face_ch / 2
  5372. @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  5373. @face_org = [@hud_position[0] + FACE_POSITION[0],
  5374. @hud_position[1] + @face.oy + FACE_POSITION[1]]
  5375. if $game_temp.battler_face_pos[@actor_index] == nil
  5376. $game_temp.battler_face_pos[@actor_index] = []
  5377. end
  5378. @face.x = @face_org[0]
  5379. @face.y = @face_org[1]
  5380. limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  5381. fy = @face_org[1]
  5382. if limit_Y > Graphics.height
  5383. @face.y = Graphics.height - (@face_image.height - @face.oy)
  5384. fy = Graphics.height - 16
  5385. @face_org[1] = @face.y
  5386. end
  5387. $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  5388. $game_temp.battler_face_pos[@actor_index][1] = fy
  5389. $game_temp.battler_face_pos[@actor_index][2] = @face.z
  5390. clear_face_index
  5391. end
  5392.  
  5393. #--------------------------------------------------------------------------
  5394. # * Refresh Face
  5395. #--------------------------------------------------------------------------
  5396. def refresh_face
  5397. @face.mirror = false
  5398. @face.zoom_x = 1.00
  5399. @face.zoom_y = 1.00
  5400. @face_index = @actor.face_animation[1]
  5401. @face.bitmap.clear
  5402. if !FACE_ANIMATION
  5403. f_scr = Rect.new(0,0,@face_cw,@face_ch)
  5404. else
  5405. f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  5406. end
  5407. @face.bitmap.blt(0,0,@face_image,f_scr)
  5408. end
  5409.  
  5410. #--------------------------------------------------------------------------
  5411. # * Update Face Duration
  5412. #--------------------------------------------------------------------------
  5413. def update_face_duration
  5414. return if @actor.face_animation[0] == 0
  5415. @actor.face_animation[0] -= 1
  5416. update_face_shake_effect
  5417. update_face_zoom if @actor.face_animation[1] == 2
  5418. return if @actor.face_animation[0] > 0
  5419. clear_face_index
  5420. end
  5421.  
  5422. #--------------------------------------------------------------------------
  5423. # * Clear Face Index
  5424. #--------------------------------------------------------------------------
  5425. def clear_face_index
  5426. @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  5427. @actor.face_animation[1] = 4 if @actor.dead?
  5428. refresh_face
  5429. end
  5430.  
  5431. #--------------------------------------------------------------------------
  5432. # * Update Face Zoom
  5433. #--------------------------------------------------------------------------
  5434. def update_face_zoom
  5435. return if !FACE_ZOOM_ANIMATION
  5436. case @actor.face_animation[0]
  5437. when 30..60
  5438. @face.zoom_x += 0.01
  5439. @face.zoom_x = 1.30 if @face.zoom_x > 1.30
  5440. @face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
  5441. when 1..29
  5442. @face.zoom_x -= 0.01
  5443. @face.zoom_x = 1.00 if @face.zoom_x < 1.00
  5444. @face.mirror = false
  5445. else
  5446. @face.zoom_x = 1.00
  5447. @face.mirror = false
  5448. end
  5449. @face.zoom_y = @face.zoom_x
  5450. end
  5451.  
  5452. #--------------------------------------------------------------------------
  5453. # * Can Refresh Index MP TP?
  5454. #--------------------------------------------------------------------------
  5455. def can_refresh_index_mp_tp?
  5456. return true if @face_old_mp != @actor.mp
  5457. return false
  5458. end
  5459.  
  5460. #--------------------------------------------------------------------------
  5461. # * Refresh Face Index HP
  5462. #--------------------------------------------------------------------------
  5463. def refresh_face_index_hp
  5464. @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5465. @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  5466. @face_old_hp = @actor.hp
  5467. end
  5468.  
  5469. #--------------------------------------------------------------------------
  5470. # * Refresh Face Index MP TP
  5471. #--------------------------------------------------------------------------
  5472. def refresh_face_index_mp_tp
  5473. if @face_old_mp < @actor.mp
  5474. @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5475. @actor.face_animation[1] = 1
  5476. end
  5477. @face_old_mp = @actor.mp
  5478. @face_old_tp = @actor.tp
  5479. end
  5480.  
  5481. #--------------------------------------------------------------------------
  5482. # * Update Face Shake Effect
  5483. #--------------------------------------------------------------------------
  5484. def update_face_shake_effect
  5485. return if !FACE_SHAKE_EFFECT
  5486. if FACE_ANIMATION
  5487. update_shake_animated_face
  5488. else
  5489. update_shake_still_face
  5490. end
  5491. end
  5492.  
  5493. #--------------------------------------------------------------------------
  5494. # * Update Shake Still Effect Face
  5495. #--------------------------------------------------------------------------
  5496. def update_shake_still_face
  5497. if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  5498. @face.x = @face_org[0] - 4 + rand(8)
  5499. else
  5500. @face.x = @face_org[0]
  5501. end
  5502. end
  5503.  
  5504. #--------------------------------------------------------------------------
  5505. # * Update Shake Animated Face
  5506. #--------------------------------------------------------------------------
  5507. def update_shake_animated_face
  5508. if @actor.face_animation[0] == 0
  5509. @face.x = @face_org[0]
  5510. return
  5511. end
  5512. if @actor.face_animation[1] == 3 and @actor.hp > 0
  5513. @face.x = @face_org[0] - 4 + rand(8)
  5514. else
  5515. @face.x = @face_org[0]
  5516. end
  5517. end
  5518.  
  5519. #--------------------------------------------------------------------------
  5520. # * Update Face
  5521. #--------------------------------------------------------------------------
  5522. def update_face
  5523. return if @face == nil
  5524. sprite_visible(@face)
  5525. refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  5526. update_face_duration
  5527. return if !FACE_ANIMATION
  5528. refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  5529. refresh_face_index_hp if @face_old_hp != @actor.hp
  5530. refresh_face if @face_index != @actor.face_animation[1]
  5531. end
  5532.  
  5533. end
  5534.  
  5535. #==============================================================================
  5536. # ■ Battle Manager
  5537. #==============================================================================
  5538. class << BattleManager
  5539.  
  5540. #--------------------------------------------------------------------------
  5541. # ● Battle End
  5542. #--------------------------------------------------------------------------
  5543. alias mog_battle_hud_battle_process_victory process_victory
  5544. def process_victory
  5545. execute_face_effect_end
  5546. mog_battle_hud_battle_process_victory
  5547. end
  5548.  
  5549. #--------------------------------------------------------------------------
  5550. # ● Execute Face Effect End
  5551. #--------------------------------------------------------------------------
  5552. def execute_face_effect_end
  5553. $game_temp.battle_end = true
  5554. for i in $game_party.members
  5555. i.face_animation = [120,1,0] if i.hp > 0
  5556. end
  5557. end
  5558.  
  5559. #--------------------------------------------------------------------------
  5560. # * Display EXP Earned
  5561. #--------------------------------------------------------------------------
  5562. alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
  5563. def process_defeat
  5564. $game_temp.battle_end = true
  5565. mog_battle_hud_ex_message_battle_process_defeat
  5566. end
  5567.  
  5568. #--------------------------------------------------------------------------
  5569. # * Process Abort
  5570. #--------------------------------------------------------------------------
  5571. alias mog_battle_hud_ex_process_abort process_abort
  5572. def process_abort
  5573. $game_temp.battle_end = true
  5574. mog_battle_hud_ex_process_abort
  5575. end
  5576.  
  5577. end
  5578.  
  5579. #==============================================================================
  5580. # ** Scene Battle
  5581. #==============================================================================
  5582. class Scene_Battle < Scene_Base
  5583.  
  5584. #--------------------------------------------------------------------------
  5585. # * Use Item
  5586. #--------------------------------------------------------------------------
  5587. alias mog_monogatari_use_item use_item
  5588. def use_item
  5589. execute_face_animation
  5590. mog_monogatari_use_item
  5591. end
  5592.  
  5593. #--------------------------------------------------------------------------
  5594. # * Execute Face Animation
  5595. #--------------------------------------------------------------------------
  5596. def execute_face_animation
  5597. return if @subject.is_a?(Game_Enemy)
  5598. @subject.face_animation = [60 ,2,0]
  5599. end
  5600.  
  5601. end
  5602.  
  5603. #==============================================================================
  5604. #==============================================================================
  5605. # ** Battle Hud EX
  5606. #==============================================================================
  5607. #==============================================================================
  5608. class Battle_Hud_EX
  5609.  
  5610. #--------------------------------------------------------------------------
  5611. # * Dispose
  5612. #--------------------------------------------------------------------------
  5613. def dispose
  5614. terminate
  5615. dispose_layout
  5616. dispose_layout_2
  5617. dispose_name
  5618. dispose_face
  5619. dispose_hp_number
  5620. dispose_hp_number_max
  5621. dispose_hp_meter
  5622. dispose_hp_icon
  5623. dispose_hp_icon_ex
  5624. dispose_hp_icon_number
  5625. dispose_mp_number
  5626. dispose_mp_number_max
  5627. dispose_mp_meter
  5628. dispose_mp_icon
  5629. dispose_mp_icon_ex
  5630. dispose_mp_icon_number
  5631. dispose_tp_number
  5632. dispose_tp_number_max
  5633. dispose_tp_meter
  5634. dispose_tp_icon
  5635. dispose_tp_icon_ex
  5636. dispose_tp_icon_number
  5637. dispose_at_number
  5638. dispose_at_number_max
  5639. dispose_at_meter
  5640. dispose_lv_number
  5641. dispose_states
  5642. end
  5643.  
  5644. #--------------------------------------------------------------------------
  5645. # * Dispose Layout
  5646. #--------------------------------------------------------------------------
  5647. def dispose_layout
  5648. return if @layout == nil
  5649. @layout.dispose
  5650. @layout = nil
  5651. end
  5652.  
  5653. #--------------------------------------------------------------------------
  5654. # * Dispose Layout 2
  5655. #--------------------------------------------------------------------------
  5656. def dispose_layout_2
  5657. return if @layout2 == nil
  5658. @layout2.dispose
  5659. @layout2 = nil
  5660. end
  5661.  
  5662. #--------------------------------------------------------------------------
  5663. # * Dispose Name
  5664. #--------------------------------------------------------------------------
  5665. def dispose_name
  5666. return if @name == nil
  5667. @name.bitmap.dispose
  5668. @name.dispose
  5669. @name = nil
  5670. end
  5671.  
  5672. #--------------------------------------------------------------------------
  5673. # * Dispose Face
  5674. #--------------------------------------------------------------------------
  5675. def dispose_face
  5676. return if @face == nil
  5677. @face.bitmap.dispose if @face.bitmap != nil
  5678. @face.dispose
  5679. @face = nil
  5680. @face_image.dispose if @face_image != nil
  5681. end
  5682.  
  5683. #--------------------------------------------------------------------------
  5684. # * Dispose HP Number
  5685. #--------------------------------------------------------------------------
  5686. def dispose_hp_number
  5687. return if @hp_number == nil
  5688. @hp_number.bitmap.dispose
  5689. @hp_number.dispose
  5690. @hp_number = nil
  5691. end
  5692.  
  5693. #--------------------------------------------------------------------------
  5694. # * Dispose HP Number Max
  5695. #--------------------------------------------------------------------------
  5696. def dispose_hp_number_max
  5697. return if @hp_number2 == nil
  5698. @hp_number2.bitmap.dispose
  5699. @hp_number2.dispose
  5700. @hp_number2 = nil
  5701. end
  5702.  
  5703. #--------------------------------------------------------------------------
  5704. # * Dispose HP Meter
  5705. #--------------------------------------------------------------------------
  5706. def dispose_hp_meter
  5707. return if @hp_meter == nil
  5708. @hp_meter.bitmap.dispose
  5709. @hp_meter.dispose
  5710. @hp_meter = nil
  5711. end
  5712.  
  5713. #--------------------------------------------------------------------------
  5714. # * Dispose HP Icon
  5715. #--------------------------------------------------------------------------
  5716. def dispose_hp_icon
  5717. return if @hp_icon == nil
  5718. @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  5719. @hp_icon.dispose
  5720. @hp_icon = nil
  5721. end
  5722.  
  5723. #--------------------------------------------------------------------------
  5724. # * Dispose HP Icon EX
  5725. #--------------------------------------------------------------------------
  5726. def dispose_hp_icon_ex
  5727. return if @hp_icon3 == nil
  5728. @hp_icon3.bitmap.dispose
  5729. @hp_icon3.dispose
  5730. @hp_icon3 = nil
  5731. end
  5732.  
  5733. #--------------------------------------------------------------------------
  5734. # * Dispose HP Icon Number
  5735. #--------------------------------------------------------------------------
  5736. def dispose_hp_icon_number
  5737. return if @hp_icon_number == nil
  5738. @hp_icon_number.bitmap.dispose
  5739. @hp_icon_number.dispose
  5740. @hp_icon_number = nil
  5741. end
  5742.  
  5743. #--------------------------------------------------------------------------
  5744. # * Dispose MP Number
  5745. #--------------------------------------------------------------------------
  5746. def dispose_mp_number
  5747. return if @mp_number == nil
  5748. @mp_number.bitmap.dispose
  5749. @mp_number.dispose
  5750. @mp_number = nil
  5751. end
  5752.  
  5753. #--------------------------------------------------------------------------
  5754. # * Dispose MP Number Max
  5755. #--------------------------------------------------------------------------
  5756. def dispose_mp_number_max
  5757. return if @mp_number2 == nil
  5758. @mp_number2.bitmap.dispose
  5759. @mp_number2.dispose
  5760. @mp_number2 = nil
  5761. end
  5762.  
  5763. #--------------------------------------------------------------------------
  5764. # * Dispose MP Meter
  5765. #--------------------------------------------------------------------------
  5766. def dispose_mp_meter
  5767. return if @mp_meter == nil
  5768. @mp_meter.bitmap.dispose
  5769. @mp_meter.dispose
  5770. @mp_meter = nil
  5771. end
  5772.  
  5773. #--------------------------------------------------------------------------
  5774. # * Dispose MP Icon
  5775. #--------------------------------------------------------------------------
  5776. def dispose_mp_icon
  5777. return if @mp_icon == nil
  5778. @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  5779. @mp_icon.dispose
  5780. @mp_icon = nil
  5781. end
  5782.  
  5783. #--------------------------------------------------------------------------
  5784. # * Dispose MP Icon EX
  5785. #--------------------------------------------------------------------------
  5786. def dispose_mp_icon_ex
  5787. return if @mp_icon3 == nil
  5788. @mp_icon3.bitmap.dispose
  5789. @mp_icon3.dispose
  5790. @mp_icon3 = nil
  5791. end
  5792.  
  5793. #--------------------------------------------------------------------------
  5794. # * Dispose MP Icon Number
  5795. #--------------------------------------------------------------------------
  5796. def dispose_mp_icon_number
  5797. return if @mp_icon_number == nil
  5798. @mp_icon_number.bitmap.dispose
  5799. @mp_icon_number.dispose
  5800. @mp_icon_number = nil
  5801. end
  5802.  
  5803. #--------------------------------------------------------------------------
  5804. # * Dispose TP Number
  5805. #--------------------------------------------------------------------------
  5806. def dispose_tp_number
  5807. return if @tp_number == nil
  5808. @tp_number.bitmap.dispose
  5809. @tp_number.dispose
  5810. @tp_number = nil
  5811. end
  5812.  
  5813. #--------------------------------------------------------------------------
  5814. # * Dispose TP Number Max
  5815. #--------------------------------------------------------------------------
  5816. def dispose_tp_number_max
  5817. return if @tp_number2 == nil
  5818. @tp_number2.bitmap.dispose
  5819. @tp_number2.dispose
  5820. @tp_number2 = nil
  5821. end
  5822.  
  5823. #--------------------------------------------------------------------------
  5824. # * Dispose TP Meter
  5825. #--------------------------------------------------------------------------
  5826. def dispose_tp_meter
  5827. return if @tp_meter == nil
  5828. @tp_meter.bitmap.dispose
  5829. @tp_meter.dispose
  5830. @tp_meter = nil
  5831. end
  5832.  
  5833. #--------------------------------------------------------------------------
  5834. # * Dispose TP Icon
  5835. #--------------------------------------------------------------------------
  5836. def dispose_tp_icon
  5837. return if @tp_icon == nil
  5838. @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  5839. @tp_icon.dispose
  5840. @tp_icon = nil
  5841. end
  5842.  
  5843. #--------------------------------------------------------------------------
  5844. # * Dispose TP Icon EX
  5845. #--------------------------------------------------------------------------
  5846. def dispose_tp_icon_ex
  5847. return if @tp_icon3 == nil
  5848. @tp_icon3.bitmap.dispose
  5849. @tp_icon3.dispose
  5850. @tp_icon3 = nil
  5851. end
  5852.  
  5853. #--------------------------------------------------------------------------
  5854. # * Dispose TP Icon Number
  5855. #--------------------------------------------------------------------------
  5856. def dispose_tp_icon_number
  5857. return if @tp_icon_number == nil
  5858. @tp_icon_number.bitmap.dispose
  5859. @tp_icon_number.dispose
  5860. @tp_icon_numbe = nil
  5861. end
  5862.  
  5863. #--------------------------------------------------------------------------
  5864. # * Dispose AT Number
  5865. #--------------------------------------------------------------------------
  5866. def dispose_at_number
  5867. return if @at_number == nil
  5868. @at_number.bitmap.dispose
  5869. @at_number.dispose
  5870. @at_number = nil
  5871. end
  5872.  
  5873. #--------------------------------------------------------------------------
  5874. # * Dispose AT Number Max
  5875. #--------------------------------------------------------------------------
  5876. def dispose_at_number_max
  5877. return if @at_number2 == nil
  5878. @at_number2.bitmap.dispose
  5879. @at_number2.dispose
  5880. @at_number2 = nil
  5881. end
  5882.  
  5883. #--------------------------------------------------------------------------
  5884. # * Dispose AT Meter
  5885. #--------------------------------------------------------------------------
  5886. def dispose_at_meter
  5887. return if @at_meter == nil
  5888. @at_meter.bitmap.dispose
  5889. @at_meter.dispose
  5890. @at_meter = nil
  5891. end
  5892.  
  5893. #--------------------------------------------------------------------------
  5894. # * Dispose Lv Number
  5895. #--------------------------------------------------------------------------
  5896. def dispose_lv_number
  5897. return if @lv_number == nil
  5898. @lv_number.bitmap.dispose
  5899. @lv_number.dispose
  5900. @lv_number = nil
  5901. end
  5902.  
  5903. #--------------------------------------------------------------------------
  5904. # * Dispose States
  5905. #--------------------------------------------------------------------------
  5906. def dispose_states
  5907. return if @status == nil
  5908. @status.bitmap.dispose if @status.bitmap != nil
  5909. @status.dispose
  5910. @actor_status.dispose if @actor_status != nil
  5911. @status = nil
  5912. end
  5913.  
  5914. end
  5915.  
  5916. #==============================================================================
  5917. #==============================================================================
  5918. # ** Battle Hud EX
  5919. #==============================================================================
  5920. #==============================================================================
  5921. class Battle_Hud_EX
  5922.  
  5923. #--------------------------------------------------------------------------
  5924. # * Refresh Visible
  5925. #--------------------------------------------------------------------------
  5926. def refresh_visible(vis)
  5927. @layout.visible = vis if @layout
  5928. @layout2.visible = vis if @layout2
  5929. @name.visible = vis if @name
  5930. @lv_number.visible = vis if @lv_number
  5931. @status.visible = vis if @status
  5932. @face.visible = vis if @face
  5933. @hp_number.visible = vis if @hp_number
  5934. @hp_number2.visible = vis if @hp_number2
  5935. @hp_meter.visible = vis if @hp_meter
  5936. @hp_icon.visible = vis if @hp_icon
  5937. @hp_icon3.visible = vis if @hp_icon3
  5938. @hp_icon_number.visible = vis if @hp_icon_number
  5939. @mp_number.visible = vis if @mp_number
  5940. @mp_number2.visible = vis if @mp_number2
  5941. @mp_meter.visible = vis if @mp_meter
  5942. @mp_icon.visible = vis if @mp_icon
  5943. @mp_icon3.visible = vis if @mp_icon3
  5944. @mp_icon_number.visible = vis if @mp_icon_number
  5945. @tp_number.visible = vis if @tp_number
  5946. @tp_number2.visible = vis if @tp_number2
  5947. @tp_meter.visible = vis if @tp_meter
  5948. @tp_icon.visible = vis if @tp_icon
  5949. @tp_icon3.visible = vis if @tp_icon3
  5950. @tp_icon_number.visible = vis if @tp_icon_number
  5951. @at_number.visible = vis if @at_number
  5952. @at_number2.visible = vis if @at_number2
  5953. @at_meter.visible = vis if @at_meter
  5954. end
  5955.  
  5956. #--------------------------------------------------------------------------
  5957. # * Update
  5958. #--------------------------------------------------------------------------
  5959. def update
  5960. return if @actor == nil
  5961. @sprite_visible = sprite_visible?
  5962. @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  5963. update_layout ; update_layout_2 ; update_name
  5964. update_face ; update_hp ; update_mp ; update_tp
  5965. update_at ; update_level ; update_states
  5966. end
  5967.  
  5968. end
  5969.  
  5970. #==============================================================================
  5971. # ■ Sprite Battler
  5972. #==============================================================================
  5973. class Sprite_Battler < Sprite_Base
  5974.  
  5975. #--------------------------------------------------------------------------
  5976. # ● Set AV
  5977. #--------------------------------------------------------------------------
  5978. def set_av(a_viewport)
  5979. @viewport_cm = a_viewport
  5980. end
  5981.  
  5982. #--------------------------------------------------------------------------
  5983. # ● Dispose
  5984. #--------------------------------------------------------------------------
  5985. alias mog_bc_dispose dispose
  5986. def dispose
  5987. mog_bc_dispose
  5988. @viewport_cm.dispose if @viewport_cm != nil
  5989. end
  5990.  
  5991. #--------------------------------------------------------------------------
  5992. # ● Maker Animation Sprites
  5993. #--------------------------------------------------------------------------
  5994. alias mog_bc_make_animation_sprites make_animation_sprites
  5995. def make_animation_sprites
  5996. mog_bc_make_animation_sprites
  5997. set_cm_viewport if $imported[:mog_battle_camera]
  5998. end
  5999.  
  6000. #--------------------------------------------------------------------------
  6001. # ● Set CM Viewpor
  6002. #--------------------------------------------------------------------------
  6003. def set_cm_viewport
  6004. return if @viewport_cm == nil
  6005. return if @ani_sprites == nil
  6006. if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  6007. @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
  6008. return
  6009. end
  6010. @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
  6011. end
  6012.  
  6013. end
  6014.  
  6015. #==============================================================================
  6016. # ■ Game Temp
  6017. #==============================================================================
  6018. class Spriteset_Battle
  6019.  
  6020. #--------------------------------------------------------------------------
  6021. # ● Initialize
  6022. #--------------------------------------------------------------------------
  6023. alias mog_bc_sp_initialize initialize
  6024. def initialize
  6025. mog_bc_sp_initialize
  6026. if $imported[:mog_battle_camera] and @viewport_cm != nil
  6027. battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
  6028. end
  6029. end
  6030.  
  6031. #--------------------------------------------------------------------------
  6032. # ● Create Viewports
  6033. #--------------------------------------------------------------------------
  6034. alias mog_bc_create_viewports create_viewports
  6035. def create_viewports
  6036. mog_bc_create_viewports
  6037. if $imported[:mog_battle_camera]
  6038. @viewport_cm = Viewport.new
  6039. @viewport_cm.z = 100
  6040. end
  6041. end
  6042.  
  6043. #--------------------------------------------------------------------------
  6044. # ● Dispose Viewports
  6045. #--------------------------------------------------------------------------
  6046. alias mog_bc_dispose_viewports dispose_viewports
  6047. def dispose_viewports
  6048. mog_bc_dispose_viewports
  6049. @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
  6050. end
  6051.  
  6052. #--------------------------------------------------------------------------
  6053. # ● Update Viewports
  6054. #--------------------------------------------------------------------------
  6055. alias mog_bcf_update_viewports update_viewports
  6056. def update_viewports
  6057. mog_bcf_update_viewports
  6058. update_viewport_cm if $imported[:mog_battle_camera]
  6059. end
  6060.  
  6061. #--------------------------------------------------------------------------
  6062. # ● Update Viewport CM
  6063. #--------------------------------------------------------------------------
  6064. def update_viewport_cm
  6065. return if @viewport_cm == nil
  6066. @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
  6067. @viewport_cm.oy = $game_temp.bc_data[1]
  6068. @viewport_cm.update
  6069. end
  6070.  
  6071. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement