Advertisement
Guest User

Untitled

a guest
Sep 18th, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 242.71 KB | None | 0 0
  1. #==============================================================================
  2. # +++ MOG - Battle Hud EX (v6.6) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # https://atelierrgss.wordpress.com/
  6. #==============================================================================
  7. #
  8. # Coloque as imagens da hud na pasta.
  9. #
  10. # Graphics/Huds/Battle/
  11. #==============================================================================
  12. # Para ocultar ou apresentar a hud de batalha use o código abaixo.
  13. #
  14. # battle_hud_visible(false)
  15. #
  16. # ou
  17. #
  18. # battle_hud_visible(true)
  19. #
  20. #==============================================================================
  21. # Para mudar o sprite da face do battler use o código abaixo.
  22. #==============================================================================
  23. #
  24. # battler_face_name( ACTOR_ID, FIlE_NAME )
  25. #
  26. #==============================================================================
  27.  
  28. #==============================================================================
  29. # Atualizações desta versão.
  30. #==============================================================================
  31. # (ver 6.6)
  32. # - Correção do Crash caso optar por desativar o layout das janelas.
  33. # (ver 6.5)
  34. # - Melhoria no cálculo da posição Z.
  35. # - Correção de travar o menu.
  36. # (ver 6.4)
  37. # - Correção do glitch de aparecer um pedaço da Windowskin quando se
  38. # usa mais de 4 battlers na batalha.
  39. # (ver 6.3)
  40. # - Compatibilidade com o MOG Battle Camera.
  41. # (ver 6.2)
  42. # - Refresh da hud ao trocar a posição dos personagens.
  43. # (ver 6.0)
  44. # - Adição da camada da tela.
  45. # - Adição do efeito Slide.
  46. # - Adição de novas opções referente a fonte.
  47. #==============================================================================
  48.  
  49. $imported = {} if $imported.nil?
  50. $imported[:mog_battle_hud_ex] = true
  51.  
  52. module MOG_BATTLE_HUD_EX
  53.  
  54. #============================================================================
  55. #============================================================================
  56. # * HUD SPRITE (GENERAL)
  57. #============================================================================
  58. # Definição da quantidade maxima de personagens na batalha.
  59. #---------------------------------------------------------------------------
  60. MAX_BATTLE_MEMBERS = 4
  61. #---------------------------------------------------------------------------
  62. # Definição da prioridade da hud.
  63. #---------------------------------------------------------------------------
  64. HUD_Z = 110
  65. #---------------------------------------------------------------------------
  66. # Definição da posição geral da hud, influência em todos os sprites da hud.
  67. #---------------------------------------------------------------------------
  68. HUD_POSITION = [-12,480]
  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] = [46,480]
  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 = [50,-6]
  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 = 14
  143. #---------------------------------------------------------------------------
  144. # Ativar Bold.
  145. #---------------------------------------------------------------------------
  146. NAME_FONT_BOLD = false
  147. #---------------------------------------------------------------------------
  148. # Ativar Italic.
  149. #---------------------------------------------------------------------------
  150. NAME_FONT_ITALIC = false
  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 = [1,1]
  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 = [20,-10]
  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 = false
  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 = [58,50]
  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 = false
  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 = [58,69]
  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 = false
  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 = [58,88]
  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 = true
  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 = [192,15]
  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. refresh_layout if @layout.visible != self.visible
  1927. @layout.visible = false if !$game_temp.sprite_visible
  1928. end
  1929. self.visible = false if !$game_temp.sprite_visible
  1930. end
  1931. end
  1932.  
  1933. end
  1934.  
  1935. #==============================================================================
  1936. # ** Window_PartyCommand
  1937. #==============================================================================
  1938. class Window_PartyCommand < Window_Command
  1939.  
  1940. include MOG_BATTLE_HUD_EX
  1941.  
  1942. #--------------------------------------------------------------------------
  1943. # * Initialize
  1944. #--------------------------------------------------------------------------
  1945. alias mog_monogatari_party_initialize initialize
  1946. def initialize
  1947. mog_monogatari_party_initialize
  1948. # self.x = @org_position[0] ; self.y = @org_position[1]
  1949. # self.opacity = PARTY_COMMAND_OPACITY
  1950. create_layout
  1951. end
  1952.  
  1953. #--------------------------------------------------------------------------
  1954. # * Dispose
  1955. #--------------------------------------------------------------------------
  1956. alias mog_monogatari_party_window_dispose dispose
  1957. def dispose
  1958. mog_monogatari_party_window_dispose
  1959. dispose_layout
  1960. end
  1961.  
  1962. #--------------------------------------------------------------------------
  1963. # * Create Layout
  1964. #--------------------------------------------------------------------------
  1965. def create_layout
  1966. return if @layout != nil
  1967. return if !PARTY_COMMAND_LAYOUT
  1968. return if $game_temp.mbhud_window[1]
  1969. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  1970. $game_temp.mbhud_window[1] = true
  1971. @org_position_2 = [@org_position[0] + PARTY_COMMAND_LAYOUT_POSITION[0],@org_position[1] + PARTY_COMMAND_LAYOUT_POSITION[1]]
  1972. @layout = Sprite.new
  1973. @layout.bitmap = Cache.battle_hud("Layout_Party")
  1974. @layout.z = self.z - 1
  1975. refresh_layout
  1976. @layout.visible = false
  1977. end
  1978.  
  1979. #--------------------------------------------------------------------------
  1980. # * Dispose Layout
  1981. #--------------------------------------------------------------------------
  1982. def dispose_layout
  1983. return if @layout == nil
  1984. @layout.dispose
  1985. @layout = nil
  1986. end
  1987.  
  1988. #--------------------------------------------------------------------------
  1989. # * Refresh Layout
  1990. #--------------------------------------------------------------------------
  1991. def refresh_layout
  1992. return if @layout == nil
  1993. @layout.x = @org_position_2[0]
  1994. @layout.y = @org_position_2[1]
  1995. @layout.x += PARTY_COMMAND_SLIDE_POSITION[0] if PARTY_COMMAND_SLIDE_EFFECT
  1996. @layout.y += PARTY_COMMAND_SLIDE_POSITION[1] if PARTY_COMMAND_SLIDE_EFFECT
  1997. @layout.visible = self.visible
  1998. end
  1999.  
  2000. #--------------------------------------------------------------------------
  2001. # * Select
  2002. #--------------------------------------------------------------------------
  2003. alias mog_monogatari_refresh_partycommand refresh
  2004. def refresh
  2005. if @org_position == nil
  2006. @org_position = [PARTY_COMMAND_POSITION[0] - (self.width / 2),
  2007. PARTY_COMMAND_POSITION[1] - (self.height / 2)]
  2008. end
  2009. mog_monogatari_refresh_partycommand
  2010.  
  2011. self.viewport = nil
  2012. self.x = @org_position[0] ; self.y = @org_position[1]
  2013. if PARTY_COMMAND_SLIDE_EFFECT
  2014. self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2015. self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2016.  
  2017. end
  2018. self.opacity = PARTY_COMMAND_OPACITY
  2019. end
  2020.  
  2021. def show
  2022.  
  2023. end
  2024.  
  2025. #--------------------------------------------------------------------------
  2026. # * Show
  2027. #--------------------------------------------------------------------------
  2028. alias mog_bg_ex_slide_show_party show
  2029. def show
  2030. self.viewport = nil
  2031. self.x = @org_position[0] ; self.y = @org_position[1]
  2032. if PARTY_COMMAND_SLIDE_EFFECT
  2033. self.x += PARTY_COMMAND_SLIDE_POSITION[0]
  2034. self.y += PARTY_COMMAND_SLIDE_POSITION[1]
  2035.  
  2036. end
  2037. self.opacity = PARTY_COMMAND_OPACITY
  2038. mog_bg_ex_slide_show_party
  2039. end
  2040.  
  2041. #--------------------------------------------------------------------------
  2042. # * Update
  2043. #--------------------------------------------------------------------------
  2044. alias mog_monogatari_party_window_update update
  2045. def update
  2046. mog_monogatari_party_window_update
  2047. self.visible = self.active
  2048. if @layout != nil and @layout.visible != self.visible
  2049. refresh_layout
  2050. end
  2051. execute_slide_effect if self.visible
  2052. end
  2053.  
  2054. end
  2055.  
  2056. #==============================================================================
  2057. # ** Window_Help
  2058. #==============================================================================
  2059. class Window_Help < Window_Base
  2060.  
  2061. include MOG_BATTLE_HUD_EX
  2062.  
  2063. #--------------------------------------------------------------------------
  2064. # * Object Initialization
  2065. #--------------------------------------------------------------------------
  2066. alias mog_monogatari_battle_help_initialize initialize
  2067. def initialize(line_number = 2)
  2068. @battle_phase = false
  2069. mog_monogatari_battle_help_initialize(line_number)
  2070. @wait_time = 5
  2071. if SceneManager.scene_is?(Scene_Battle)
  2072. @battle_phase = true
  2073. self.width = HELP_WINDOW_SIZE[0]
  2074. self.height = HELP_WINDOW_SIZE[1]
  2075. @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
  2076. HELP_WINDOW_POSITION[1]]
  2077. self.x = @org_position[0]
  2078. self.y = @org_position[1]
  2079. self.opacity = HELP_WINDOW_OPACITY
  2080. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2081. create_layout
  2082. end
  2083. end
  2084.  
  2085. #--------------------------------------------------------------------------
  2086. # * Dispose
  2087. #--------------------------------------------------------------------------
  2088. alias mog_monogatari_help_window_dispose dispose
  2089. def dispose
  2090. mog_monogatari_help_window_dispose
  2091. dispose_layout
  2092. end
  2093.  
  2094. #--------------------------------------------------------------------------
  2095. # * Create Layout
  2096. #--------------------------------------------------------------------------
  2097. def create_layout
  2098. return if @layout != nil
  2099. return if !HELP_WINDOW_LAYOUT
  2100. return if $game_temp.mbhud_window[2]
  2101. return if !SceneManager.scene_is?(Scene_Battle)
  2102. $game_temp.mbhud_window[2] = true
  2103. @org_position_2 = [self.x + HELP_WINDOW_LAYOUT_POSITION[0],self.y + HELP_WINDOW_LAYOUT_POSITION[1]]
  2104. @layout = Sprite.new
  2105. @layout.bitmap = Cache.battle_hud("Layout_Help")
  2106. @layout.z = self.z - 1
  2107. refresh_layout
  2108. @layout.visible = false
  2109. end
  2110.  
  2111. #--------------------------------------------------------------------------
  2112. # * Dispose Layout
  2113. #--------------------------------------------------------------------------
  2114. def dispose_layout
  2115. return if @layout == nil
  2116. @layout.dispose
  2117. @layout = nil
  2118. end
  2119.  
  2120. #--------------------------------------------------------------------------
  2121. # * Refresh Layout
  2122. #--------------------------------------------------------------------------
  2123. def refresh_layout
  2124. return if @layout == nil
  2125. @layout.x = @org_position_2[0]
  2126. @layout.y = @org_position_2[1]
  2127. @layout.x += HELP_WINDOW_SLIDE_POSITION[0] if HELP_WINDOW_SLIDE_EFFECT
  2128. @layout.y += HELP_WINDOW_SLIDE_POSITION[1] if HELP_WINDOW_SLIDE_EFFECT
  2129. @layout.visible = self.visible
  2130. end
  2131.  
  2132. #--------------------------------------------------------------------------
  2133. # * Show
  2134. #--------------------------------------------------------------------------
  2135. alias mog_bg_ex_slide_show_help show
  2136. def show
  2137. if @battle_phase
  2138. self.viewport = nil
  2139. self.x = @org_position[0] ; self.y = @org_position[1]
  2140. if HELP_WINDOW_SLIDE_EFFECT
  2141. self.x += HELP_WINDOW_SLIDE_POSITION[0]
  2142. self.y += HELP_WINDOW_SLIDE_POSITION[1]
  2143. end
  2144. self.opacity = HELP_WINDOW_OPACITY
  2145. end
  2146. mog_bg_ex_slide_show_help
  2147. end
  2148.  
  2149. #--------------------------------------------------------------------------
  2150. # * Update
  2151. #--------------------------------------------------------------------------
  2152. alias mog_monogatari_help_window_update update
  2153. def update
  2154. if @wait_time > 0
  2155. @wait_time -= 1
  2156. return
  2157. end
  2158. mog_monogatari_help_window_update
  2159. if SceneManager.scene_is?(Scene_Battle)
  2160. if @layout != nil
  2161. refresh_layout if @layout.visible != self.visible
  2162. @layout.visible = self.visible
  2163. end
  2164. self.visible = false if !$game_temp.sprite_visible
  2165. execute_slide_effect if self.visible
  2166. end
  2167. end
  2168.  
  2169. end
  2170.  
  2171. #==============================================================================
  2172. # ** Window_BattleActor
  2173. #==============================================================================
  2174. class Window_BattleActor < Window_BattleStatus
  2175.  
  2176. include MOG_BATTLE_HUD_EX
  2177.  
  2178. #--------------------------------------------------------------------------
  2179. # * Initialize
  2180. #--------------------------------------------------------------------------
  2181. alias mog_monogatari_battle_actor_initialize initialize
  2182. def initialize(info_viewport)
  2183. @force_hide = can_force_hide?
  2184. mog_monogatari_battle_actor_initialize(info_viewport)
  2185. self.width = ACTOR_WINDOW_SIZE[0]
  2186. self.height = ACTOR_WINDOW_SIZE[1]
  2187. @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
  2188. ACTOR_WINDOW_POSITION[1] - self.height]
  2189. @org_position[1] = Graphics.height + 64 if @force_hide
  2190. self.x = @org_position[0]
  2191. self.y = @org_position[1]
  2192. self.opacity = ACTOR_WINDOW_OPACITY
  2193. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2194. self.viewport = nil
  2195. create_layout
  2196. end
  2197.  
  2198. #--------------------------------------------------------------------------
  2199. # * Can Force Hide?
  2200. #--------------------------------------------------------------------------
  2201. def can_force_hide?
  2202. return true if $imported[:ve_target_arrow]
  2203. return true if $imported[:mog_battle_cursor]
  2204. return false
  2205. end
  2206.  
  2207. #--------------------------------------------------------------------------
  2208. # * Dispose
  2209. #--------------------------------------------------------------------------
  2210. alias mog_monogatari_actor_window_dispose dispose
  2211. def dispose
  2212. mog_monogatari_actor_window_dispose
  2213. dispose_layout
  2214. end
  2215.  
  2216. #--------------------------------------------------------------------------
  2217. # * Create Layout
  2218. #--------------------------------------------------------------------------
  2219. def create_layout
  2220. return if @layout != nil
  2221. return if !ACTOR_WINDOW_LAYOUT
  2222. return if $game_temp.mbhud_window[3]
  2223. $game_temp.mbhud_window[3] = true
  2224. @org_position_2 = [self.x + ACTOR_WINDOW_LAYOUT_POSITION[0],self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]]
  2225. @layout = Sprite.new
  2226. @layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
  2227. @layout.z = self.z - 1
  2228. refresh_layout
  2229. @layout.visible = false
  2230. end
  2231.  
  2232. #--------------------------------------------------------------------------
  2233. # * Dispose Layout
  2234. #--------------------------------------------------------------------------
  2235. def dispose_layout
  2236. return if @layout == nil
  2237. @layout.dispose
  2238. @layout = nil
  2239. end
  2240.  
  2241. #--------------------------------------------------------------------------
  2242. # * Refresh Layout
  2243. #--------------------------------------------------------------------------
  2244. def refresh_layout
  2245. return if @layout == nil
  2246. @layout.x = @org_position_2[0]
  2247. @layout.y = @org_position_2[1]
  2248. @layout.x += ACTOR_WINDOW_SLIDE_POSITION[0] if ACTOR_WINDOW_SLIDE_EFFECT
  2249. @layout.y += ACTOR_WINDOW_SLIDE_POSITION[1] if ACTOR_WINDOW_SLIDE_EFFECT
  2250. @layout.visible = self.visible
  2251. end
  2252.  
  2253. if $imported[:ve_target_arrow]
  2254. #--------------------------------------------------------------------------
  2255. # * New method: show_actor
  2256. #--------------------------------------------------------------------------
  2257. alias mog_battle_hud_ex_show_actor show_actor
  2258. def show_actor
  2259. return true if SceneManager.face_battler?
  2260. mog_battle_hud_ex_show_actor
  2261. end
  2262. end
  2263.  
  2264. #--------------------------------------------------------------------------
  2265. # * Show
  2266. #--------------------------------------------------------------------------
  2267. alias mog_bg_ex_slide_show_actor show
  2268. def show
  2269. self.viewport = nil
  2270. self.x = @org_position[0] ; self.y = @org_position[1]
  2271. if ACTOR_WINDOW_SLIDE_EFFECT
  2272. self.x += ACTOR_WINDOW_SLIDE_POSITION[0]
  2273. self.y += ACTOR_WINDOW_SLIDE_POSITION[1]
  2274. end
  2275. self.opacity = ACTOR_WINDOW_OPACITY
  2276. mog_bg_ex_slide_show_actor
  2277. end
  2278.  
  2279. #--------------------------------------------------------------------------
  2280. # * Update
  2281. #--------------------------------------------------------------------------
  2282. alias mog_monogatari_actor_window_update update
  2283. def update
  2284. mog_monogatari_actor_window_update
  2285. self.visible = self.active
  2286. self.visible = false if @force_hide
  2287. if @layout != nil
  2288. refresh_layout if @layout.visible != self.visible
  2289. end
  2290. if !$game_temp.sprite_visible
  2291. self.visible = false
  2292. @layout.visible = self.visible if @layout != nil
  2293. end
  2294. execute_slide_effect if self.visible
  2295. end
  2296.  
  2297. end
  2298.  
  2299. #==============================================================================
  2300. # ** Window_BattleEnemy
  2301. #==============================================================================
  2302. class Window_BattleEnemy < Window_Selectable
  2303.  
  2304. include MOG_BATTLE_HUD_EX
  2305.  
  2306. #--------------------------------------------------------------------------
  2307. # * Initialize
  2308. #--------------------------------------------------------------------------
  2309. alias mog_monogatari_battle_enemy_initialize initialize
  2310. def initialize(info_viewport)
  2311. @force_hide = can_force_hide?
  2312. mog_monogatari_battle_enemy_initialize(info_viewport)
  2313. self.width = ENEMY_WINDOW_SIZE[0]
  2314. self.height = ENEMY_WINDOW_SIZE[1]
  2315. @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
  2316. ENEMY_WINDOW_POSITION[1] - self.height]
  2317. @org_position[1] = Graphics.height + 64 if @force_hide
  2318. self.x = @org_position[0]
  2319. self.y = @org_position[1]
  2320. self.opacity = ENEMY_WINDOW_OPACITY
  2321. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
  2322. create_layout
  2323. end
  2324.  
  2325. #--------------------------------------------------------------------------
  2326. # * Can Force Hide?
  2327. #--------------------------------------------------------------------------
  2328. def can_force_hide?
  2329. return true if $imported[:ve_target_arrow]
  2330. return true if $imported[:mog_battle_cursor]
  2331. return false
  2332. end
  2333.  
  2334. #--------------------------------------------------------------------------
  2335. # * Dispose
  2336. #--------------------------------------------------------------------------
  2337. alias mog_monogatari_enemy_window_dispose dispose
  2338. def dispose
  2339. mog_monogatari_enemy_window_dispose
  2340. dispose_layout
  2341. end
  2342.  
  2343. #--------------------------------------------------------------------------
  2344. # * Create Layout
  2345. #--------------------------------------------------------------------------
  2346. def create_layout
  2347. return if @layout != nil
  2348. return if !ENEMY_WINDOW_LAYOUT
  2349. return if $game_temp.mbhud_window[4]
  2350. $game_temp.mbhud_window[4] = true
  2351. @org_position_2 = [self.x + ENEMY_WINDOW_LAYOUT_POSITION[0],self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]]
  2352. @layout = Sprite.new
  2353. @layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
  2354. @layout.z = self.z - 1
  2355. refresh_layout
  2356. @layout.visible = false
  2357. end
  2358.  
  2359. #--------------------------------------------------------------------------
  2360. # * Dispose Layout
  2361. #--------------------------------------------------------------------------
  2362. def dispose_layout
  2363. return if @layout == nil
  2364. @layout.dispose
  2365. @layout = nil
  2366. end
  2367.  
  2368. #--------------------------------------------------------------------------
  2369. # * Refresh Layout
  2370. #--------------------------------------------------------------------------
  2371. def refresh_layout
  2372. return if @layout == nil
  2373. @layout.x = @org_position_2[0]
  2374. @layout.y = @org_position_2[1]
  2375. @layout.x += ENEMY_WINDOW_SLIDE_POSITION[0] if ENEMY_WINDOW_SLIDE_EFFECT
  2376. @layout.y += ENEMY_WINDOW_SLIDE_POSITION[1] if ENEMY_WINDOW_SLIDE_EFFECT
  2377. @layout.visible = self.visible
  2378. end
  2379.  
  2380. #--------------------------------------------------------------------------
  2381. # * Show
  2382. #--------------------------------------------------------------------------
  2383. alias mog_bg_ex_slide_show_enemy show
  2384. def show
  2385. self.viewport = nil
  2386. self.x = @org_position[0] ; self.y = @org_position[1]
  2387. if ENEMY_WINDOW_SLIDE_EFFECT
  2388. self.x += ENEMY_WINDOW_SLIDE_POSITION[0]
  2389. self.y += ENEMY_WINDOW_SLIDE_POSITION[1]
  2390. end
  2391. self.opacity = ENEMY_WINDOW_OPACITY
  2392. mog_bg_ex_slide_show_enemy
  2393. end
  2394.  
  2395. #--------------------------------------------------------------------------
  2396. # * Update
  2397. #--------------------------------------------------------------------------
  2398. alias mog_monogatari_enemy_window_update update
  2399. def update
  2400. mog_monogatari_enemy_window_update
  2401. self.visible = false if @force_hide
  2402. if @layout != nil and @layout.visible != self.visible
  2403. refresh_layout
  2404. end
  2405. if !$game_temp.sprite_visible
  2406. self.visible = false
  2407. @layout.visible = self.visible if @layout != nil
  2408. end
  2409. execute_slide_effect if self.visible
  2410. end
  2411.  
  2412. if $imported["YEA-BattleEngine"]
  2413. #--------------------------------------------------------------------------
  2414. # * Draw Item
  2415. #--------------------------------------------------------------------------
  2416. def draw_item(index)
  2417. change_color(normal_color)
  2418. name = $game_troop.alive_members[index].name
  2419. draw_text(item_rect_for_text(index), name)
  2420. end
  2421. end
  2422.  
  2423. #--------------------------------------------------------------------------
  2424. # * Process Cursor Move
  2425. #--------------------------------------------------------------------------
  2426. alias mog_atb_wenemy_process_cursor_move process_cursor_move
  2427. def process_cursor_move
  2428. return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2429. mog_atb_wenemy_process_cursor_move
  2430. end
  2431.  
  2432. #--------------------------------------------------------------------------
  2433. # * Process Handling
  2434. #--------------------------------------------------------------------------
  2435. alias mog_atb_wenemy_process_handling process_handling
  2436. def process_handling
  2437. return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
  2438. mog_atb_wenemy_process_handling
  2439. end
  2440.  
  2441. end
  2442.  
  2443. #==============================================================================
  2444. # ** Window_BattleSkill
  2445. #==============================================================================
  2446. class Window_BattleSkill < Window_SkillList
  2447. include MOG_BATTLE_HUD_EX
  2448.  
  2449. #--------------------------------------------------------------------------
  2450. # * Initialize
  2451. #--------------------------------------------------------------------------
  2452. alias mog_monogatari_battle_skill_initialize initialize
  2453. def initialize(help_window, info_viewport)
  2454. @force_hide = can_force_hide?
  2455. @force_hide_active = can_force_hide_active?
  2456. mog_monogatari_battle_skill_initialize(help_window, info_viewport)
  2457. self.width = SKILL_WINDOW_SIZE[0]
  2458. self.height = SKILL_WINDOW_SIZE[1]
  2459. @org_position = [SKILL_WINDOW_POSITION[0],
  2460. Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
  2461. self.x = @org_position[0]
  2462. self.y = @org_position[1]
  2463. self.opacity = SKILL_WINDOW_OPACITY
  2464. self.viewport = nil
  2465. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2466. create_layout
  2467. end
  2468.  
  2469. #--------------------------------------------------------------------------
  2470. # * Col Max
  2471. #--------------------------------------------------------------------------
  2472. def col_max
  2473. return SKILL_COL_MAX
  2474. end
  2475.  
  2476. #--------------------------------------------------------------------------
  2477. # * Can Force Hide Active?
  2478. #--------------------------------------------------------------------------
  2479. def can_force_hide_active?
  2480. return true if $imported[:ve_target_arrow]
  2481. return true if $imported[:mog_battle_cursor] != nil
  2482. return false
  2483. end
  2484.  
  2485. #--------------------------------------------------------------------------
  2486. # * Can Force Hide?
  2487. #--------------------------------------------------------------------------
  2488. def can_force_hide?
  2489. return false
  2490. end
  2491.  
  2492. #--------------------------------------------------------------------------
  2493. # * Dispose
  2494. #--------------------------------------------------------------------------
  2495. alias mog_monogatari_skill_window_dispose dispose
  2496. def dispose
  2497. mog_monogatari_skill_window_dispose
  2498. dispose_layout
  2499. end
  2500.  
  2501. #--------------------------------------------------------------------------
  2502. # * Create Layout
  2503. #--------------------------------------------------------------------------
  2504. def create_layout
  2505. return if @layout != nil
  2506. return if !SKILL_WINDOW_LAYOUT
  2507. return if $game_temp.mbhud_window[5]
  2508. $game_temp.mbhud_window[5] = true
  2509. @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
  2510. @layout = Sprite.new
  2511. @layout.bitmap = Cache.battle_hud("Layout_Skill")
  2512. @layout.z = self.z - 1
  2513. refresh_layout
  2514. @layout.visible = false
  2515. end
  2516.  
  2517. #--------------------------------------------------------------------------
  2518. # * Dispose Layout
  2519. #--------------------------------------------------------------------------
  2520. def dispose_layout
  2521. return if @layout == nil
  2522. @layout.dispose
  2523. @layout = nil
  2524. end
  2525.  
  2526. #--------------------------------------------------------------------------
  2527. # * Refresh Layout
  2528. #--------------------------------------------------------------------------
  2529. def refresh_layout
  2530. return if @layout == nil
  2531. @layout.x = @org_position_2[0]
  2532. @layout.y = @org_position_2[1]
  2533. @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
  2534. @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
  2535. @layout.visible = self.visible
  2536. end
  2537.  
  2538. #--------------------------------------------------------------------------
  2539. # * Show
  2540. #--------------------------------------------------------------------------
  2541. alias mog_bg_ex_slide_show_skill show
  2542. def show
  2543. self.viewport = nil
  2544. self.x = @org_position[0] ; self.y = @org_position[1]
  2545. if SKILL_WINDOW_SLIDE_EFFECT
  2546. self.x += SKILL_WINDOW_SLIDE_POSITION[0]
  2547. self.y += SKILL_WINDOW_SLIDE_POSITION[1]
  2548. end
  2549. self.opacity = SKILL_WINDOW_OPACITY
  2550. mog_bg_ex_slide_show_skill
  2551. end
  2552.  
  2553. #--------------------------------------------------------------------------
  2554. # * Update
  2555. #--------------------------------------------------------------------------
  2556. alias mog_monogatari_skill_window_update update
  2557. def update
  2558. mog_monogatari_skill_window_update
  2559. self.visible = self.active if @force_hide_active
  2560. self.visible = false if @force_hide
  2561. if @layout != nil and @layout.visible != self.visible
  2562. refresh_layout
  2563. end
  2564. self.visible = false if !$game_temp.sprite_visible
  2565. execute_slide_effect if self.visible
  2566. end
  2567.  
  2568. end
  2569.  
  2570. #==============================================================================
  2571. # ** Window_BattleItem
  2572. #==============================================================================
  2573. class Window_BattleItem < Window_ItemList
  2574. include MOG_BATTLE_HUD_EX
  2575.  
  2576. #--------------------------------------------------------------------------
  2577. # * Initialize
  2578. #--------------------------------------------------------------------------
  2579. alias mog_monogatari_battle_item_initialize initialize
  2580. def initialize(help_window, info_viewport)
  2581. @force_hide = can_force_hide?
  2582. @force_hide_active = can_force_hide_active?
  2583. mog_monogatari_battle_item_initialize(help_window, info_viewport)
  2584. self.width = ITEM_WINDOW_SIZE[0]
  2585. self.height = ITEM_WINDOW_SIZE[1]
  2586. @org_position = [ITEM_WINDOW_POSITION[0],
  2587. Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
  2588. self.x = @org_position[0]
  2589. self.y = @org_position[1]
  2590. self.viewport = nil
  2591. self.opacity = ITEM_WINDOW_OPACITY
  2592. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
  2593. create_layout
  2594. end
  2595.  
  2596. #--------------------------------------------------------------------------
  2597. # * Col Max
  2598. #--------------------------------------------------------------------------
  2599. def col_max
  2600. return ITEM_COL_MAX
  2601. end
  2602.  
  2603. #--------------------------------------------------------------------------
  2604. # * Can Force Hide Active?
  2605. #--------------------------------------------------------------------------
  2606. def can_force_hide_active?
  2607. return true if $imported[:ve_target_arrow]
  2608. return true if $imported[:mog_battle_cursor] != nil
  2609. return false
  2610. end
  2611.  
  2612. #--------------------------------------------------------------------------
  2613. # * Can Force Hide?
  2614. #--------------------------------------------------------------------------
  2615. def can_force_hide?
  2616. return false
  2617. end
  2618.  
  2619. #--------------------------------------------------------------------------
  2620. # * Dispose
  2621. #--------------------------------------------------------------------------
  2622. alias mog_monogatari_item_window_dispose dispose
  2623. def dispose
  2624. mog_monogatari_item_window_dispose
  2625. dispose_layout
  2626. end
  2627.  
  2628. #--------------------------------------------------------------------------
  2629. # * Create Layout
  2630. #--------------------------------------------------------------------------
  2631. def create_layout
  2632. return if @layout != nil
  2633. return if !ITEM_WINDOW_LAYOUT
  2634. return if $game_temp.mbhud_window[6]
  2635. $game_temp.mbhud_window[6] = true
  2636. @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
  2637. @layout = Sprite.new
  2638. @layout.bitmap = Cache.battle_hud("Layout_Item")
  2639. @layout.z = self.z - 1
  2640. refresh_layout
  2641. @layout.visible = false
  2642. end
  2643.  
  2644. #--------------------------------------------------------------------------
  2645. # * Dispose Layout
  2646. #--------------------------------------------------------------------------
  2647. def dispose_layout
  2648. return if @layout == nil
  2649. @layout.dispose
  2650. @layout = nil
  2651. end
  2652.  
  2653. #--------------------------------------------------------------------------
  2654. # * Refresh Layout
  2655. #--------------------------------------------------------------------------
  2656. def refresh_layout
  2657. return if @layout == nil
  2658. @layout.x = @org_position_2[0]
  2659. @layout.y = @org_position_2[1]
  2660. @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
  2661. @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
  2662. @layout.visible = self.visible
  2663. end
  2664.  
  2665. #--------------------------------------------------------------------------
  2666. # * Show
  2667. #--------------------------------------------------------------------------
  2668. alias mog_bg_ex_slide_show_item show
  2669. def show
  2670. self.viewport = nil
  2671. self.x = @org_position[0] ; self.y = @org_position[1]
  2672. if ITEM_WINDOW_SLIDE_EFFECT
  2673. self.x += ITEM_WINDOW_SLIDE_POSITION[0]
  2674. self.y += ITEM_WINDOW_SLIDE_POSITION[1]
  2675. end
  2676. self.opacity = ITEM_WINDOW_OPACITY
  2677. mog_bg_ex_slide_show_item
  2678. end
  2679.  
  2680. #--------------------------------------------------------------------------
  2681. # * Update
  2682. #--------------------------------------------------------------------------
  2683. alias mog_monogatari_item_window_update update
  2684. def update
  2685. mog_monogatari_item_window_update
  2686. self.visible = self.active if @force_hide_active
  2687. self.visible = false if @force_hide
  2688. if @layout != nil
  2689. refresh_layout if @layout.visible != self.visible
  2690. end
  2691. self.visible = false if !$game_temp.sprite_visible
  2692. execute_slide_effect if self.visible
  2693. end
  2694.  
  2695. end
  2696.  
  2697. end
  2698.  
  2699. #--------------------------------------------------------------------------
  2700. #--------------------------------------------------------------------------
  2701. #################################
  2702. if $imported["YEA-BattleEngine"]
  2703. #################################
  2704.  
  2705. #==============================================================================
  2706. # ** Window_BattleStatusAid
  2707. #==============================================================================
  2708. class Window_BattleStatusAid < Window_BattleStatus
  2709.  
  2710. #--------------------------------------------------------------------------
  2711. # * Refresh
  2712. #--------------------------------------------------------------------------
  2713. def refresh
  2714. contents.clear
  2715. self.visible = false
  2716. end
  2717.  
  2718. end
  2719.  
  2720. #==============================================================================
  2721. # ** Window_BattleStatus
  2722. #==============================================================================
  2723. class Window_BattleStatus < Window_Selectable
  2724.  
  2725. #--------------------------------------------------------------------------
  2726. # * Update
  2727. #--------------------------------------------------------------------------
  2728. alias mog_monogatari_bhud_yf_update update
  2729. def update
  2730. mog_monogatari_bhud_yf_update
  2731. update_visible_yf
  2732. end
  2733.  
  2734. #--------------------------------------------------------------------------
  2735. # * Update Visible Yf
  2736. #--------------------------------------------------------------------------
  2737. def update_visible_yf
  2738. self.visible = self.active
  2739. self.visible = false if !$game_temp.sprite_visible
  2740. end
  2741.  
  2742. end
  2743.  
  2744. #==============================================================================
  2745. # ■ Window ActorCommand
  2746. #==============================================================================
  2747. class Window_ActorCommand < Window_Command
  2748.  
  2749. #--------------------------------------------------------------------------
  2750. # * Show
  2751. #--------------------------------------------------------------------------
  2752. alias mog_bhud_yf_command_show show
  2753. def show
  2754. return if !BattleManager.can_enable_window?
  2755. mog_bhud_yf_command_show
  2756. end
  2757.  
  2758. #--------------------------------------------------------------------------
  2759. # * Update
  2760. #--------------------------------------------------------------------------
  2761. alias mog_monogatari_bhud_yf_actorcommand_update update
  2762. def update
  2763. mog_monogatari_bhud_yf_actorcommand_update
  2764. update_visible_yf
  2765. end
  2766.  
  2767. #--------------------------------------------------------------------------
  2768. # * Update Visible Yf
  2769. #--------------------------------------------------------------------------
  2770. def update_visible_yf
  2771. self.visible = self.active
  2772. self.visible = false if !$game_temp.sprite_visible
  2773. end
  2774.  
  2775. end
  2776.  
  2777. #==============================================================================
  2778. # ** Scene Battle
  2779. #==============================================================================
  2780. class Scene_Battle < Scene_Base
  2781.  
  2782. include MOG_BATTLE_HUD_EX
  2783.  
  2784. #--------------------------------------------------------------------------
  2785. # alias method: create_skill_window
  2786. #--------------------------------------------------------------------------
  2787. alias mog_yf_scene_battle_create_skill_window create_skill_window
  2788. def create_skill_window
  2789. mog_yf_scene_battle_create_skill_window
  2790. @skill_window.width = SKILL_WINDOW_SIZE[0]
  2791. @skill_window.height = SKILL_WINDOW_SIZE[1]
  2792. @skill_window.x = SKILL_WINDOW_POSITION[0]
  2793. @skill_window.y = SKILL_WINDOW_POSITION[1]
  2794. end
  2795.  
  2796. #--------------------------------------------------------------------------
  2797. # alias method: create_item_window
  2798. #--------------------------------------------------------------------------
  2799. alias mog_yf_scene_battle_create_item_window create_item_window
  2800. def create_item_window
  2801. mog_yf_scene_battle_create_item_window
  2802. @item_window.width = ITEM_WINDOW_SIZE[0]
  2803. @item_window.height = ITEM_WINDOW_SIZE[1]
  2804. @item_window.x = ITEM_WINDOW_POSITION[0]
  2805. @item_window.y = ITEM_WINDOW_POSITION[1]
  2806. end
  2807.  
  2808. if !$imported[:mog_atb_system]
  2809. #--------------------------------------------------------------------------
  2810. # * Next Command
  2811. #--------------------------------------------------------------------------
  2812. def next_command
  2813. if BattleManager.next_command
  2814. @status_window.show
  2815. redraw_current_status
  2816. @actor_command_window.show
  2817. @status_aid_window.hide
  2818. start_actor_command_selection
  2819. else
  2820. turn_start
  2821. end
  2822. end
  2823. end
  2824.  
  2825. #--------------------------------------------------------------------------
  2826. # * STW Can Visible
  2827. #--------------------------------------------------------------------------
  2828. def stw_can_visible?
  2829. return false if !BattleManager.can_enable_window?
  2830. return false if @item_window.visible
  2831. return false if @skill_window.visible
  2832. return true if @actor_window.active
  2833. return false
  2834. end
  2835.  
  2836. if $imported["YEA-CommandEquip"]
  2837. #--------------------------------------------------------------------------
  2838. # * Command Equip
  2839. #--------------------------------------------------------------------------
  2840. alias mog_yf_command_equip command_equip
  2841. def command_equip
  2842. @actor_command_window.visible = false
  2843. @actor_command_window.update
  2844. $game_temp.battle_hud_visible_refresh = [true,false]
  2845. @spriteset.update_battle_hud_ex
  2846. @spriteset.battler_sprites.each do |s| s.dispose_animation end
  2847. mog_yf_command_equip
  2848. $game_temp.battle_hud_visible_refresh = [true,true]
  2849. end
  2850. end
  2851.  
  2852. end
  2853.  
  2854. end
  2855. #--------------------------------------------------------------------------
  2856.  
  2857.  
  2858. ######################################
  2859. if $imported["YEA-EnemyTargetInfo"]
  2860. ######################################
  2861.  
  2862. #==============================================================================
  2863. # ■ Window_Comparison
  2864. #==============================================================================
  2865. class Window_Comparison < Window_Base
  2866.  
  2867. #--------------------------------------------------------------------------
  2868. # * Refresh
  2869. #--------------------------------------------------------------------------
  2870. alias mog_battle_hud_ex_yf_refresh refresh
  2871. def refresh
  2872. mog_battle_hud_ex_yf_refresh
  2873. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2874. self.viewport = nil
  2875. end
  2876.  
  2877. end
  2878.  
  2879. #==============================================================================
  2880. # ■ Window_ComparisonHelp
  2881. #==============================================================================
  2882. class Window_ComparisonHelp < Window_Base
  2883.  
  2884. #--------------------------------------------------------------------------
  2885. # * Refresh
  2886. #--------------------------------------------------------------------------
  2887. alias mog_battle_hud_ex_yf_refresh refresh
  2888. def refresh
  2889. mog_battle_hud_ex_yf_refresh
  2890. self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
  2891. self.viewport = nil
  2892. end
  2893.  
  2894. end
  2895. end
  2896. #--------------------------------------------------------------------------
  2897. #--------------------------------------------------------------------------
  2898.  
  2899.  
  2900. #################################
  2901. if $imported["YEA-EnemyTargetInfo"]
  2902. #################################
  2903. class Window_Comparison < Window_Base
  2904.  
  2905. #--------------------------------------------------------------------------
  2906. # initialize
  2907. #--------------------------------------------------------------------------
  2908. alias mog_battle_hud_yf_wcomparison_initialize initialize
  2909. def initialize(type)
  2910. mog_battle_hud_yf_wcomparison_initialize(type)
  2911. self.z = 102
  2912. end
  2913.  
  2914. end
  2915. end
  2916. #--------------------------------------------------------------------------
  2917. #--------------------------------------------------------------------------
  2918.  
  2919. #--------------------------------------------------------------------------
  2920. #--------------------------------------------------------------------------
  2921. #################################
  2922. if $imported["YSA-CATB"]
  2923. #################################
  2924.  
  2925. #==============================================================================
  2926. # ■ Enemy CATB Gauge Viewport
  2927. #==============================================================================
  2928. class Enemy_CATB_Gauge_Viewport < Viewport
  2929.  
  2930. #--------------------------------------------------------------------------
  2931. # initialize
  2932. #--------------------------------------------------------------------------
  2933. alias mog_battle_hud_ex_yami_initialize initialize
  2934. def initialize(battler, sprite, type)
  2935. mog_battle_hud_ex_yami_initialize(battler, sprite, type)
  2936. self.z = 90
  2937. end
  2938.  
  2939. end
  2940.  
  2941. #==============================================================================
  2942. # ■ Game_Battler
  2943. #==============================================================================
  2944. class Game_Battler < Game_BattlerBase
  2945.  
  2946. attr_accessor :catb_value
  2947. attr_accessor :max_atb
  2948.  
  2949. #--------------------------------------------------------------------------
  2950. # * Max ATB
  2951. #--------------------------------------------------------------------------
  2952. def max_atb
  2953. return MAX_CATB_VALUE
  2954. return 1
  2955. end
  2956.  
  2957. end
  2958.  
  2959. end
  2960. #--------------------------------------------------------------------------
  2961. #--------------------------------------------------------------------------
  2962.  
  2963. #==============================================================================
  2964. # ** Window Base
  2965. #==============================================================================
  2966. class Window_Base < Window
  2967.  
  2968. #--------------------------------------------------------------------------
  2969. # * Execute Move W
  2970. #--------------------------------------------------------------------------
  2971. def execute_move_w(sprite,type,cp,np)
  2972. sp = 6 + ((cp - np).abs / 10)
  2973. if cp > np ; cp -= sp ; cp = np if cp < np
  2974. elsif cp < np ; cp += sp ; cp = np if cp > np
  2975. end
  2976. sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
  2977. end
  2978.  
  2979. #--------------------------------------------------------------------------
  2980. # * Set BH EX Font
  2981. #--------------------------------------------------------------------------
  2982. def set_bh_ex_font
  2983. return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
  2984. self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
  2985. self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
  2986. self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
  2987. self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
  2988. end
  2989.  
  2990. #--------------------------------------------------------------------------
  2991. # * Execute Slide Effect
  2992. #--------------------------------------------------------------------------
  2993. def execute_slide_effect
  2994. return if @org_position == nil
  2995. execute_move_w(self,0,self.x,@org_position[0])
  2996. execute_move_w(self,1,self.y,@org_position[1])
  2997. return if @layout == nil
  2998. execute_move_w(@layout,0,@layout.x,@org_position_2[0])
  2999. execute_move_w(@layout,1,@layout.y,@org_position_2[1])
  3000. end
  3001.  
  3002. end
  3003.  
  3004. #==============================================================================
  3005. # ** Window Help
  3006. #==============================================================================
  3007. class Window_Help < Window_Base
  3008.  
  3009. #--------------------------------------------------------------------------
  3010. # * Draw Text
  3011. #--------------------------------------------------------------------------
  3012. alias mog_bh_ex_draw_text_help draw_text
  3013. def draw_text(*args)
  3014. set_bh_ex_font
  3015. mog_bh_ex_draw_text_help(*args)
  3016. end
  3017.  
  3018. end
  3019.  
  3020. #==============================================================================
  3021. # ** Window BattleActor
  3022. #==============================================================================
  3023. class Window_BattleActor < Window_BattleStatus
  3024.  
  3025. #--------------------------------------------------------------------------
  3026. # * Draw Item
  3027. #--------------------------------------------------------------------------
  3028. alias mog_bbex_draw_item_actor draw_item
  3029. def draw_item(index)
  3030. set_bh_ex_font
  3031. mog_bbex_draw_item_actor(index)
  3032. end
  3033.  
  3034. end
  3035.  
  3036. #==============================================================================
  3037. # ** Window BattleEnemy
  3038. #==============================================================================
  3039. class Window_BattleEnemy < Window_Selectable
  3040.  
  3041. #--------------------------------------------------------------------------
  3042. # * Draw Item
  3043. #--------------------------------------------------------------------------
  3044. alias mog_bbex_draw_item_enemy draw_item
  3045. def draw_item(index)
  3046. set_bh_ex_font
  3047. mog_bbex_draw_item_enemy(index)
  3048. end
  3049.  
  3050. end
  3051.  
  3052. #==============================================================================
  3053. # ** Window ItemList
  3054. #==============================================================================
  3055. class Window_ItemList < Window_Selectable
  3056.  
  3057. #--------------------------------------------------------------------------
  3058. # * Draw Item Name
  3059. #--------------------------------------------------------------------------
  3060. alias mog_bhex_draw_item_name_item draw_item_name
  3061. def draw_item_name(item, x, y, enabled = true, width = 172)
  3062. set_bh_ex_font
  3063. mog_bhex_draw_item_name_item(item, x, y, enabled , width )
  3064. end
  3065.  
  3066. end
  3067.  
  3068. #==============================================================================
  3069. # ** Window SkillList
  3070. #==============================================================================
  3071. class Window_SkillList < Window_Selectable
  3072.  
  3073. #--------------------------------------------------------------------------
  3074. # * Draw Item Name
  3075. #--------------------------------------------------------------------------
  3076. alias mog_bhex_draw_item_name_skill draw_item_name
  3077. def draw_item_name(item, x, y, enabled = true, width = 172)
  3078. set_bh_ex_font
  3079. mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
  3080. end
  3081.  
  3082. end
  3083.  
  3084. #==============================================================================
  3085. # ** Spriteset_Battle
  3086. #==============================================================================
  3087. class Spriteset_Battle
  3088.  
  3089. #--------------------------------------------------------------------------
  3090. # * Initialize
  3091. #--------------------------------------------------------------------------
  3092. alias mog_battle_hud_ex_initialize initialize
  3093. def initialize
  3094. check_screen_xyz_nil rescue nil
  3095. mog_battle_hud_ex_initialize
  3096. create_battle_hud_ex
  3097. end
  3098.  
  3099. #--------------------------------------------------------------------------
  3100. # * Check Screen Xyz
  3101. #--------------------------------------------------------------------------
  3102. def check_screen_xyz_nil
  3103. return if !SceneManager.face_battler?
  3104. for actor in $game_party.battle_members
  3105. actor.screen_x = 0 if actor.screen_x == nil
  3106. actor.screen_y = 0 if actor.screen_y == nil
  3107. actor.screen_z = 0 if actor.screen_z == nil
  3108. end
  3109. end
  3110.  
  3111. #--------------------------------------------------------------------------
  3112. # * Check Screen Xyz after
  3113. #--------------------------------------------------------------------------
  3114. def check_screen_xyz_after
  3115. return if !SceneManager.face_battler?
  3116. $game_party.battle_members.each_with_index do |actor, index|
  3117. actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
  3118. actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
  3119. actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
  3120. end
  3121. end
  3122.  
  3123. #--------------------------------------------------------------------------
  3124. # * Dispose
  3125. #--------------------------------------------------------------------------
  3126. alias mog_battle_hud_ex_dispose dispose
  3127. def dispose
  3128. dispose_battle_hud_ex
  3129. mog_battle_hud_ex_dispose
  3130. end
  3131.  
  3132. #--------------------------------------------------------------------------
  3133. # * Update
  3134. #--------------------------------------------------------------------------
  3135. alias mog_battle_hud_ex_update update
  3136. def update
  3137. mog_battle_hud_ex_update
  3138. update_battle_hud_ex
  3139. end
  3140.  
  3141. #--------------------------------------------------------------------------
  3142. # * Create Battle Hud EX
  3143. #--------------------------------------------------------------------------
  3144. def create_battle_hud_ex
  3145. return if @battle_hud_ex != nil
  3146. $game_temp.battle_hud_visible = true
  3147. @battle_hud_ex = Monogatari_Bhud.new(nil)
  3148. check_screen_xyz_after
  3149. end
  3150.  
  3151. #--------------------------------------------------------------------------
  3152. # * Dispose Battle Hud EX
  3153. #--------------------------------------------------------------------------
  3154. def dispose_battle_hud_ex
  3155. return if @battle_hud_ex == nil
  3156. @battle_hud_ex.dispose
  3157. @battle_hud_ex = nil
  3158. $game_temp.mbhud_window = [false,false,false,false,false,false,false]
  3159. end
  3160.  
  3161. #--------------------------------------------------------------------------
  3162. # * Update Battle Hud EX
  3163. #--------------------------------------------------------------------------
  3164. def update_battle_hud_ex
  3165. refresh_battle_hud if $game_temp.mbhud_force_refresh
  3166. return if @battle_hud_ex == nil
  3167. @battle_hud_ex.update
  3168. end
  3169.  
  3170. #--------------------------------------------------------------------------
  3171. # * Refresh Battle Hud
  3172. #--------------------------------------------------------------------------
  3173. def refresh_battle_hud
  3174. $game_temp.mbhud_force_refresh = false
  3175. check_screen_xyz_nil rescue nil
  3176. dispose_battle_hud_ex
  3177. create_battle_hud_ex
  3178. end
  3179.  
  3180. end
  3181.  
  3182. #==============================================================================
  3183. # ** Monogatari Bhud
  3184. #==============================================================================
  3185. class Monogatari_Bhud
  3186.  
  3187. include MOG_BATTLE_HUD_EX
  3188.  
  3189. #--------------------------------------------------------------------------
  3190. # * Initialize
  3191. #--------------------------------------------------------------------------
  3192. def initialize(viewport)
  3193. @battle_hud = [] ; @sprite_visitle_wait = 0
  3194. $game_party.battle_members.each_with_index do |actor, index|
  3195. @battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
  3196. create_turn_sprite(nil)
  3197. create_screen_layout(nil)
  3198. end
  3199.  
  3200. #--------------------------------------------------------------------------
  3201. # * Max members
  3202. #--------------------------------------------------------------------------
  3203. def max_members
  3204. if $game_party.members.size > $game_party.max_battle_members
  3205. return $game_party.max_battle_members
  3206. end
  3207. return $game_party.members.size
  3208. end
  3209.  
  3210. #--------------------------------------------------------------------------
  3211. # * Dispose
  3212. #--------------------------------------------------------------------------
  3213. def dispose
  3214. @battle_hud.each {|sprite| sprite.dispose }
  3215. dispose_turn_sprite
  3216. dispose_screen_layout
  3217. end
  3218.  
  3219. #--------------------------------------------------------------------------
  3220. # * Update
  3221. #--------------------------------------------------------------------------
  3222. def update
  3223. @battle_hud.each {|sprite| sprite.update }
  3224. update_turn_sprite
  3225. update_screen_layout
  3226. refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
  3227. end
  3228.  
  3229. #--------------------------------------------------------------------------
  3230. # * Update
  3231. #--------------------------------------------------------------------------
  3232. def refresh_battle_hud_visible
  3233. $game_temp.battle_hud_visible_refresh[0] = false
  3234. @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
  3235. @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
  3236. @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
  3237. @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
  3238. end
  3239.  
  3240. end
  3241.  
  3242. #==============================================================================
  3243. # ** Monogatari Bhud
  3244. #==============================================================================
  3245. class Monogatari_Bhud
  3246.  
  3247. #--------------------------------------------------------------------------
  3248. # * Can Update Turn Sprite
  3249. #--------------------------------------------------------------------------
  3250. def can_refresh_turn_sprite?
  3251. return true if @turn_sprite.visible != $game_temp.command_visible
  3252. return true if $game_temp.refresh_turn_sprite
  3253. return false
  3254. end
  3255.  
  3256. #--------------------------------------------------------------------------
  3257. # * Create Turn Sprite
  3258. #--------------------------------------------------------------------------
  3259. def create_turn_sprite(viewport)
  3260. return if !TURN_SPRITE_VISIBLE
  3261. return if @turn_sprite != nil
  3262. @turn_sprite = Sprite.new
  3263. @turn_sprite.bitmap = Cache.battle_hud("Turn")
  3264. @turn_sprite.viewport = viewport
  3265. @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
  3266. @turn_sprite.visible = false
  3267. @turn_sprite_update_time = 5
  3268. @turn_sprite_blink = [0,0]
  3269. end
  3270.  
  3271. #--------------------------------------------------------------------------
  3272. # * Dispose Turn Sprite
  3273. #--------------------------------------------------------------------------
  3274. def dispose_turn_sprite
  3275. return if @turn_sprite == nil
  3276. @turn_sprite.dispose
  3277. @turn_sprite = nil
  3278. end
  3279.  
  3280. #--------------------------------------------------------------------------
  3281. # * Update Turn Sprite
  3282. #--------------------------------------------------------------------------
  3283. def update_turn_sprite
  3284. return if @turn_sprite == nil
  3285. if @turn_sprite_update_time > 0
  3286. @turn_sprite_update_time -= 1
  3287. return
  3288. end
  3289. update_turn_visible
  3290. update_turn_blink
  3291. end
  3292.  
  3293. #--------------------------------------------------------------------------
  3294. # * Update Turn Visible
  3295. #--------------------------------------------------------------------------
  3296. def update_turn_visible
  3297. $game_temp.refresh_turn_sprite = false
  3298. @turn_sprite.visible = can_turn_sprite_visible?
  3299. return if BattleManager.actor == nil
  3300. x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
  3301. y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
  3302. x = -1000 if x == nil ; y = -1000 if y == nil
  3303. @turn_sprite.x = x ; @turn_sprite.y = y
  3304. end
  3305.  
  3306. #--------------------------------------------------------------------------
  3307. # * Can Turn Sprite Visible?
  3308. #--------------------------------------------------------------------------
  3309. def can_turn_sprite_visible?
  3310. return false if BattleManager.actor == nil
  3311. return false if $game_temp.battle_end
  3312. return false if $game_message.visible
  3313. return true
  3314. end
  3315.  
  3316. #--------------------------------------------------------------------------
  3317. # * Update Turn Blink
  3318. #--------------------------------------------------------------------------
  3319. def update_turn_blink
  3320. return if !TURN_BLINK_EFFECT
  3321. return if !@turn_sprite.visible
  3322. @turn_sprite_blink[0] += 1
  3323. case @turn_sprite_blink[0]
  3324. when 0..30
  3325. @turn_sprite_blink[1] += 3
  3326. when 31..60
  3327. @turn_sprite_blink[1] -= 3
  3328. else
  3329. @turn_sprite_blink = [0,0]
  3330. end
  3331. @turn_sprite.opacity = 150 + @turn_sprite_blink[1]
  3332. end
  3333.  
  3334.  
  3335. end
  3336.  
  3337. #==============================================================================
  3338. # ** Monogatari Bhud
  3339. #==============================================================================
  3340. class Monogatari_Bhud
  3341.  
  3342. #--------------------------------------------------------------------------
  3343. # * Create Screen Layout
  3344. #--------------------------------------------------------------------------
  3345. def create_screen_layout(viewport)
  3346. return if !SCREEN_LAYOUT
  3347. @screen_layout = Sprite.new
  3348. @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
  3349. @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
  3350. @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
  3351. @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
  3352. @screen_layout.opacity = 0
  3353. @screen_layout.viewport = viewport
  3354. end
  3355.  
  3356. #--------------------------------------------------------------------------
  3357. # * Dispose Screen Layout
  3358. #--------------------------------------------------------------------------
  3359. def dispose_screen_layout
  3360. return if @screen_layout == nil
  3361. @screen_layout.dispose ; @screen_layout = nil
  3362. end
  3363.  
  3364. #--------------------------------------------------------------------------
  3365. # * Update Screen Layout
  3366. #--------------------------------------------------------------------------
  3367. def update_screen_layout
  3368. return if @screen_layout == nil
  3369. @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  3370. sprite_visible(@screen_layout)
  3371. end
  3372.  
  3373. #--------------------------------------------------------------------------
  3374. # * Sprite Visible
  3375. #--------------------------------------------------------------------------
  3376. def sprite_visible?
  3377. return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3378. return false if !$game_temp.battle_hud_visible
  3379. return false if !$game_temp.sprite_visible
  3380. return true
  3381. end
  3382.  
  3383. #--------------------------------------------------------------------------
  3384. # * Sprite Visible
  3385. #--------------------------------------------------------------------------
  3386. def sprite_visible(sprite)
  3387. if sprite_visible?
  3388. sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3389. else
  3390. sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3391. end
  3392. end
  3393.  
  3394. end
  3395.  
  3396. #==============================================================================
  3397. #==============================================================================
  3398. # ** Battle Hud EX
  3399. #==============================================================================
  3400. #==============================================================================
  3401. class Battle_Hud_EX
  3402. include MOG_BATTLE_HUD_EX
  3403.  
  3404. #--------------------------------------------------------------------------
  3405. # * Initialize
  3406. #--------------------------------------------------------------------------
  3407. def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
  3408. pre_cache
  3409. setup(actor,index,max_members)
  3410. create_sprites(viewport)
  3411. end
  3412.  
  3413. #--------------------------------------------------------------------------
  3414. # * Setup
  3415. #--------------------------------------------------------------------------
  3416. def setup(actor,index,max_members)
  3417. $game_temp.battle_end = false
  3418. @actor = actor
  3419. @actor_index = index
  3420. @max_members = max_members
  3421. @actor.face_animation = [0,0,0]
  3422. @hp_icon_max = -1
  3423. @hp_icon_old = -1
  3424. @hp_icon_col_max = HP_ICON_COL_MAX
  3425. @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  3426. @hp_icon_row_max = HP_ICON_ROW_MAX
  3427. @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  3428. @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  3429. @mp_icon_max = -1
  3430. @mp_icon_old = -1
  3431. @mp_icon_col_max = MP_ICON_COL_MAX
  3432. @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  3433. @mp_icon_row_max = MP_ICON_ROW_MAX
  3434. @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  3435. @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  3436. @tp_icon_max = -1
  3437. @tp_icon_old = -1
  3438. @tp_icon_col_max = TP_ICON_COL_MAX
  3439. @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  3440. @tp_icon_row_max = TP_ICON_ROW_MAX
  3441. @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  3442. @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  3443. @sprite_visible = true
  3444. @sprite_visitle_wait = 0
  3445. setup_actor
  3446. setup_position
  3447. end
  3448.  
  3449. #--------------------------------------------------------------------------
  3450. # * Setup Actor
  3451. #--------------------------------------------------------------------------
  3452. def setup_actor
  3453. return if @actor == nil
  3454. @hp_number_refresh = true
  3455. @hp_number2_refresh = true
  3456. @hp_number_old = @actor.hp
  3457. @hp_number2_old = @actor.mhp
  3458. @hp_old_meter = 0
  3459. @mp_number_refresh = true
  3460. @mp_number2_refresh = true
  3461. @mp_number_old = @actor.mp
  3462. @mp_number2_old = @actor.mmp
  3463. @mp_old_meter = 0
  3464. @tp_number_refresh = true
  3465. @tp_number2_refresh = true
  3466. @tp_number_old = @actor.tp
  3467. @tp_number2_old = @actor.max_tp
  3468. @tp_old_meter = 0
  3469. @at_number_refresh = true
  3470. @at_number2_refresh = true
  3471. @at_number_old = actor_at
  3472. @at_number2_old = actor_max_at
  3473. @at_old_meter = 0
  3474. catb = ATB::MAX_AP rescue nil
  3475. @ccwinter_atb = true if catb != nil
  3476. end
  3477.  
  3478. #--------------------------------------------------------------------------
  3479. # * Terminate
  3480. #--------------------------------------------------------------------------
  3481. def terminate
  3482. @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
  3483. end
  3484.  
  3485. #--------------------------------------------------------------------------
  3486. # * AT
  3487. #--------------------------------------------------------------------------
  3488. def actor_at
  3489. return @actor.atb if $imported[:mog_atb_system]
  3490. return @actor.atb if $imported[:ve_active_time_battle]
  3491. return @actor.catb_value if $imported["YSA-CATB"]
  3492. return @actor.ap if @ccwinter_atb != nil
  3493. return 0
  3494. end
  3495.  
  3496. #--------------------------------------------------------------------------
  3497. # * Max AT
  3498. #--------------------------------------------------------------------------
  3499. def actor_max_at
  3500. return @actor.atb_max if $imported[:mog_atb_system]
  3501. return @actor.max_atb if $imported[:ve_active_time_battle]
  3502. return @actor.max_atb if $imported["YSA-CATB"]
  3503. return ATB::MAX_AP if @ccwinter_atb != nil
  3504. return 1
  3505. end
  3506.  
  3507. #--------------------------------------------------------------------------
  3508. # ● Actor Cast
  3509. #--------------------------------------------------------------------------
  3510. def actor_cast
  3511. return @actor.atb_cast[1] if $imported[:mog_atb_system]
  3512. return @actor.atb if $imported[:ve_active_time_battle]
  3513. return @actor.chant_count rescue 0 if @ccwinter_atb != nil
  3514. return 0
  3515. end
  3516.  
  3517. #--------------------------------------------------------------------------
  3518. # ● Actor Max Cast
  3519. #--------------------------------------------------------------------------
  3520. def actor_max_cast
  3521. if $imported[:mog_atb_system]
  3522. return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
  3523. return @actor.atb_cast[0].speed.abs
  3524. end
  3525. return @actor.max_atb if $imported[:ve_active_time_battle]
  3526. return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
  3527. return 1
  3528. end
  3529.  
  3530. #--------------------------------------------------------------------------
  3531. # ● Actor Cast?
  3532. #--------------------------------------------------------------------------
  3533. def actor_cast?
  3534. if $imported[:mog_atb_system]
  3535. return true if [email protected]_cast.empty?
  3536. end
  3537. if $imported[:ve_active_time_battle]
  3538. return true if @actor.cast_action?
  3539. end
  3540. if @ccwinter_atb
  3541. return true if @actor.chanting?
  3542. end
  3543. return false
  3544. end
  3545.  
  3546. #--------------------------------------------------------------------------
  3547. # * Create Sprites
  3548. #--------------------------------------------------------------------------
  3549. def create_sprites(viewport)
  3550. dispose
  3551. return if @actor == nil
  3552. create_layout(viewport)
  3553. create_layout_2(viewport)
  3554. create_name(viewport)
  3555. create_face(viewport)
  3556. create_hp_number(viewport)
  3557. create_hp_number_max(viewport)
  3558. create_hp_meter(viewport)
  3559. create_hp_icon(viewport)
  3560. create_hp_icon_ex(viewport)
  3561. create_hp_icon_number(viewport)
  3562. create_mp_number(viewport)
  3563. create_mp_number_max(viewport)
  3564. create_mp_meter(viewport)
  3565. create_mp_icon(viewport)
  3566. create_mp_icon_ex(viewport)
  3567. create_mp_icon_number(viewport)
  3568. create_tp_number(viewport)
  3569. create_tp_number_max(viewport)
  3570. create_tp_meter(viewport)
  3571. create_tp_icon(viewport)
  3572. create_tp_icon_ex(viewport)
  3573. create_tp_icon_number(viewport)
  3574. create_at_number(viewport)
  3575. create_at_number_max(viewport)
  3576. create_at_meter(viewport)
  3577. create_level_number(viewport)
  3578. create_states(viewport)
  3579. update
  3580. end
  3581.  
  3582. #--------------------------------------------------------------------------
  3583. # * Sprite Visible
  3584. #--------------------------------------------------------------------------
  3585. def sprite_visible?
  3586. return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
  3587. return false if !$game_temp.battle_hud_visible
  3588. return false if !$game_temp.sprite_visible
  3589. return true
  3590. end
  3591.  
  3592. #--------------------------------------------------------------------------
  3593. # * Sprite Visible
  3594. #--------------------------------------------------------------------------
  3595. def sprite_visible(sprite)
  3596. if @sprite_visible
  3597. sprite.opacity += 5 unless @sprite_visitle_wait > 0
  3598. else
  3599. sprite.opacity -= 10 ; @sprite_visitle_wait = 5
  3600. end
  3601. end
  3602.  
  3603. end
  3604.  
  3605. #==============================================================================
  3606. #==============================================================================
  3607. # ** Battle Hud EX
  3608. #==============================================================================
  3609. #==============================================================================
  3610. class Battle_Hud_EX
  3611.  
  3612. #--------------------------------------------------------------------------
  3613. # * Setup Position
  3614. #--------------------------------------------------------------------------
  3615. def setup_position
  3616. sprite_width = (Graphics.width - 64) / 4
  3617. sprite_center = sprite_width / 2
  3618. if $game_party.battle_members.size > 4
  3619. members = $game_party.battle_members.size - 4
  3620. fx = 32 * members
  3621. else
  3622. fx = 0
  3623. end
  3624. space_x = MEMBERS_SPACE[0] - fx
  3625. space_y = MEMBERS_SPACE[1]
  3626. center = Graphics.width / 2
  3627. members_space = (Graphics.width + space_x) / @max_members
  3628. members_space2 = (members_space * @actor_index)
  3629. members_space3 = ((members_space / 2) * (@max_members - 1))
  3630. members_space_y = space_y * @actor_index
  3631. x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
  3632. screen_resize_y = 0
  3633. screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
  3634. y = HUD_POSITION[1] + members_space_y + screen_resize_y
  3635. @hud_position = [x,y]
  3636. $game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
  3637. $game_temp.hud_pos_real[@actor_index] = [x,y]
  3638. x2 = x + sprite_center
  3639. $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3640. $game_temp.hud_pos[@actor_index] = [x2,y]
  3641. if FIXED_HUD_POSITION[@actor_index] != nil
  3642. @hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
  3643. $game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
  3644. $game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
  3645. $game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]
  3646. end
  3647. end
  3648.  
  3649. end
  3650.  
  3651. #==============================================================================
  3652. # ** Game Temp
  3653. #==============================================================================
  3654. class Game_Temp
  3655.  
  3656. attr_accessor :cache_bhud_sprites
  3657.  
  3658. #--------------------------------------------------------------------------
  3659. # * Cache Battle Hud
  3660. #--------------------------------------------------------------------------
  3661. def cache_battle_hud
  3662. execute_cache_bhud_sprites if @cache_bhud_sprites == nil
  3663. end
  3664.  
  3665. #--------------------------------------------------------------------------
  3666. # * Execute Cache Bhud Sprites
  3667. #--------------------------------------------------------------------------
  3668. def execute_cache_bhud_sprites
  3669. @cache_bhud_sprites = []
  3670. windows = ["Layout_Command","Layout_Party","Layout_Help",
  3671. "Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
  3672. "Layout_Item"]
  3673. for s in windows
  3674. @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3675. end
  3676. sprites = ["Layout","Layout_2",
  3677. "MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
  3678. "TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",
  3679. "AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",
  3680. "LV_Number","Turn","Iconset","Layout_Screen"
  3681. ]
  3682. for s in sprites
  3683. @cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
  3684. end
  3685. end
  3686.  
  3687. end
  3688.  
  3689. #==============================================================================
  3690. # ** Spriteset_Map
  3691. #==============================================================================
  3692. class Spriteset_Map
  3693.  
  3694. #--------------------------------------------------------------------------
  3695. # * Initialize
  3696. #--------------------------------------------------------------------------
  3697. alias mog_monogatari_bhud_initialize initialize
  3698. def initialize
  3699. $game_temp.cache_battle_hud
  3700. mog_monogatari_bhud_initialize
  3701. end
  3702.  
  3703. end
  3704.  
  3705. #==============================================================================
  3706. #==============================================================================
  3707. # ** Battle Hud EX
  3708. #==============================================================================
  3709. #==============================================================================
  3710. class Battle_Hud_EX
  3711.  
  3712. #--------------------------------------------------------------------------
  3713. # * Pre Cache
  3714. #--------------------------------------------------------------------------
  3715. def pre_cache
  3716. $game_temp.cache_battle_hud
  3717. @force_hide = false
  3718. @force_hide_time = 0
  3719. @fade_hud = false
  3720. @fade_hud_gold = false
  3721. @fade_hud_equip = false
  3722. @layout_image = Cache.battle_hud("Layout")
  3723. @layout_cw = @layout_image.width
  3724. @layout_ch = @layout_image.height
  3725. @layout2_image = Cache.battle_hud("Layout_2") rescue nil
  3726. @layout2_cw = @layout2_image.width if @layout2_image != nil
  3727. @layout2_ch = @layout2_image.height if @layout2_image != nil
  3728. @layout2_cw = 0 if @layout2_cw == nil
  3729. #------------------------------------------------
  3730. # HP
  3731. #------------------------------------------------
  3732. if HP_NUMBER_VISIBLE
  3733. @hp_number_image = Cache.battle_hud("HP_Number")
  3734. @hp_number_cw = @hp_number_image.width / 10
  3735. if HP_NUMBER_LOW_COLOR
  3736. @hp_number_ch = @hp_number_image.height / 2
  3737. else
  3738. @hp_number_ch = @hp_number_image.height
  3739. end
  3740. @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  3741. @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number
  3742. end
  3743. if HP_NUMBER_MAX_VISIBLE
  3744. @hp_number2_image = Cache.battle_hud("Max_HP_Number")
  3745. @hp_number2_cw = @hp_number2_image.width / 10
  3746. @hp_number2_ch = @hp_number2_image.height
  3747. end
  3748. if HP_METER_VISIBLE
  3749. @hp_meter_image = Cache.battle_hud("HP_Meter")
  3750. if HP_METER_GRADIENT_ANIMATION
  3751. @hp_meter_cw = @hp_meter_image.width / 3
  3752. else
  3753. @hp_meter_cw = @hp_meter_image.width
  3754. end
  3755. if HP_METER_REDUCTION_ANIMATION
  3756. @hp_meter_ch = @hp_meter_image.height / 2
  3757. else
  3758. @hp_meter_ch = @hp_meter_image.height
  3759. end
  3760. end
  3761. if HP_ICON_VISIBLE
  3762. @hp_icon_image = Cache.battle_hud("HP_Icon")
  3763. @hp_icon_cw = @hp_icon_image.width / 2
  3764. @hp_icon_ch = @hp_icon_image.height
  3765. end
  3766. if HP_ICON_EX_VISIBLE
  3767. @hp_icon2_image = Cache.battle_hud("HP_Icon_EX")
  3768. @hp_icon2_cw = @hp_icon2_image.width
  3769. @hp_icon2_ch = @hp_icon2_image.height
  3770. end
  3771. if HP_ICON_NUMBER_VISIBLE
  3772. @hp_icon_number_image = Cache.battle_hud("HP_Icon_Number")
  3773. @hp_icon_number_cw = @hp_icon_number_image.width / 10
  3774. @hp_icon_number_ch = @hp_icon_number_image.height
  3775. end
  3776. #------------------------------------------------
  3777. # MP
  3778. #------------------------------------------------
  3779. if MP_NUMBER_VISIBLE
  3780. @mp_number_image = Cache.battle_hud("MP_Number")
  3781. @mp_number_cw = @mp_number_image.width / 10
  3782. if MP_NUMBER_LOW_COLOR
  3783. @mp_number_ch = @mp_number_image.height / 2
  3784. else
  3785. @mp_number_ch = @mp_number_image.height
  3786. end
  3787. @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  3788. @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  3789. end
  3790. if MP_NUMBER_MAX_VISIBLE
  3791. @mp_number2_image = Cache.battle_hud("Max_MP_Number")
  3792. @mp_number2_cw = @mp_number2_image.width / 10
  3793. @mp_number2_ch = @mp_number2_image.height
  3794. end
  3795. if MP_METER_VISIBLE
  3796. @mp_meter_image = Cache.battle_hud("MP_Meter")
  3797. if MP_METER_GRADIENT_ANIMATION
  3798. @mp_meter_cw = @mp_meter_image.width / 3
  3799. else
  3800. @mp_meter_cw = @mp_meter_image.width
  3801. end
  3802. if MP_METER_REDUCTION_ANIMATION
  3803. @mp_meter_ch = @mp_meter_image.height / 2
  3804. else
  3805. @mp_meter_ch = @mp_meter_image.height
  3806. end
  3807. end
  3808. if MP_ICON_VISIBLE
  3809. @mp_icon_image = Cache.battle_hud("MP_Icon")
  3810. @mp_icon_cw = @mp_icon_image.width / 2
  3811. @mp_icon_ch = @mp_icon_image.height
  3812. end
  3813. if MP_ICON_EX_VISIBLE
  3814. @mp_icon2_image = Cache.battle_hud("MP_Icon_EX")
  3815. @mp_icon2_cw = @mp_icon2_image.width
  3816. @mp_icon2_ch = @mp_icon2_image.height
  3817. end
  3818. if MP_ICON_NUMBER_VISIBLE
  3819. @mp_icon_number_image = Cache.battle_hud("MP_Icon_Number")
  3820. @mp_icon_number_cw = @mp_icon_number_image.width / 10
  3821. @mp_icon_number_ch = @mp_icon_number_image.height
  3822. end
  3823. #------------------------------------------------
  3824. # TP
  3825. #------------------------------------------------
  3826. if TP_NUMBER_VISIBLE
  3827. @tp_number_image = Cache.battle_hud("TP_Number")
  3828. @tp_number_cw = @tp_number_image.width / 10
  3829. if TP_NUMBER_LOW_COLOR
  3830. @tp_number_ch = @tp_number_image.height / 2
  3831. else
  3832. @tp_number_ch = @tp_number_image.height
  3833. end
  3834. @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  3835. @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number
  3836. end
  3837. if TP_NUMBER_MAX_VISIBLE
  3838. @tp_number2_image = Cache.battle_hud("Max_TP_Number")
  3839. @tp_number2_cw = @tp_number2_image.width / 10
  3840. @tp_number2_ch = @tp_number2_image.height
  3841. end
  3842. if TP_METER_VISIBLE
  3843. @tp_meter_image = Cache.battle_hud("TP_Meter")
  3844. if TP_METER_GRADIENT_ANIMATION
  3845. @tp_meter_cw = @tp_meter_image.width / 3
  3846. else
  3847. @tp_meter_cw = @tp_meter_image.width
  3848. end
  3849. if TP_METER_REDUCTION_ANIMATION
  3850. @tp_meter_ch = @tp_meter_image.height / 2
  3851. else
  3852. @tp_meter_ch = @tp_meter_image.height
  3853. end
  3854. end
  3855. if TP_ICON_VISIBLE
  3856. @tp_icon_image = Cache.battle_hud("TP_Icon")
  3857. @tp_icon_cw = @tp_icon_image.width / 2
  3858. @tp_icon_ch = @tp_icon_image.height
  3859. end
  3860. if TP_ICON_EX_VISIBLE
  3861. @tp_icon2_image = Cache.battle_hud("TP_Icon_EX")
  3862. @tp_icon2_cw = @tp_icon2_image.width
  3863. @tp_icon2_ch = @tp_icon2_image.height
  3864. end
  3865. if TP_ICON_NUMBER_VISIBLE
  3866. @tp_icon_number_image = Cache.battle_hud("TP_Icon_Number")
  3867. @tp_icon_number_cw = @tp_icon_number_image.width / 10
  3868. @tp_icon_number_ch = @tp_icon_number_image.height
  3869. end
  3870. #------------------------------------------------
  3871. # AT
  3872. #------------------------------------------------
  3873. if AT_NUMBER_VISIBLE
  3874. @at_number_image = Cache.battle_hud("AT_Number")
  3875. @at_number_cw = @at_number_image.width / 10
  3876. @at_number_ch = @at_number_image.height
  3877. @at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
  3878. @at_number_ch += (@at_number_ch / 2) if @at_wave_number
  3879. end
  3880. if AT_NUMBER_MAX_VISIBLE
  3881. @at_number2_image = Cache.battle_hud("Max_AT_Number")
  3882. @at_number2_cw = @at_number2_image.width / 10
  3883. @at_number2_ch = @at_number2_image.height
  3884. end
  3885. if AT_METER_VISIBLE
  3886. @at_meter_image = Cache.battle_hud("AT_Meter")
  3887. if AT_METER_GRADIENT_ANIMATION
  3888. @at_meter_cw = @at_meter_image.width / 3
  3889. else
  3890. @at_meter_cw = @at_meter_image.width
  3891. end
  3892. @at_meter_ch = @at_meter_image.height / 3
  3893. end
  3894. #------------------------------------------------
  3895. # LV
  3896. #------------------------------------------------
  3897. if LEVEL_NUMBER_VISIBLE
  3898. @lv_number_image = Cache.battle_hud("LV_Number")
  3899. @lv_number_cw = @lv_number_image.width / 10
  3900. @lv_number_ch = @lv_number_image.height
  3901. end
  3902. #------------------------------------------------
  3903. # ICON
  3904. #------------------------------------------------
  3905. if STATES_VISIBLE or EQUIPMENT_VISIBLE
  3906. @icon_image = Cache.system("Iconset")
  3907. end
  3908. end
  3909.  
  3910. #--------------------------------------------------------------------------
  3911. # * Check Icon Image
  3912. #--------------------------------------------------------------------------
  3913. def check_icon_image
  3914. if @icon_image == nil or @icon_image.disposed?
  3915. @icon_image = Cache.system("Iconset")
  3916. end
  3917. end
  3918.  
  3919. end
  3920.  
  3921. #==============================================================================
  3922. #==============================================================================
  3923. # ** Battle Hud EX
  3924. #==============================================================================
  3925. #==============================================================================
  3926. class Battle_Hud_EX
  3927.  
  3928. #--------------------------------------------------------------------------
  3929. # * Update Number
  3930. #--------------------------------------------------------------------------
  3931. def update_number(type,value)
  3932. actor_value = @actor.hp if type == 0
  3933. actor_value = @actor.mp if type == 1
  3934. actor_value = @actor.tp if type == 2
  3935. actor_value = @actor.mhp if type == 3
  3936. actor_value = @actor.mmp if type == 4
  3937. actor_value = @actor.max_tp if type == 5
  3938. actor_value = actor_at if type == 6
  3939. actor_value = actor_max_at if type == 7
  3940. if value < actor_value
  3941. value += number_refresh_speed(actor_value,value)
  3942. value = actor_value if value >= actor_value
  3943. refresh_sprite_number(type,value)
  3944. elsif value > actor_value
  3945. value -= number_refresh_speed(actor_value,value)
  3946. value = actor_value if value <= actor_value
  3947. refresh_sprite_number(type,value)
  3948. end
  3949. end
  3950.  
  3951. #--------------------------------------------------------------------------
  3952. # * Number Refresh Speed
  3953. #--------------------------------------------------------------------------
  3954. def number_refresh_speed(actor_value,value)
  3955. n = 1 * (actor_value - value).abs / 10
  3956. return [[n, 99999999].min,1].max
  3957. end
  3958.  
  3959. #--------------------------------------------------------------------------
  3960. # * Update Number Fix
  3961. #--------------------------------------------------------------------------
  3962. def update_number_fix(type)
  3963. if type == 0
  3964. @hp_number_old = @actor.hp
  3965. @hp_number_refresh = true
  3966. elsif type == 1
  3967. @mp_number_old = @actor.mp
  3968. @mp_number_refresh = true
  3969. elsif type == 2
  3970. @tp_number_old = @actor.tp
  3971. @tp_number_refresh = true
  3972. elsif type == 3
  3973. @hp_number2_old = @actor.mhp
  3974. @hp_number2_refresh = true
  3975. elsif type == 4
  3976. @mp_number2_old = @actor.mmp
  3977. @mp_number2_refresh = true
  3978. elsif type == 5
  3979. @tp_number2_old = @actor.max_tp
  3980. @tp_number2_refresh = true
  3981. elsif type == 6
  3982. @at_number_old = actor_at
  3983. @at_number_refresh = true
  3984. elsif type == 7
  3985. @at_number2_old = actor_max_at
  3986. @at_number2_refresh = true
  3987. end
  3988. end
  3989.  
  3990. #--------------------------------------------------------------------------
  3991. # * Refresh Sprite Number
  3992. #--------------------------------------------------------------------------
  3993. def refresh_sprite_number(type,value)
  3994. @hp_number_refresh = true if type == 0
  3995. @hp_number_old = value if type == 0
  3996. @mp_number_refresh = true if type == 1
  3997. @mp_number_old = value if type == 1
  3998. @tp_number_refresh = true if type == 2
  3999. @tp_number_old = value if type == 2
  4000. @hp_number2_refresh = true if type == 3
  4001. @hp_number2_old = value if type == 3
  4002. @mp_number2_refresh = true if type == 4
  4003. @mp_number2_old = value if type == 4
  4004. @tp_number2_refresh = true if type == 5
  4005. @tp_number2_old = value if type == 5
  4006. @at_number_refresh = true if type == 6
  4007. @at_number_old = value if type == 6
  4008. @at_number2_refresh = true if type == 7
  4009. @at_number2_old = value if type == 7
  4010. end
  4011.  
  4012. #--------------------------------------------------------------------------
  4013. # * Refresh Number
  4014. #--------------------------------------------------------------------------
  4015. def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  4016. sprite.bitmap.clear
  4017. clear_number_refresh(type)
  4018. number_color = low_number_color(type,number_ch)
  4019. if type == 0 and HP_NUMBER_PERCENTAGE
  4020. value_max = @actor.mhp
  4021. value = value.to_f / value_max.to_f * 100
  4022. value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  4023. elsif type == 1 and MP_NUMBER_PERCENTAGE
  4024. value_max = @actor.mmp
  4025. value = value.to_f / value_max.to_f * 100
  4026. elsif type == 2 and TP_NUMBER_PERCENTAGE
  4027. value_max = @actor.max_tp
  4028. value = value.to_f / value_max.to_f * 100
  4029. elsif type == 3 and HP_NUMBER_PERCENTAGE
  4030. value = 100
  4031. elsif type == 4 and MP_NUMBER_PERCENTAGE
  4032. value = 100
  4033. elsif type == 5 and TP_NUMBER_PERCENTAGE
  4034. value = 100
  4035. elsif type == 6 and AT_NUMBER_PERCENTAGE
  4036. value_max = actor_max_at
  4037. value = value.to_f / value_max.to_f * 100
  4038. elsif type == 7 and AT_NUMBER_PERCENTAGE
  4039. value = 100
  4040. end
  4041. value = 9999999 if value > 9999999
  4042. number_value = value.truncate.abs.to_s.split(//)
  4043. wave_h = 0
  4044. wave_h2 = wave_number ? (number_ch / 3) : 0
  4045. wave_h3 = number_color != 0 ? wave_h2 : 0
  4046. for r in 0..number_value.size - 1
  4047. number_value_abs = number_value[r].to_i
  4048. wh = wave_h2 * wave_h
  4049. wh2 = wave_h == 0 ? wave_h2 : 0
  4050. nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  4051. sprite.bitmap.blt(number_cw * r, wh, image, nsrc_rect)
  4052. wave_h = wave_h == 0 ? 1 : 0
  4053. end
  4054. refresh_number_position(type,number_value.size,number_cw)
  4055. end
  4056.  
  4057. #--------------------------------------------------------------------------
  4058. # * Refresh Number
  4059. #--------------------------------------------------------------------------
  4060. def refresh_number_position(type,number_value,number_cw)
  4061. cx = number_value * number_cw
  4062. if type == 0
  4063. case HP_NUMBER_ALIGN_TYPE
  4064. when 0; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4065. when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  4066. when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
  4067. end
  4068. elsif type == 1
  4069. case MP_NUMBER_ALIGN_TYPE
  4070. when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4071. when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  4072. when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
  4073. end
  4074. elsif type == 2
  4075. case TP_NUMBER_ALIGN_TYPE
  4076. when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4077. when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
  4078. when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
  4079. end
  4080. elsif type == 3
  4081. case HP_NUMBER_ALIGN_TYPE
  4082. when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4083. when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4084. when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  4085. end
  4086. elsif type == 4
  4087. case MP_NUMBER_ALIGN_TYPE
  4088. when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4089. when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4090. when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  4091. end
  4092. elsif type == 5
  4093. case TP_NUMBER_ALIGN_TYPE
  4094. when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4095. when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  4096. when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  4097. end
  4098. elsif type == 6
  4099. case MP_NUMBER_ALIGN_TYPE
  4100. when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4101. when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4102. when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4103. end
  4104. elsif type == 7
  4105. case AT_NUMBER_ALIGN_TYPE
  4106. when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  4107. when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
  4108. when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
  4109. end
  4110. end
  4111. end
  4112.  
  4113. #--------------------------------------------------------------------------
  4114. # * Low Number Color
  4115. #--------------------------------------------------------------------------
  4116. def low_number_color(type,number_ch)
  4117. if type == 0
  4118. if HP_NUMBER_LOW_COLOR
  4119. return @actor.low_hp? ? number_ch : 0
  4120. else
  4121. return 0
  4122. end
  4123. elsif type == 1
  4124. if MP_NUMBER_LOW_COLOR
  4125. return @actor.low_mp? ? number_ch : 0
  4126. else
  4127. return 0
  4128. end
  4129. elsif type == 2
  4130. if TP_NUMBER_LOW_COLOR
  4131. return @actor.low_tp? ? number_ch : 0
  4132. else
  4133. return 0
  4134. end
  4135. else
  4136. return 0
  4137. end
  4138. end
  4139.  
  4140. #--------------------------------------------------------------------------
  4141. # * Clear Number Refresh
  4142. #--------------------------------------------------------------------------
  4143. def clear_number_refresh(type)
  4144. @hp_number_refresh = false if type == 0
  4145. @mp_number_refresh = false if type == 1
  4146. @tp_number_refresh = false if type == 2
  4147. @hp_number2_refresh = false if type == 3
  4148. @mp_number2_refresh = false if type == 4
  4149. @tp_number2_refresh = false if type == 5
  4150. @at_number_refresh = false if type == 6
  4151. @at_number2_refresh = false if type == 7
  4152. end
  4153.  
  4154. #--------------------------------------------------------------------------
  4155. # * Icon Limit
  4156. #--------------------------------------------------------------------------
  4157. def icon_limit(value,value_max)
  4158. n1 = value / value_max
  4159. n2 = value - (n1 * value_max)
  4160. n2 = value_max if (n2 == 0 and value > 0)
  4161. return n2
  4162. end
  4163.  
  4164. end
  4165.  
  4166. #==============================================================================
  4167. #==============================================================================
  4168. # ** Battle Hud EX
  4169. #==============================================================================
  4170. #==============================================================================
  4171. class Battle_Hud_EX
  4172.  
  4173. #--------------------------------------------------------------------------
  4174. # * Create Layout
  4175. #--------------------------------------------------------------------------
  4176. def create_layout(viewport)
  4177. @layout = Sprite.new
  4178. @layout.bitmap = @layout_image
  4179. @layout.z = HUD_Z
  4180. @layout.x = @hud_position[0]
  4181. @layout.y = @hud_position[1]
  4182. @layout.opacity = 0
  4183. @layout.viewport = viewport
  4184. end
  4185.  
  4186. #--------------------------------------------------------------------------
  4187. # * Update Layout
  4188. #--------------------------------------------------------------------------
  4189. def update_layout
  4190. return if @layout == nil
  4191. sprite_visible(@layout)
  4192. end
  4193.  
  4194. #--------------------------------------------------------------------------
  4195. # * Create Layout
  4196. #--------------------------------------------------------------------------
  4197. def create_layout_2(viewport)
  4198. return if !SECOND_LAYOUT
  4199. @layout2 = Sprite.new
  4200. @layout2.bitmap = @layout2_image
  4201. @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  4202. @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
  4203. @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
  4204. @layout2.opacity = 0
  4205. @layout2.viewport = viewport
  4206. end
  4207.  
  4208. #--------------------------------------------------------------------------
  4209. # * Update Layout
  4210. #--------------------------------------------------------------------------
  4211. def update_layout_2
  4212. return if @layout2 == nil
  4213. sprite_visible(@layout2)
  4214. end
  4215.  
  4216. end
  4217.  
  4218. #==============================================================================
  4219. #==============================================================================
  4220. # ** Battle Hud EX
  4221. #==============================================================================
  4222. #==============================================================================
  4223. class Battle_Hud_EX
  4224.  
  4225. #--------------------------------------------------------------------------
  4226. # * Create Name
  4227. #--------------------------------------------------------------------------
  4228. def create_name(viewport)
  4229. return if !NAME_VISIBLE
  4230. @name = Sprite.new
  4231. @name.bitmap = Bitmap.new(160,32)
  4232. @name.bitmap.font.size = NAME_FONT_SIZE
  4233. @name.bitmap.font.bold = NAME_FONT_BOLD
  4234. @name.bitmap.font.italic = NAME_FONT_ITALIC
  4235. @name.bitmap.font.color = NAME_FONT_COLOR
  4236. @name.z = HUD_Z + NAME_Z
  4237. @name.x = @hud_position[0] + NAME_POSITION[0]
  4238. @name.y = @hud_position[1] + NAME_POSITION[1]
  4239. @name.viewport = viewport
  4240. @name.opacity = 0
  4241. refresh_name
  4242. end
  4243.  
  4244. #--------------------------------------------------------------------------
  4245. # * Refresh Name
  4246. #--------------------------------------------------------------------------
  4247. def refresh_name
  4248. return if @name == nil
  4249. @name.bitmap.clear
  4250. if NAME_FONT_SHADOW
  4251. @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  4252. @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  4253. @name.bitmap.font.color = NAME_FONT_COLOR
  4254. end
  4255. @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  4256. end
  4257.  
  4258. #--------------------------------------------------------------------------
  4259. # * Update Name
  4260. #--------------------------------------------------------------------------
  4261. def update_name
  4262. return if @name == nil
  4263. sprite_visible(@name)
  4264. end
  4265.  
  4266. end
  4267.  
  4268. #==============================================================================
  4269. #==============================================================================
  4270. # ** Battle Hud EX
  4271. #==============================================================================
  4272. #==============================================================================
  4273. class Battle_Hud_EX
  4274.  
  4275. #--------------------------------------------------------------------------
  4276. # * Create HP Number
  4277. #--------------------------------------------------------------------------
  4278. def create_hp_number(viewport)
  4279. return if !HP_NUMBER_VISIBLE
  4280. @hp_number = Sprite.new
  4281. @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
  4282. @hp_number.z = HUD_Z + HP_NUMBER_Z
  4283. @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
  4284. @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
  4285. @hp_number.viewport = viewport
  4286. @hp_number.opacity = 0
  4287. end
  4288.  
  4289. #--------------------------------------------------------------------------
  4290. # * Create HP Number Max
  4291. #--------------------------------------------------------------------------
  4292. def create_hp_number_max(viewport)
  4293. return if !HP_NUMBER_MAX_VISIBLE
  4294. @hp_number2 = Sprite.new
  4295. @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
  4296. @hp_number2.z = HUD_Z + HP_NUMBER_Z
  4297. @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  4298. @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  4299. @hp_number2.viewport = viewport
  4300. @hp_number2.opacity = 0
  4301. end
  4302.  
  4303. #--------------------------------------------------------------------------
  4304. # * Create HP Meter
  4305. #--------------------------------------------------------------------------
  4306. def create_hp_meter(viewport)
  4307. return if !HP_METER_VISIBLE
  4308. @hp_flow_max = @hp_meter_cw * 2
  4309. @hp_flow = rand(@hp_flow_max)
  4310. @hp_meter = Sprite.new
  4311. @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  4312. @hp_meter.z = HUD_Z + HP_METER_Z
  4313. @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
  4314. @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
  4315. @hp_meter.angle = HP_METER_ANGLE
  4316. @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  4317. @hp_meter.viewport = viewport
  4318. @hp_meter.opacity = 0
  4319. end
  4320.  
  4321. #--------------------------------------------------------------------------
  4322. # ● Update Flow HP
  4323. #--------------------------------------------------------------------------
  4324. def update_flow_hp
  4325. @hp_meter.bitmap.clear
  4326. @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  4327. meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  4328. meter_width = 0 if meter_width == nil
  4329. execute_hp_damage_flow(meter_width)
  4330. meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  4331. @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)
  4332. @hp_flow += 1
  4333. @hp_flow = 0 if @hp_flow >= @hp_flow_max
  4334. end
  4335.  
  4336. #--------------------------------------------------------------------------
  4337. # ● Execute HP Damage Flow
  4338. #--------------------------------------------------------------------------
  4339. def execute_hp_damage_flow(meter_width)
  4340. return if !HP_METER_REDUCTION_ANIMATION
  4341. return if @hp_old_meter == meter_width
  4342. n = (@hp_old_meter - meter_width).abs * 3 / 100
  4343. damage_flow = [[n, 2].min,0.5].max
  4344. @hp_old_meter -= damage_flow
  4345. @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  4346. src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  4347. @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)
  4348. end
  4349.  
  4350. #--------------------------------------------------------------------------
  4351. # * Create HP Icon
  4352. #--------------------------------------------------------------------------
  4353. def create_hp_icon(viewport)
  4354. return if !HP_ICON_VISIBLE
  4355. @hp_icon = Sprite.new
  4356. icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  4357. icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  4358. @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4359. @hp_icon.z = HUD_Z + HP_ICON_Z
  4360. @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
  4361. @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
  4362. @hp_icon.viewport = viewport
  4363. @hp_icon.opacity = 0
  4364. end
  4365.  
  4366. #--------------------------------------------------------------------------
  4367. # * Refresh HP Icon
  4368. #--------------------------------------------------------------------------
  4369. def refresh_hp_icon
  4370. @hp_icon_old = @actor.hp
  4371. @hp_icon.bitmap.clear
  4372. max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  4373. if @actor.hp > max_value
  4374. icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  4375. else
  4376. icon_max = @actor.mhp
  4377. end
  4378. for i in 0...icon_max
  4379. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4380. 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)
  4381. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4382. i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  4383. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4384. end
  4385. icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  4386. rx = 0
  4387. ry = 0
  4388. for i in 0...icon_max
  4389. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  4390. 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)
  4391. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  4392. i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  4393. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  4394. end
  4395. refresh_hp_icon_ex(rx,ry)
  4396. end
  4397.  
  4398. #--------------------------------------------------------------------------
  4399. # * Create HP Icon EX
  4400. #--------------------------------------------------------------------------
  4401. def create_hp_icon_ex(viewport)
  4402. return if !HP_ICON_EX_VISIBLE
  4403. @hp_icon3_anime_phase = 0
  4404. @hp_icon3 = Sprite.new
  4405. @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  4406. @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  4407. @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  4408. @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  4409. @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  4410. @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  4411. @hp_icon3.x = @hp_icon3_org[0]
  4412. @hp_icon3.y = @hp_icon3_org[1]
  4413. @hp_icon3.viewport = viewport
  4414. @hp_icon3.opacity = 0
  4415. end
  4416.  
  4417. #--------------------------------------------------------------------------
  4418. # * Refresh HP Icon EX
  4419. #--------------------------------------------------------------------------
  4420. def refresh_hp_icon_ex(rx,ry)
  4421. return if @hp_icon3 == nil
  4422. @hp_icon3.bitmap.clear
  4423. return if @actor.hp == 0
  4424. i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  4425. @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  4426. @hp_icon3.x = @hp_icon3_org[0] + rx
  4427. @hp_icon3.y = @hp_icon3_org[1] + ry
  4428. end
  4429.  
  4430. #--------------------------------------------------------------------------
  4431. # * Update Icon HP EX Anime
  4432. #--------------------------------------------------------------------------
  4433. def update_icon_hp_ex_anime
  4434. return if !HP_ICON_EX_ZOOM_EFFECT
  4435. if @hp_icon3_anime_phase == 0
  4436. @hp_icon3.zoom_x += 0.01
  4437. if @hp_icon3.zoom_x >= 1.30
  4438. @hp_icon3.zoom_x = 1.30
  4439. @hp_icon3_anime_phase = 1
  4440. end
  4441. else
  4442. @hp_icon3.zoom_x -= 0.01
  4443. if @hp_icon3.zoom_x <= 1.05
  4444. @hp_icon3.zoom_x = 1.05
  4445. @hp_icon3_anime_phase = 0
  4446. end
  4447. end
  4448. @hp_icon3.zoom_y = @hp_icon3.zoom_x
  4449. end
  4450.  
  4451. #--------------------------------------------------------------------------
  4452. # * Create HP Icon Nummber
  4453. #--------------------------------------------------------------------------
  4454. def create_hp_icon_number(viewport)
  4455. return if !HP_ICON_NUMBER_VISIBLE
  4456. @hp_icon_number_old = [-1,-1]
  4457. @hp_icon_number = Sprite.new
  4458. @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  4459. @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  4460. @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4461. @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  4462. @hp_icon_number.viewport = viewport
  4463. @hp_icon_number.opacity = 0
  4464. end
  4465.  
  4466. #--------------------------------------------------------------------------
  4467. # * Refresh Icon Number HP
  4468. #--------------------------------------------------------------------------
  4469. def refresh_icon_number_hp
  4470. @hp_icon_number_old[0] = @actor.hp
  4471. @hp_icon_number_old[1] = @actor.mhp
  4472. @hp_icon_number.bitmap.clear
  4473. value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  4474. value = 0 if value < 0
  4475. number_value = value.truncate.abs.to_s.split(//)
  4476. for r in 0..number_value.size - 1
  4477. number_value_abs = number_value[r].to_i
  4478. nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  4479. @hp_icon_number.bitmap.blt(@hp_icon_number_cw * r, 0, @hp_icon_number_image, nsrc_rect)
  4480. end
  4481. cx = (number_value.size * @hp_icon_number_cw)
  4482. case HP_ICON_NUMBER_ALIGN_TYPE
  4483. when 0; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  4484. when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4485. when 2; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  4486. end
  4487. end
  4488.  
  4489. #--------------------------------------------------------------------------
  4490. # * Can Refresh Icon Number HP
  4491. #--------------------------------------------------------------------------
  4492. def can_refresh_icon_number_hp?
  4493. return true if @hp_icon_number_old[0] != @actor.hp
  4494. return true if @hp_icon_number_old[1] != @actor.mhp
  4495. return false
  4496. end
  4497.  
  4498. #--------------------------------------------------------------------------
  4499. # * Update HP
  4500. #--------------------------------------------------------------------------
  4501. def update_hp
  4502. if @hp_number != nil
  4503. if HP_NUMBER_ANIMATION
  4504. update_number(0,@hp_number_old)
  4505. else
  4506. update_number_fix(0) if @hp_number_old != @actor.hp
  4507. end
  4508. sprite_visible(@hp_number)
  4509. refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  4510. end
  4511. if @hp_number2 != nil
  4512. if HP_NUMBER_ANIMATION
  4513. update_number(3,@hp_number2_old)
  4514. else
  4515. update_number_fix(3) if @hp_number2_old != @actor.mhp
  4516. end
  4517. refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  4518. sprite_visible(@hp_number2)
  4519. end
  4520. if @hp_meter != nil
  4521. sprite_visible(@hp_meter)
  4522. update_flow_hp
  4523. end
  4524. if @hp_icon != nil
  4525. sprite_visible(@hp_icon)
  4526. refresh_hp_icon if @hp_icon_old != @actor.hp
  4527. end
  4528. if @hp_icon3 != nil
  4529. sprite_visible(@hp_icon3)
  4530. update_icon_hp_ex_anime
  4531. end
  4532. if @hp_icon_number != nil
  4533. sprite_visible(@hp_icon_number)
  4534. refresh_icon_number_hp if can_refresh_icon_number_hp?
  4535. end
  4536. end
  4537.  
  4538. end
  4539.  
  4540. #==============================================================================
  4541. #==============================================================================
  4542. # ** Battle Hud EX
  4543. #==============================================================================
  4544. #==============================================================================
  4545. class Battle_Hud_EX
  4546.  
  4547. #--------------------------------------------------------------------------
  4548. # * Create MP Number
  4549. #--------------------------------------------------------------------------
  4550. def create_mp_number(viewport)
  4551. return if !MP_NUMBER_VISIBLE
  4552. @mp_number = Sprite.new
  4553. @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
  4554. @mp_number.z = HUD_Z + MP_NUMBER_Z
  4555. @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
  4556. @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
  4557. @mp_number.viewport = viewport
  4558. @mp_number.opacity = 0
  4559. end
  4560.  
  4561. #--------------------------------------------------------------------------
  4562. # * Create MP Number Max
  4563. #--------------------------------------------------------------------------
  4564. def create_mp_number_max(viewport)
  4565. return if !MP_NUMBER_MAX_VISIBLE
  4566. @mp_number2 = Sprite.new
  4567. @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
  4568. @mp_number2.z = HUD_Z + MP_NUMBER_Z
  4569. @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  4570. @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  4571. @mp_number2.viewport = viewport
  4572. @mp_number2.opacity = 0
  4573. end
  4574.  
  4575. #--------------------------------------------------------------------------
  4576. # * Create MP Meter
  4577. #--------------------------------------------------------------------------
  4578. def create_mp_meter(viewport)
  4579. return if !MP_METER_VISIBLE
  4580. @mp_flow_max = @mp_meter_cw * 2
  4581. @mp_flow = rand(@mp_flow_max)
  4582. @mp_meter = Sprite.new
  4583. @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  4584. @mp_meter.z = HUD_Z + MP_METER_Z
  4585. @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
  4586. @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
  4587. @mp_meter.angle = MP_METER_ANGLE
  4588. @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  4589. @mp_meter.viewport = viewport
  4590. @mp_meter.opacity = 0
  4591. end
  4592.  
  4593. #--------------------------------------------------------------------------
  4594. # ● Update Flow MP
  4595. #--------------------------------------------------------------------------
  4596. def update_flow_mp
  4597. @mp_meter.bitmap.clear
  4598. @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  4599. meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  4600. meter_width = 0 if meter_width == nil
  4601. execute_mp_damage_flow(meter_width)
  4602. meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  4603. @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)
  4604. @mp_flow += 1
  4605. @mp_flow = 0 if @mp_flow >= @mp_flow_max
  4606. end
  4607.  
  4608. #--------------------------------------------------------------------------
  4609. # ● Execute MP Damage Flow
  4610. #--------------------------------------------------------------------------
  4611. def execute_mp_damage_flow(meter_width)
  4612. return if !MP_METER_REDUCTION_ANIMATION
  4613. return if @mp_old_meter == meter_width
  4614. n = (@mp_old_meter - meter_width).abs * 3 / 100
  4615. damage_flow = [[n, 2].min,0.5].max
  4616. @mp_old_meter -= damage_flow
  4617. @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  4618. src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  4619. @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)
  4620. end
  4621.  
  4622. #--------------------------------------------------------------------------
  4623. # * Create MP Icon
  4624. #--------------------------------------------------------------------------
  4625. def create_mp_icon(viewport)
  4626. return if !MP_ICON_VISIBLE
  4627. @mp_icon = Sprite.new
  4628. icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  4629. icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  4630. @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4631. @mp_icon.z = HUD_Z + MP_ICON_Z
  4632. @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
  4633. @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
  4634. @mp_icon.viewport = viewport
  4635. @mp_icon.opacity = 0
  4636. end
  4637.  
  4638. #--------------------------------------------------------------------------
  4639. # * Refresh MP Icon
  4640. #--------------------------------------------------------------------------
  4641. def refresh_mp_icon
  4642. @mp_icon_old = @actor.mp
  4643. @mp_icon.bitmap.clear
  4644. max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  4645. if @actor.mp > max_value
  4646. icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  4647. else
  4648. icon_max = @actor.mmp
  4649. end
  4650. for i in 0...icon_max
  4651. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4652. 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)
  4653. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4654. i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  4655. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4656. end
  4657. icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  4658. rx = 0
  4659. ry = 0
  4660. for i in 0...icon_max
  4661. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  4662. 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)
  4663. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  4664. i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  4665. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  4666. end
  4667. refresh_mp_icon_ex(rx,ry)
  4668. end
  4669.  
  4670. #--------------------------------------------------------------------------
  4671. # * Create MP Icon EX
  4672. #--------------------------------------------------------------------------
  4673. def create_mp_icon_ex(viewport)
  4674. return if !MP_ICON_EX_VISIBLE
  4675. @mp_icon3_anime_phase = 0
  4676. @mp_icon3 = Sprite.new
  4677. @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  4678. @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  4679. @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  4680. @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  4681. @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  4682. @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  4683. @mp_icon3.x = @mp_icon3_org[0]
  4684. @mp_icon3.y = @mp_icon3_org[1]
  4685. @mp_icon3.viewport = viewport
  4686. @mp_icon3.opacity = 0
  4687. end
  4688.  
  4689. #--------------------------------------------------------------------------
  4690. # * Refresh MP Icon EX
  4691. #--------------------------------------------------------------------------
  4692. def refresh_mp_icon_ex(rx,ry)
  4693. return if @mp_icon3 == nil
  4694. @mp_icon3.bitmap.clear
  4695. return if @actor.mp == 0
  4696. i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  4697. @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  4698. @mp_icon3.x = @mp_icon3_org[0] + rx
  4699. @mp_icon3.y = @mp_icon3_org[1] + ry
  4700. end
  4701.  
  4702. #--------------------------------------------------------------------------
  4703. # * Update Icon MP EX Anime
  4704. #--------------------------------------------------------------------------
  4705. def update_icon_mp_ex_anime
  4706. return if !MP_ICON_EX_ZOOM_EFFECT
  4707. if @mp_icon3_anime_phase == 0
  4708. @mp_icon3.zoom_x += 0.01
  4709. if @mp_icon3.zoom_x >= 1.30
  4710. @mp_icon3.zoom_x = 1.30
  4711. @mp_icon3_anime_phase = 1
  4712. end
  4713. else
  4714. @mp_icon3.zoom_x -= 0.01
  4715. if @mp_icon3.zoom_x <= 1.05
  4716. @mp_icon3.zoom_x = 1.05
  4717. @mp_icon3_anime_phase = 0
  4718. end
  4719. end
  4720. @mp_icon3.zoom_y = @mp_icon3.zoom_x
  4721. end
  4722.  
  4723. #--------------------------------------------------------------------------
  4724. # * Create MP Icon Number
  4725. #--------------------------------------------------------------------------
  4726. def create_mp_icon_number(viewport)
  4727. return if !MP_ICON_NUMBER_VISIBLE
  4728. @mp_icon_number_old = [-1,-1]
  4729. @mp_icon_number = Sprite.new
  4730. @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  4731. @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  4732. @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4733. @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  4734. @mp_icon_number.viewport = viewport
  4735. @mp_icon_number.opacity = 0
  4736. end
  4737.  
  4738. #--------------------------------------------------------------------------
  4739. # * Refresh Icon Number MP
  4740. #--------------------------------------------------------------------------
  4741. def refresh_icon_number_mp
  4742. @mp_icon_number_old[0] = @actor.mp
  4743. @mp_icon_number_old[1] = @actor.mmp
  4744. @mp_icon_number.bitmap.clear
  4745. value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  4746. value = 0 if value < 0
  4747. number_value = value.truncate.abs.to_s.split(//)
  4748. for r in 0..number_value.size - 1
  4749. number_value_abs = number_value[r].to_i
  4750. nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  4751. @mp_icon_number.bitmap.blt(@mp_icon_number_cw * r, 0, @mp_icon_number_image, nsrc_rect)
  4752. end
  4753. cx = (number_value.size * @mp_icon_number_cw)
  4754. case MP_ICON_NUMBER_ALIGN_TYPE
  4755. when 0; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  4756. when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  4757. when 2; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  4758. end
  4759. end
  4760.  
  4761. #--------------------------------------------------------------------------
  4762. # * Can Refresh Icon Number MP
  4763. #--------------------------------------------------------------------------
  4764. def can_refresh_icon_number_mp?
  4765. return true if @mp_icon_number_old[0] != @actor.mp
  4766. return true if @mp_icon_number_old[1] != @actor.mmp
  4767. return false
  4768. end
  4769.  
  4770. #--------------------------------------------------------------------------
  4771. # * Update MP
  4772. #--------------------------------------------------------------------------
  4773. def update_mp
  4774. if @mp_number != nil
  4775. sprite_visible(@mp_number)
  4776. if MP_NUMBER_ANIMATION
  4777. update_number(1,@mp_number_old)
  4778. else
  4779. update_number_fix(1) if @mp_number_old != @actor.mp
  4780. end
  4781. refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  4782. end
  4783. if @mp_number2 != nil
  4784. sprite_visible(@mp_number2)
  4785. if MP_NUMBER_ANIMATION
  4786. update_number(4,@mp_number2_old)
  4787. else
  4788. update_number_fix(4) if @mp_number2_old != @actor.mmp
  4789. end
  4790. refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  4791. end
  4792. if @mp_meter != nil
  4793. sprite_visible(@mp_meter)
  4794. update_flow_mp
  4795. end
  4796. if @mp_icon != nil
  4797. sprite_visible(@mp_icon)
  4798. refresh_mp_icon if @mp_icon_old != @actor.mp
  4799. end
  4800. if @mp_icon3 != nil
  4801. sprite_visible(@mp_icon3)
  4802. update_icon_mp_ex_anime
  4803. end
  4804. if @mp_icon_number != nil
  4805. sprite_visible(@mp_icon_number)
  4806. refresh_icon_number_mp if can_refresh_icon_number_mp?
  4807. end
  4808. end
  4809.  
  4810. end
  4811.  
  4812. #==============================================================================
  4813. #==============================================================================
  4814. # ** Battle Hud EX
  4815. #==============================================================================
  4816. #==============================================================================
  4817. class Battle_Hud_EX
  4818.  
  4819. #--------------------------------------------------------------------------
  4820. # * Create TP Number
  4821. #--------------------------------------------------------------------------
  4822. def create_tp_number(viewport)
  4823. return if !TP_NUMBER_VISIBLE
  4824. @tp_number = Sprite.new
  4825. @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
  4826. @tp_number.z = HUD_Z + TP_NUMBER_Z
  4827. @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
  4828. @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
  4829. @tp_number.viewport = viewport
  4830. @tp_number.opacity = 0
  4831. end
  4832.  
  4833. #--------------------------------------------------------------------------
  4834. # * Create TP Number MAX
  4835. #--------------------------------------------------------------------------
  4836. def create_tp_number_max(viewport)
  4837. return if !TP_NUMBER_MAX_VISIBLE
  4838. @tp_number2 = Sprite.new
  4839. @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
  4840. @tp_number2.z = HUD_Z + TP_NUMBER_Z
  4841. @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  4842. @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  4843. @tp_number2.viewport = viewport
  4844. @tp_number2.opacity = 0
  4845. end
  4846.  
  4847. #--------------------------------------------------------------------------
  4848. # * Create TP Meter
  4849. #--------------------------------------------------------------------------
  4850. def create_tp_meter(viewport)
  4851. return if !TP_METER_VISIBLE
  4852. @tp_flow_max = @tp_meter_cw * 2
  4853. @tp_flow = rand(@tp_flow_max)
  4854. @tp_meter = Sprite.new
  4855. @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  4856. @tp_meter.z = HUD_Z + TP_METER_Z
  4857. @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
  4858. @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
  4859. @tp_meter.angle = TP_METER_ANGLE
  4860. @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  4861. @tp_meter.viewport = viewport
  4862. @tp_meter.opacity = 0
  4863. end
  4864.  
  4865. #--------------------------------------------------------------------------
  4866. # ● Update Flow TP
  4867. #--------------------------------------------------------------------------
  4868. def update_flow_tp
  4869. @tp_meter.bitmap.clear
  4870. @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  4871. meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil
  4872. meter_width = 0 if meter_width == nil
  4873. execute_tp_damage_flow(meter_width)
  4874. meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  4875. @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)
  4876. @tp_flow += 1
  4877. @tp_flow = 0 if @tp_flow >= @tp_flow_max
  4878. end
  4879.  
  4880. #--------------------------------------------------------------------------
  4881. # ● Execute TP Damage Flow
  4882. #--------------------------------------------------------------------------
  4883. def execute_tp_damage_flow(meter_width)
  4884. return if !TP_METER_REDUCTION_ANIMATION
  4885. return if @tp_old_meter == meter_width
  4886. n = (@tp_old_meter - meter_width).abs * 3 / 100
  4887. damage_flow = [[n, 2].min,0.5].max
  4888. @tp_old_meter -= damage_flow
  4889. @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  4890. src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  4891. @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)
  4892. end
  4893.  
  4894. #--------------------------------------------------------------------------
  4895. # * Create TP Icon
  4896. #--------------------------------------------------------------------------
  4897. def create_tp_icon(viewport)
  4898. return if !TP_ICON_VISIBLE
  4899. @tp_icon = Sprite.new
  4900. icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  4901. icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  4902. @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  4903. @tp_icon.z = HUD_Z + TP_ICON_Z
  4904. @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
  4905. @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
  4906. @tp_icon.viewport = viewport
  4907. @tp_icon.opacity = 0
  4908. end
  4909.  
  4910. #--------------------------------------------------------------------------
  4911. # * Refresh TP Icon
  4912. #--------------------------------------------------------------------------
  4913. def refresh_tp_icon
  4914. @tp_icon_old = @actor.tp
  4915. @tp_icon.bitmap.clear
  4916. max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  4917. if @actor.mp > max_value
  4918. icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  4919. else
  4920. icon_max = @actor.max_tp
  4921. end
  4922. for i in 0...icon_max
  4923. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4924. 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)
  4925. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4926. i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  4927. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4928. end
  4929. icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  4930. rx = 0
  4931. ry = 0
  4932. for i in 0...icon_max
  4933. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  4934. 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)
  4935. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  4936. i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  4937. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  4938. end
  4939. refresh_tp_icon_ex(rx,ry)
  4940. end
  4941.  
  4942. #--------------------------------------------------------------------------
  4943. # * Create TP Icon EX
  4944. #--------------------------------------------------------------------------
  4945. def create_tp_icon_ex(viewport)
  4946. return if !TP_ICON_EX_VISIBLE
  4947. @tp_icon3_anime_phase = 0
  4948. @tp_icon3 = Sprite.new
  4949. @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  4950. @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  4951. @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  4952. @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  4953. @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  4954. @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  4955. @tp_icon3.x = @tp_icon3_org[0]
  4956. @tp_icon3.y = @tp_icon3_org[1]
  4957. @tp_icon3.viewport = viewport
  4958. @tp_icon3.opacity = 0
  4959. end
  4960.  
  4961. #--------------------------------------------------------------------------
  4962. # * Refresh TP Icon EX
  4963. #--------------------------------------------------------------------------
  4964. def refresh_tp_icon_ex(rx,ry)
  4965. return if @tp_icon3 == nil
  4966. @tp_icon3.bitmap.clear
  4967. return if @actor.tp == 0
  4968. i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  4969. @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  4970. @tp_icon3.x = @tp_icon3_org[0] + rx
  4971. @tp_icon3.y = @tp_icon3_org[1] + ry
  4972. end
  4973.  
  4974. #--------------------------------------------------------------------------
  4975. # * Update Icon TP EX Anime
  4976. #--------------------------------------------------------------------------
  4977. def update_icon_tp_ex_anime
  4978. return if !MP_ICON_EX_ZOOM_EFFECT
  4979. if @tp_icon3_anime_phase == 0
  4980. @tp_icon3.zoom_x += 0.01
  4981. if @tp_icon3.zoom_x >= 1.30
  4982. @tp_icon3.zoom_x = 1.30
  4983. @tp_icon3_anime_phase = 1
  4984. end
  4985. else
  4986. @tp_icon3.zoom_x -= 0.01
  4987. if @tp_icon3.zoom_x <= 1.05
  4988. @tp_icon3.zoom_x = 1.05
  4989. @tp_icon3_anime_phase = 0
  4990. end
  4991. end
  4992. @tp_icon3.zoom_y = @tp_icon3.zoom_x
  4993. end
  4994.  
  4995. #--------------------------------------------------------------------------
  4996. # * Create HP Icon Number
  4997. #--------------------------------------------------------------------------
  4998. def create_tp_icon_number(viewport)
  4999. return if !TP_ICON_NUMBER_VISIBLE
  5000. @tp_icon_number_old = [-1,-1]
  5001. @tp_icon_number = Sprite.new
  5002. @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  5003. @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  5004. @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5005. @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  5006. @tp_icon_number.viewport = viewport
  5007. @tp_icon_number.opacity = 0
  5008. end
  5009.  
  5010. #--------------------------------------------------------------------------
  5011. # * Refresh Icon Number TP
  5012. #--------------------------------------------------------------------------
  5013. def refresh_icon_number_tp
  5014. @tp_icon_number_old[0] = @actor.tp
  5015. @tp_icon_number_old[1] = @actor.max_tp
  5016. @tp_icon_number.bitmap.clear
  5017. value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  5018. value = 0 if value < 0
  5019. number_value = value.truncate.abs.to_s.split(//)
  5020. for r in 0..number_value.size - 1
  5021. number_value_abs = number_value[r].to_i
  5022. nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  5023. @tp_icon_number.bitmap.blt(@tp_icon_number_cw * r, 0, @tp_icon_number_image, nsrc_rect)
  5024. end
  5025. cx = (number_value.size * @tp_icon_number_cw)
  5026. case TP_ICON_NUMBER_ALIGN_TYPE
  5027. when 0; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  5028. when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  5029. when 2; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  5030. end
  5031. end
  5032.  
  5033. #--------------------------------------------------------------------------
  5034. # * Can Refresh Icon Number TP
  5035. #--------------------------------------------------------------------------
  5036. def can_refresh_icon_number_tp?
  5037. return true if @tp_icon_number_old[0] != @actor.tp
  5038. return true if @tp_icon_number_old[1] != @actor.max_tp
  5039. return false
  5040. end
  5041.  
  5042. #--------------------------------------------------------------------------
  5043. # * Update TP
  5044. #--------------------------------------------------------------------------
  5045. def update_tp
  5046. if @tp_number != nil
  5047. sprite_visible(@tp_number)
  5048. if MP_NUMBER_ANIMATION
  5049. update_number(2,@tp_number_old)
  5050. else
  5051. update_number_fix(2) if @tp_number_old != @actor.tp
  5052. end
  5053. refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh
  5054. end
  5055. if @tp_number2 != nil
  5056. sprite_visible(@tp_number2)
  5057. if MP_NUMBER_ANIMATION
  5058. update_number(5,@tp_number2_old)
  5059. else
  5060. update_number_fix(5) if @tp_number2_old != @actor.max_tp
  5061. end
  5062. refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  5063. end
  5064. if @tp_meter != nil
  5065. sprite_visible(@tp_meter)
  5066. update_flow_tp
  5067. end
  5068. if @tp_icon != nil
  5069. sprite_visible(@tp_icon)
  5070. refresh_tp_icon if @tp_icon_old != @actor.tp
  5071. end
  5072. if @tp_icon3 != nil
  5073. sprite_visible(@tp_icon3)
  5074. update_icon_tp_ex_anime
  5075. end
  5076. if @tp_icon_number != nil
  5077. sprite_visible(@tp_icon_number)
  5078. refresh_icon_number_tp if can_refresh_icon_number_tp?
  5079. end
  5080. end
  5081.  
  5082. end
  5083.  
  5084. #==============================================================================
  5085. #==============================================================================
  5086. # ** Battle Hud EX
  5087. #==============================================================================
  5088. #==============================================================================
  5089. class Battle_Hud_EX
  5090.  
  5091. #--------------------------------------------------------------------------
  5092. # * Create AT Number
  5093. #--------------------------------------------------------------------------
  5094. def create_at_number(viewport)
  5095. return if !AT_NUMBER_VISIBLE
  5096. @at_number = Sprite.new
  5097. @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
  5098. @at_number.z = HUD_Z + AT_NUMBER_Z
  5099. @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
  5100. @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
  5101. @at_number.viewport = viewport
  5102. @at_number.opacity = 0
  5103. end
  5104.  
  5105. #--------------------------------------------------------------------------
  5106. # * Create AT Number Max
  5107. #--------------------------------------------------------------------------
  5108. def create_at_number_max(viewport)
  5109. return if !AT_NUMBER_MAX_VISIBLE
  5110. @at_number2 = Sprite.new
  5111. @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
  5112. @at_number2.z = HUD_Z + AT_NUMBER_Z
  5113. @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
  5114. @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
  5115. @at_number2.viewport = viewport
  5116. @at_number2.opacity = 0
  5117. end
  5118.  
  5119. #--------------------------------------------------------------------------
  5120. # * Create AT Meter
  5121. #--------------------------------------------------------------------------
  5122. def create_at_meter(viewport)
  5123. return if !AT_METER_VISIBLE
  5124. @at_flow_max = @at_meter_cw * 2
  5125. @at_flow = rand(@at_flow_max)
  5126. @at_meter = Sprite.new
  5127. @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
  5128. @at_meter.z = HUD_Z + AT_METER_Z
  5129. @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
  5130. @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
  5131. @at_meter.angle = AT_METER_ANGLE
  5132. @at_meter.mirror = AT_METER_MIRROR_EFFECT
  5133. @at_meter.viewport = viewport
  5134. @at_meter.opacity = 0
  5135. end
  5136.  
  5137. #--------------------------------------------------------------------------
  5138. # ● Update Flow AT
  5139. #--------------------------------------------------------------------------
  5140. def update_flow_at
  5141. @at_meter.bitmap.clear
  5142. @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
  5143. if actor_cast?
  5144. meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
  5145. meter_width = 0 if meter_width == nil
  5146. ch = @at_meter_ch * 2
  5147. else
  5148. meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
  5149. meter_width = 0 if meter_width == nil
  5150. ch = actor_at >= actor_max_at ? @at_meter_ch : 0
  5151. end
  5152. meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
  5153. @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)
  5154. @at_flow += 1
  5155. @at_flow = 0 if @at_flow >= @at_flow_max
  5156. end
  5157.  
  5158. #--------------------------------------------------------------------------
  5159. # * Update AT
  5160. #--------------------------------------------------------------------------
  5161. def update_at
  5162. if @at_number != nil
  5163. sprite_visible(@at_number)
  5164. if AT_NUMBER_ANIMATION
  5165. update_number(6,@at_number_old)
  5166. else
  5167. update_number_fix(6) if @at_number_old != actor_at
  5168. end
  5169. refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
  5170. end
  5171. if @at_number2 != nil
  5172. sprite_visible(@at_number2)
  5173. if AT_NUMBER_ANIMATION
  5174. update_number(7,@at_number2_old)
  5175. else
  5176. update_number_fix(7) if @at_number2_old != actor_max_at
  5177. end
  5178. refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
  5179. end
  5180. if @at_meter != nil
  5181. sprite_visible(@at_meter)
  5182. update_flow_at
  5183. end
  5184. end
  5185.  
  5186. end
  5187.  
  5188. #==============================================================================
  5189. #==============================================================================
  5190. # ** Battle Hud EX
  5191. #==============================================================================
  5192. #==============================================================================
  5193. class Battle_Hud_EX
  5194.  
  5195. #--------------------------------------------------------------------------
  5196. # * Create Level Number
  5197. #--------------------------------------------------------------------------
  5198. def create_level_number(viewport)
  5199. return if !LEVEL_NUMBER_VISIBLE
  5200. @old_level = -1
  5201. @lv_number = Sprite.new
  5202. @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  5203. @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  5204. @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5205. @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
  5206. @lv_number.viewport = viewport
  5207. @lv_number.opacity = 0
  5208. end
  5209.  
  5210. #--------------------------------------------------------------------------
  5211. # * Refresh Level Number
  5212. #--------------------------------------------------------------------------
  5213. def refresh_level_number
  5214. @lv_number.bitmap.clear
  5215. @old_level = @actor.level
  5216. number_value = @actor.level.abs.to_s.split(//)
  5217. for r in 0..number_value.size - 1
  5218. number_value_abs = number_value[r].to_i
  5219. nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  5220. @lv_number.bitmap.blt(@lv_number_cw * r, 0, @lv_number_image, nsrc_rect)
  5221. end
  5222. cx = (number_value.size * @lv_number_cw)
  5223. case LEVEL_NUMBER_ALIGN_TYPE
  5224. when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
  5225. when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  5226. when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  5227. end
  5228. end
  5229.  
  5230. #--------------------------------------------------------------------------
  5231. # * Update Level
  5232. #--------------------------------------------------------------------------
  5233. def update_level
  5234. return if @lv_number == nil
  5235. sprite_visible(@lv_number)
  5236. refresh_level_number if @old_level != @actor.level
  5237. end
  5238.  
  5239. end
  5240.  
  5241. #==============================================================================
  5242. #==============================================================================
  5243. # ** Battle Hud EX
  5244. #==============================================================================
  5245. #==============================================================================
  5246. class Battle_Hud_EX
  5247.  
  5248. #--------------------------------------------------------------------------
  5249. # * Create States
  5250. #--------------------------------------------------------------------------
  5251. def create_states(viewport)
  5252. return if !STATES_VISIBLE
  5253. @status_old = nil
  5254. @status_flow = [-24,0]
  5255. @status_size_real = 0
  5256. @status = Sprite.new
  5257. @status.bitmap = Bitmap.new(24,24)
  5258. @status.x = @hud_position[0] + STATES_POSITION[0]
  5259. @status.y = @hud_position[1] + STATES_POSITION[1]
  5260. @status.z = HUD_Z + STATES_Z
  5261. @status.angle = STATE_ANGLE
  5262. @status.viewport = viewport
  5263. @status.opacity = 0
  5264. end
  5265.  
  5266. #--------------------------------------------------------------------------
  5267. # * Refresh States
  5268. #--------------------------------------------------------------------------
  5269. def refresh_states
  5270. check_icon_image
  5271. @status_size_real = set_real_states_size
  5272. @status_old = @actor.states
  5273. @status_flow = [0,0]
  5274. @states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
  5275. @actor_status.dispose if @actor_status != nil
  5276. @actor_status = Bitmap.new(@states_size,24)
  5277. index = 0
  5278. for i in @actor.states
  5279. next if HIDE_STATES_ID.include?(i.id)
  5280. rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  5281. @actor_status.blt(26 * index , 0, @icon_image, rect)
  5282. index += 1
  5283. end
  5284. end
  5285.  
  5286. #--------------------------------------------------------------------------
  5287. # * Set Real States Size
  5288. #--------------------------------------------------------------------------
  5289. def set_real_states_size
  5290. n = 0
  5291. for i in @actor.states
  5292. next if HIDE_STATES_ID.include?(i.id)
  5293. n += 1
  5294. end
  5295. return n
  5296. end
  5297.  
  5298. #--------------------------------------------------------------------------
  5299. # * Flow_Status
  5300. #--------------------------------------------------------------------------
  5301. def flow_states
  5302. return if @actor_status == nil
  5303. @status.bitmap.clear
  5304. return if @actor.states.size == 0
  5305. st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  5306. @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  5307. if STATES_SCROLLING_ANIMATION
  5308. @status_flow[0] += 1
  5309. @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  5310. else
  5311. @status_flow[1] += 1 unless @actor.states.size <= 1
  5312. if @status_flow[1] > 30
  5313. @status_flow[1] = 0
  5314. @status_flow[0] += 26
  5315. @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  5316. end
  5317. end
  5318. end
  5319.  
  5320. #--------------------------------------------------------------------------
  5321. # * Update States
  5322. #--------------------------------------------------------------------------
  5323. def update_states
  5324. return if @status == nil
  5325. sprite_visible(@status)
  5326. refresh_states if @status_old != @actor.states
  5327. flow_states
  5328. end
  5329.  
  5330. end
  5331.  
  5332. #==============================================================================
  5333. #==============================================================================
  5334. # ** Battle Hud EX
  5335. #==============================================================================
  5336. #==============================================================================
  5337. class Battle_Hud_EX
  5338.  
  5339. #--------------------------------------------------------------------------
  5340. # * Create Face
  5341. #--------------------------------------------------------------------------
  5342. def create_face(viewport)
  5343. return if !FACE_VISIBLE
  5344. @face_old_hp = @actor.hp
  5345. @face_old_mp = @actor.mp
  5346. @face_old_tp = @actor.tp
  5347. @face_name = ""
  5348. @face = Sprite.new
  5349. @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
  5350. @face.x = @face_org[0]
  5351. @face.y = @face_org[1]
  5352. @face.z = HUD_Z + FACE_Z
  5353. @face.viewport = viewport
  5354. @face.opacity = 0
  5355. refresh_face_name
  5356. end
  5357.  
  5358. #--------------------------------------------------------------------------
  5359. # * Refresh Face Name
  5360. #--------------------------------------------------------------------------
  5361. def refresh_face_name
  5362. @face_image.dispose if @face_image != nil
  5363. @face.bitmap.dispose if @face.bitmap != nil
  5364. return if @actor == nil or @actor.id == nil
  5365. @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
  5366. @face_image = Bitmap.new(32,32) if @face_image == nil
  5367. @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
  5368. @face_ch = @face_image.height
  5369. @face.ox = @face_cw / 2
  5370. @face.oy = @face_ch / 2
  5371. @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  5372. @face_org = [@hud_position[0] + FACE_POSITION[0],
  5373. @hud_position[1] + @face.oy + FACE_POSITION[1]]
  5374. if $game_temp.battler_face_pos[@actor_index] == nil
  5375. $game_temp.battler_face_pos[@actor_index] = []
  5376. end
  5377. @face.x = @face_org[0]
  5378. @face.y = @face_org[1]
  5379. limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
  5380. fy = @face_org[1]
  5381. if limit_Y > Graphics.height
  5382. @face.y = Graphics.height - (@face_image.height - @face.oy)
  5383. fy = Graphics.height - 16
  5384. @face_org[1] = @face.y
  5385. end
  5386. $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
  5387. $game_temp.battler_face_pos[@actor_index][1] = fy
  5388. $game_temp.battler_face_pos[@actor_index][2] = @face.z
  5389. clear_face_index
  5390. end
  5391.  
  5392. #--------------------------------------------------------------------------
  5393. # * Refresh Face
  5394. #--------------------------------------------------------------------------
  5395. def refresh_face
  5396. @face.mirror = false
  5397. @face.zoom_x = 1.00
  5398. @face.zoom_y = 1.00
  5399. @face_index = @actor.face_animation[1]
  5400. @face.bitmap.clear
  5401. if !FACE_ANIMATION
  5402. f_scr = Rect.new(0,0,@face_cw,@face_ch)
  5403. else
  5404. f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  5405. end
  5406. @face.bitmap.blt(0,0,@face_image,f_scr)
  5407. end
  5408.  
  5409. #--------------------------------------------------------------------------
  5410. # * Update Face Duration
  5411. #--------------------------------------------------------------------------
  5412. def update_face_duration
  5413. return if @actor.face_animation[0] == 0
  5414. @actor.face_animation[0] -= 1
  5415. update_face_shake_effect
  5416. update_face_zoom if @actor.face_animation[1] == 2
  5417. return if @actor.face_animation[0] > 0
  5418. clear_face_index
  5419. end
  5420.  
  5421. #--------------------------------------------------------------------------
  5422. # * Clear Face Index
  5423. #--------------------------------------------------------------------------
  5424. def clear_face_index
  5425. @actor.face_animation[1] = @actor.low_hp? ? 3 : 0
  5426. @actor.face_animation[1] = 4 if @actor.dead?
  5427. refresh_face
  5428. end
  5429.  
  5430. #--------------------------------------------------------------------------
  5431. # * Update Face Zoom
  5432. #--------------------------------------------------------------------------
  5433. def update_face_zoom
  5434. return if !FACE_ZOOM_ANIMATION
  5435. case @actor.face_animation[0]
  5436. when 30..60
  5437. @face.zoom_x += 0.01
  5438. @face.zoom_x = 1.30 if @face.zoom_x > 1.30
  5439. @face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
  5440. when 1..29
  5441. @face.zoom_x -= 0.01
  5442. @face.zoom_x = 1.00 if @face.zoom_x < 1.00
  5443. @face.mirror = false
  5444. else
  5445. @face.zoom_x = 1.00
  5446. @face.mirror = false
  5447. end
  5448. @face.zoom_y = @face.zoom_x
  5449. end
  5450.  
  5451. #--------------------------------------------------------------------------
  5452. # * Can Refresh Index MP TP?
  5453. #--------------------------------------------------------------------------
  5454. def can_refresh_index_mp_tp?
  5455. return true if @face_old_mp != @actor.mp
  5456. return false
  5457. end
  5458.  
  5459. #--------------------------------------------------------------------------
  5460. # * Refresh Face Index HP
  5461. #--------------------------------------------------------------------------
  5462. def refresh_face_index_hp
  5463. @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5464. @actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
  5465. @face_old_hp = @actor.hp
  5466. end
  5467.  
  5468. #--------------------------------------------------------------------------
  5469. # * Refresh Face Index MP TP
  5470. #--------------------------------------------------------------------------
  5471. def refresh_face_index_mp_tp
  5472. if @face_old_mp < @actor.mp
  5473. @actor.face_animation[0] = FACE_ANIMATION_DURATION
  5474. @actor.face_animation[1] = 1
  5475. end
  5476. @face_old_mp = @actor.mp
  5477. @face_old_tp = @actor.tp
  5478. end
  5479.  
  5480. #--------------------------------------------------------------------------
  5481. # * Update Face Shake Effect
  5482. #--------------------------------------------------------------------------
  5483. def update_face_shake_effect
  5484. return if !FACE_SHAKE_EFFECT
  5485. if FACE_ANIMATION
  5486. update_shake_animated_face
  5487. else
  5488. update_shake_still_face
  5489. end
  5490. end
  5491.  
  5492. #--------------------------------------------------------------------------
  5493. # * Update Shake Still Effect Face
  5494. #--------------------------------------------------------------------------
  5495. def update_shake_still_face
  5496. if @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
  5497. @face.x = @face_org[0] - 4 + rand(8)
  5498. else
  5499. @face.x = @face_org[0]
  5500. end
  5501. end
  5502.  
  5503. #--------------------------------------------------------------------------
  5504. # * Update Shake Animated Face
  5505. #--------------------------------------------------------------------------
  5506. def update_shake_animated_face
  5507. if @actor.face_animation[0] == 0
  5508. @face.x = @face_org[0]
  5509. return
  5510. end
  5511. if @actor.face_animation[1] == 3 and @actor.hp > 0
  5512. @face.x = @face_org[0] - 4 + rand(8)
  5513. else
  5514. @face.x = @face_org[0]
  5515. end
  5516. end
  5517.  
  5518. #--------------------------------------------------------------------------
  5519. # * Update Face
  5520. #--------------------------------------------------------------------------
  5521. def update_face
  5522. return if @face == nil
  5523. sprite_visible(@face)
  5524. refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  5525. update_face_duration
  5526. return if !FACE_ANIMATION
  5527. refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  5528. refresh_face_index_hp if @face_old_hp != @actor.hp
  5529. refresh_face if @face_index != @actor.face_animation[1]
  5530. end
  5531.  
  5532. end
  5533.  
  5534. #==============================================================================
  5535. # ■ Battle Manager
  5536. #==============================================================================
  5537. class << BattleManager
  5538.  
  5539. #--------------------------------------------------------------------------
  5540. # ● Battle End
  5541. #--------------------------------------------------------------------------
  5542. alias mog_battle_hud_battle_process_victory process_victory
  5543. def process_victory
  5544. execute_face_effect_end
  5545. mog_battle_hud_battle_process_victory
  5546. end
  5547.  
  5548. #--------------------------------------------------------------------------
  5549. # ● Execute Face Effect End
  5550. #--------------------------------------------------------------------------
  5551. def execute_face_effect_end
  5552. $game_temp.battle_end = true
  5553. for i in $game_party.members
  5554. i.face_animation = [120,1,0] if i.hp > 0
  5555. end
  5556. end
  5557.  
  5558. #--------------------------------------------------------------------------
  5559. # * Display EXP Earned
  5560. #--------------------------------------------------------------------------
  5561. alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
  5562. def process_defeat
  5563. $game_temp.battle_end = true
  5564. mog_battle_hud_ex_message_battle_process_defeat
  5565. end
  5566.  
  5567. #--------------------------------------------------------------------------
  5568. # * Process Abort
  5569. #--------------------------------------------------------------------------
  5570. alias mog_battle_hud_ex_process_abort process_abort
  5571. def process_abort
  5572. $game_temp.battle_end = true
  5573. mog_battle_hud_ex_process_abort
  5574. end
  5575.  
  5576. end
  5577.  
  5578. #==============================================================================
  5579. # ** Scene Battle
  5580. #==============================================================================
  5581. class Scene_Battle < Scene_Base
  5582.  
  5583. #--------------------------------------------------------------------------
  5584. # * Use Item
  5585. #--------------------------------------------------------------------------
  5586. alias mog_monogatari_use_item use_item
  5587. def use_item
  5588. execute_face_animation
  5589. mog_monogatari_use_item
  5590. end
  5591.  
  5592. #--------------------------------------------------------------------------
  5593. # * Execute Face Animation
  5594. #--------------------------------------------------------------------------
  5595. def execute_face_animation
  5596. return if @subject.is_a?(Game_Enemy)
  5597. @subject.face_animation = [60 ,2,0]
  5598. end
  5599.  
  5600. end
  5601.  
  5602. #==============================================================================
  5603. #==============================================================================
  5604. # ** Battle Hud EX
  5605. #==============================================================================
  5606. #==============================================================================
  5607. class Battle_Hud_EX
  5608.  
  5609. #--------------------------------------------------------------------------
  5610. # * Dispose
  5611. #--------------------------------------------------------------------------
  5612. def dispose
  5613. terminate
  5614. dispose_layout
  5615. dispose_layout_2
  5616. dispose_name
  5617. dispose_face
  5618. dispose_hp_number
  5619. dispose_hp_number_max
  5620. dispose_hp_meter
  5621. dispose_hp_icon
  5622. dispose_hp_icon_ex
  5623. dispose_hp_icon_number
  5624. dispose_mp_number
  5625. dispose_mp_number_max
  5626. dispose_mp_meter
  5627. dispose_mp_icon
  5628. dispose_mp_icon_ex
  5629. dispose_mp_icon_number
  5630. dispose_tp_number
  5631. dispose_tp_number_max
  5632. dispose_tp_meter
  5633. dispose_tp_icon
  5634. dispose_tp_icon_ex
  5635. dispose_tp_icon_number
  5636. dispose_at_number
  5637. dispose_at_number_max
  5638. dispose_at_meter
  5639. dispose_lv_number
  5640. dispose_states
  5641. end
  5642.  
  5643. #--------------------------------------------------------------------------
  5644. # * Dispose Layout
  5645. #--------------------------------------------------------------------------
  5646. def dispose_layout
  5647. return if @layout == nil
  5648. @layout.dispose
  5649. @layout = nil
  5650. end
  5651.  
  5652. #--------------------------------------------------------------------------
  5653. # * Dispose Layout 2
  5654. #--------------------------------------------------------------------------
  5655. def dispose_layout_2
  5656. return if @layout2 == nil
  5657. @layout2.dispose
  5658. @layout2 = nil
  5659. end
  5660.  
  5661. #--------------------------------------------------------------------------
  5662. # * Dispose Name
  5663. #--------------------------------------------------------------------------
  5664. def dispose_name
  5665. return if @name == nil
  5666. @name.bitmap.dispose
  5667. @name.dispose
  5668. @name = nil
  5669. end
  5670.  
  5671. #--------------------------------------------------------------------------
  5672. # * Dispose Face
  5673. #--------------------------------------------------------------------------
  5674. def dispose_face
  5675. return if @face == nil
  5676. @face.bitmap.dispose if @face.bitmap != nil
  5677. @face.dispose
  5678. @face = nil
  5679. @face_image.dispose if @face_image != nil
  5680. end
  5681.  
  5682. #--------------------------------------------------------------------------
  5683. # * Dispose HP Number
  5684. #--------------------------------------------------------------------------
  5685. def dispose_hp_number
  5686. return if @hp_number == nil
  5687. @hp_number.bitmap.dispose
  5688. @hp_number.dispose
  5689. @hp_number = nil
  5690. end
  5691.  
  5692. #--------------------------------------------------------------------------
  5693. # * Dispose HP Number Max
  5694. #--------------------------------------------------------------------------
  5695. def dispose_hp_number_max
  5696. return if @hp_number2 == nil
  5697. @hp_number2.bitmap.dispose
  5698. @hp_number2.dispose
  5699. @hp_number2 = nil
  5700. end
  5701.  
  5702. #--------------------------------------------------------------------------
  5703. # * Dispose HP Meter
  5704. #--------------------------------------------------------------------------
  5705. def dispose_hp_meter
  5706. return if @hp_meter == nil
  5707. @hp_meter.bitmap.dispose
  5708. @hp_meter.dispose
  5709. @hp_meter = nil
  5710. end
  5711.  
  5712. #--------------------------------------------------------------------------
  5713. # * Dispose HP Icon
  5714. #--------------------------------------------------------------------------
  5715. def dispose_hp_icon
  5716. return if @hp_icon == nil
  5717. @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  5718. @hp_icon.dispose
  5719. @hp_icon = nil
  5720. end
  5721.  
  5722. #--------------------------------------------------------------------------
  5723. # * Dispose HP Icon EX
  5724. #--------------------------------------------------------------------------
  5725. def dispose_hp_icon_ex
  5726. return if @hp_icon3 == nil
  5727. @hp_icon3.bitmap.dispose
  5728. @hp_icon3.dispose
  5729. @hp_icon3 = nil
  5730. end
  5731.  
  5732. #--------------------------------------------------------------------------
  5733. # * Dispose HP Icon Number
  5734. #--------------------------------------------------------------------------
  5735. def dispose_hp_icon_number
  5736. return if @hp_icon_number == nil
  5737. @hp_icon_number.bitmap.dispose
  5738. @hp_icon_number.dispose
  5739. @hp_icon_number = nil
  5740. end
  5741.  
  5742. #--------------------------------------------------------------------------
  5743. # * Dispose MP Number
  5744. #--------------------------------------------------------------------------
  5745. def dispose_mp_number
  5746. return if @mp_number == nil
  5747. @mp_number.bitmap.dispose
  5748. @mp_number.dispose
  5749. @mp_number = nil
  5750. end
  5751.  
  5752. #--------------------------------------------------------------------------
  5753. # * Dispose MP Number Max
  5754. #--------------------------------------------------------------------------
  5755. def dispose_mp_number_max
  5756. return if @mp_number2 == nil
  5757. @mp_number2.bitmap.dispose
  5758. @mp_number2.dispose
  5759. @mp_number2 = nil
  5760. end
  5761.  
  5762. #--------------------------------------------------------------------------
  5763. # * Dispose MP Meter
  5764. #--------------------------------------------------------------------------
  5765. def dispose_mp_meter
  5766. return if @mp_meter == nil
  5767. @mp_meter.bitmap.dispose
  5768. @mp_meter.dispose
  5769. @mp_meter = nil
  5770. end
  5771.  
  5772. #--------------------------------------------------------------------------
  5773. # * Dispose MP Icon
  5774. #--------------------------------------------------------------------------
  5775. def dispose_mp_icon
  5776. return if @mp_icon == nil
  5777. @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  5778. @mp_icon.dispose
  5779. @mp_icon = nil
  5780. end
  5781.  
  5782. #--------------------------------------------------------------------------
  5783. # * Dispose MP Icon EX
  5784. #--------------------------------------------------------------------------
  5785. def dispose_mp_icon_ex
  5786. return if @mp_icon3 == nil
  5787. @mp_icon3.bitmap.dispose
  5788. @mp_icon3.dispose
  5789. @mp_icon3 = nil
  5790. end
  5791.  
  5792. #--------------------------------------------------------------------------
  5793. # * Dispose MP Icon Number
  5794. #--------------------------------------------------------------------------
  5795. def dispose_mp_icon_number
  5796. return if @mp_icon_number == nil
  5797. @mp_icon_number.bitmap.dispose
  5798. @mp_icon_number.dispose
  5799. @mp_icon_number = nil
  5800. end
  5801.  
  5802. #--------------------------------------------------------------------------
  5803. # * Dispose TP Number
  5804. #--------------------------------------------------------------------------
  5805. def dispose_tp_number
  5806. return if @tp_number == nil
  5807. @tp_number.bitmap.dispose
  5808. @tp_number.dispose
  5809. @tp_number = nil
  5810. end
  5811.  
  5812. #--------------------------------------------------------------------------
  5813. # * Dispose TP Number Max
  5814. #--------------------------------------------------------------------------
  5815. def dispose_tp_number_max
  5816. return if @tp_number2 == nil
  5817. @tp_number2.bitmap.dispose
  5818. @tp_number2.dispose
  5819. @tp_number2 = nil
  5820. end
  5821.  
  5822. #--------------------------------------------------------------------------
  5823. # * Dispose TP Meter
  5824. #--------------------------------------------------------------------------
  5825. def dispose_tp_meter
  5826. return if @tp_meter == nil
  5827. @tp_meter.bitmap.dispose
  5828. @tp_meter.dispose
  5829. @tp_meter = nil
  5830. end
  5831.  
  5832. #--------------------------------------------------------------------------
  5833. # * Dispose TP Icon
  5834. #--------------------------------------------------------------------------
  5835. def dispose_tp_icon
  5836. return if @tp_icon == nil
  5837. @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  5838. @tp_icon.dispose
  5839. @tp_icon = nil
  5840. end
  5841.  
  5842. #--------------------------------------------------------------------------
  5843. # * Dispose TP Icon EX
  5844. #--------------------------------------------------------------------------
  5845. def dispose_tp_icon_ex
  5846. return if @tp_icon3 == nil
  5847. @tp_icon3.bitmap.dispose
  5848. @tp_icon3.dispose
  5849. @tp_icon3 = nil
  5850. end
  5851.  
  5852. #--------------------------------------------------------------------------
  5853. # * Dispose TP Icon Number
  5854. #--------------------------------------------------------------------------
  5855. def dispose_tp_icon_number
  5856. return if @tp_icon_number == nil
  5857. @tp_icon_number.bitmap.dispose
  5858. @tp_icon_number.dispose
  5859. @tp_icon_numbe = nil
  5860. end
  5861.  
  5862. #--------------------------------------------------------------------------
  5863. # * Dispose AT Number
  5864. #--------------------------------------------------------------------------
  5865. def dispose_at_number
  5866. return if @at_number == nil
  5867. @at_number.bitmap.dispose
  5868. @at_number.dispose
  5869. @at_number = nil
  5870. end
  5871.  
  5872. #--------------------------------------------------------------------------
  5873. # * Dispose AT Number Max
  5874. #--------------------------------------------------------------------------
  5875. def dispose_at_number_max
  5876. return if @at_number2 == nil
  5877. @at_number2.bitmap.dispose
  5878. @at_number2.dispose
  5879. @at_number2 = nil
  5880. end
  5881.  
  5882. #--------------------------------------------------------------------------
  5883. # * Dispose AT Meter
  5884. #--------------------------------------------------------------------------
  5885. def dispose_at_meter
  5886. return if @at_meter == nil
  5887. @at_meter.bitmap.dispose
  5888. @at_meter.dispose
  5889. @at_meter = nil
  5890. end
  5891.  
  5892. #--------------------------------------------------------------------------
  5893. # * Dispose Lv Number
  5894. #--------------------------------------------------------------------------
  5895. def dispose_lv_number
  5896. return if @lv_number == nil
  5897. @lv_number.bitmap.dispose
  5898. @lv_number.dispose
  5899. @lv_number = nil
  5900. end
  5901.  
  5902. #--------------------------------------------------------------------------
  5903. # * Dispose States
  5904. #--------------------------------------------------------------------------
  5905. def dispose_states
  5906. return if @status == nil
  5907. @status.bitmap.dispose if @status.bitmap != nil
  5908. @status.dispose
  5909. @actor_status.dispose if @actor_status != nil
  5910. @status = nil
  5911. end
  5912.  
  5913. end
  5914.  
  5915. #==============================================================================
  5916. #==============================================================================
  5917. # ** Battle Hud EX
  5918. #==============================================================================
  5919. #==============================================================================
  5920. class Battle_Hud_EX
  5921.  
  5922. #--------------------------------------------------------------------------
  5923. # * Refresh Visible
  5924. #--------------------------------------------------------------------------
  5925. def refresh_visible(vis)
  5926. @layout.visible = vis if @layout
  5927. @layout2.visible = vis if @layout2
  5928. @name.visible = vis if @name
  5929. @lv_number.visible = vis if @lv_number
  5930. @status.visible = vis if @status
  5931. @face.visible = vis if @face
  5932. @hp_number.visible = vis if @hp_number
  5933. @hp_number2.visible = vis if @hp_number2
  5934. @hp_meter.visible = vis if @hp_meter
  5935. @hp_icon.visible = vis if @hp_icon
  5936. @hp_icon3.visible = vis if @hp_icon3
  5937. @hp_icon_number.visible = vis if @hp_icon_number
  5938. @mp_number.visible = vis if @mp_number
  5939. @mp_number2.visible = vis if @mp_number2
  5940. @mp_meter.visible = vis if @mp_meter
  5941. @mp_icon.visible = vis if @mp_icon
  5942. @mp_icon3.visible = vis if @mp_icon3
  5943. @mp_icon_number.visible = vis if @mp_icon_number
  5944. @tp_number.visible = vis if @tp_number
  5945. @tp_number2.visible = vis if @tp_number2
  5946. @tp_meter.visible = vis if @tp_meter
  5947. @tp_icon.visible = vis if @tp_icon
  5948. @tp_icon3.visible = vis if @tp_icon3
  5949. @tp_icon_number.visible = vis if @tp_icon_number
  5950. @at_number.visible = vis if @at_number
  5951. @at_number2.visible = vis if @at_number2
  5952. @at_meter.visible = vis if @at_meter
  5953. end
  5954.  
  5955. #--------------------------------------------------------------------------
  5956. # * Update
  5957. #--------------------------------------------------------------------------
  5958. def update
  5959. return if @actor == nil
  5960. @sprite_visible = sprite_visible?
  5961. @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
  5962. update_layout ; update_layout_2 ; update_name
  5963. update_face ; update_hp ; update_mp ; update_tp
  5964. update_at ; update_level ; update_states
  5965. end
  5966.  
  5967. end
  5968.  
  5969. #==============================================================================
  5970. # ■ Sprite Battler
  5971. #==============================================================================
  5972. class Sprite_Battler < Sprite_Base
  5973.  
  5974. #--------------------------------------------------------------------------
  5975. # ● Set AV
  5976. #--------------------------------------------------------------------------
  5977. def set_av(a_viewport)
  5978. @viewport_cm = a_viewport
  5979. end
  5980.  
  5981. #--------------------------------------------------------------------------
  5982. # ● Dispose
  5983. #--------------------------------------------------------------------------
  5984. alias mog_bc_dispose dispose
  5985. def dispose
  5986. mog_bc_dispose
  5987. @viewport_cm.dispose if @viewport_cm != nil
  5988. end
  5989.  
  5990. #--------------------------------------------------------------------------
  5991. # ● Maker Animation Sprites
  5992. #--------------------------------------------------------------------------
  5993. alias mog_bc_make_animation_sprites make_animation_sprites
  5994. def make_animation_sprites
  5995. mog_bc_make_animation_sprites
  5996. set_cm_viewport if $imported[:mog_battle_camera]
  5997. end
  5998.  
  5999. #--------------------------------------------------------------------------
  6000. # ● Set CM Viewpor
  6001. #--------------------------------------------------------------------------
  6002. def set_cm_viewport
  6003. return if @viewport_cm == nil
  6004. return if @ani_sprites == nil
  6005. if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
  6006. @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
  6007. return
  6008. end
  6009. @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
  6010. end
  6011.  
  6012. end
  6013.  
  6014. #==============================================================================
  6015. # ■ Game Temp
  6016. #==============================================================================
  6017. class Spriteset_Battle
  6018.  
  6019. #--------------------------------------------------------------------------
  6020. # ● Initialize
  6021. #--------------------------------------------------------------------------
  6022. alias mog_bc_sp_initialize initialize
  6023. def initialize
  6024. mog_bc_sp_initialize
  6025. if $imported[:mog_battle_camera] and @viewport_cm != nil
  6026. battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
  6027. end
  6028. end
  6029.  
  6030. #--------------------------------------------------------------------------
  6031. # ● Create Viewports
  6032. #--------------------------------------------------------------------------
  6033. alias mog_bc_create_viewports create_viewports
  6034. def create_viewports
  6035. mog_bc_create_viewports
  6036. if $imported[:mog_battle_camera]
  6037. @viewport_cm = Viewport.new
  6038. @viewport_cm.z = 100
  6039. end
  6040. end
  6041.  
  6042. #--------------------------------------------------------------------------
  6043. # ● Dispose Viewports
  6044. #--------------------------------------------------------------------------
  6045. alias mog_bc_dispose_viewports dispose_viewports
  6046. def dispose_viewports
  6047. mog_bc_dispose_viewports
  6048. @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
  6049. end
  6050.  
  6051. #--------------------------------------------------------------------------
  6052. # ● Update Viewports
  6053. #--------------------------------------------------------------------------
  6054. alias mog_bcf_update_viewports update_viewports
  6055. def update_viewports
  6056. mog_bcf_update_viewports
  6057. update_viewport_cm if $imported[:mog_battle_camera]
  6058. end
  6059.  
  6060. #--------------------------------------------------------------------------
  6061. # ● Update Viewport CM
  6062. #--------------------------------------------------------------------------
  6063. def update_viewport_cm
  6064. return if @viewport_cm == nil
  6065. @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
  6066. @viewport_cm.oy = $game_temp.bc_data[1]
  6067. @viewport_cm.update
  6068. end
  6069.  
  6070. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement