Guest User

Untitled

a guest
Oct 6th, 2014
232
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================
  2. # +++ MOG - Ultima HUD (v1.1) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com
  6. #==============================================================================
  7. # Sistema avançado de Hud, voltado para artistas gráficos.
  8. # Este script possui uma vasta gama de opções que permitirão o designer gráfico
  9. # criar huds complexas e animadas, visando o máximo desempenho com o mínimo
  10. # de perda no processamento de imagens.
  11. #==============================================================================
  12. # Coloque as imagens da hud na pasta.
  13. #
  14. # Graphics/Huds/Ultima/
  15. #
  16. #==============================================================================
  17.  
  18. #==============================================================================
  19. # Version History
  20. #==============================================================================
  21. # v1.1 - Corrigido o erro de não ativar o efeito shake em faces não animadas.
  22. #==============================================================================
  23. module MOG_ULTIMA_HUD
  24.  
  25. #============================================================================
  26. #============================================================================
  27. # * VISIBILITY
  28. #============================================================================
  29. # Para ativar ou desativar a hud no meio do jogo utilize o código abaixo.
  30. #
  31. # hud_visible(true)
  32. #
  33. # hud_visible(false)
  34. #
  35. #---------------------------------------------------------------------------
  36. # Deixar a Hud visível ao começar o jogo.
  37. #---------------------------------------------------------------------------
  38. INITIAL_VISIBLE = true
  39. #---------------------------------------------------------------------------
  40. # Ocultar a Hud automaticamente ao iniciar o interpretador.
  41. #---------------------------------------------------------------------------
  42. AUTO_HIDE_FOR_INTERPRETER = true
  43. #============================================================================
  44. #============================================================================
  45.  
  46.  
  47. #============================================================================
  48. #============================================================================
  49. # * SMART FADE
  50. #============================================================================
  51. # Ativar a Hud no modo translucido quando o personagem ficar abaixo da hud.
  52. #---------------------------------------------------------------------------
  53. SMART_FADE_EFFECT = true
  54. #---------------------------------------------------------------------------
  55. # Definição da área "extra" do alcance do Smart Fade.
  56. # O alcance é baseado no tamanho da imagem do Layout.
  57. #---------------------------------------------------------------------------
  58. SMART_FADE_RANGE_X = [0,344]
  59. SMART_FADE_RANGE_Y = [0,-64]
  60. #---------------------------------------------------------------------------
  61. # Limite de transparência da hud
  62. #---------------------------------------------------------------------------
  63. SMART_FADE_LIMIT = 90
  64. #============================================================================
  65. #============================================================================
  66.  
  67.  
  68. #============================================================================
  69. #============================================================================
  70. # * HUD SPRITE (GENERAL)
  71. #============================================================================
  72. # Definição da prioridade da hud.
  73. #---------------------------------------------------------------------------
  74. HUD_Z = 305
  75. #---------------------------------------------------------------------------
  76. # Para mudar a posição da HUD no meio do jogo use o código abaixo.
  77. #
  78. # hud_position( X , Y)
  79. #
  80. #---------------------------------------------------------------------------
  81. # Definição da posição geral da hud, influência em todos os sprites da hud.
  82. #---------------------------------------------------------------------------
  83. HUD_POSITION = [4,4]
  84. #---------------------------------------------------------------------------
  85. # Definição da porcentagem do parâmetro baixo, isso influencia na cor
  86. # do número dos parâmetros de HP, MP e TP.
  87. #---------------------------------------------------------------------------
  88. LOW_PARAMETER_PERCENTAGE = 30
  89. #============================================================================
  90. #============================================================================
  91.  
  92.  
  93. #============================================================================
  94. #============================================================================
  95. # * NAME SPRITE
  96. #============================================================================
  97. # Ativar o Sprite do nome do personagem.
  98. #---------------------------------------------------------------------------
  99. NAME_VISIBLE = false
  100. #---------------------------------------------------------------------------
  101. # Definição da prioridade do Sprite.
  102. #---------------------------------------------------------------------------
  103. NAME_Z = 5
  104. #---------------------------------------------------------------------------
  105. # Definição da posição da Face. [X,Y]
  106. #---------------------------------------------------------------------------
  107. NAME_POSITION = [0,0]
  108. #---------------------------------------------------------------------------
  109. # Definição do tipo alinhamento do nome.
  110. #
  111. # 0 - Esquerda
  112. # 1 - Centro
  113. # 2 - Direita
  114. #---------------------------------------------------------------------------
  115. NAME_ALIGN_TYPE = 0
  116. #---------------------------------------------------------------------------
  117. # Definição do nome da fonte.
  118. #---------------------------------------------------------------------------
  119. NAME_FONT_NAME = "Georgia"
  120. #---------------------------------------------------------------------------
  121. # Definição do tamanho da fonte.
  122. #---------------------------------------------------------------------------
  123. NAME_FONT_SIZE = 20
  124. #---------------------------------------------------------------------------
  125. # Ativar Bold.
  126. #---------------------------------------------------------------------------
  127. NAME_FONT_BOLD = true
  128. #---------------------------------------------------------------------------
  129. # Ativar Italic.
  130. #---------------------------------------------------------------------------
  131. NAME_FONT_ITALIC = true
  132. #---------------------------------------------------------------------------
  133. # Definição da cor da fonte
  134. #---------------------------------------------------------------------------
  135. NAME_FONT_COLOR = Color.new(255,255,255,255)
  136. #---------------------------------------------------------------------------
  137. # Ativar Sombra
  138. #---------------------------------------------------------------------------
  139. NAME_FONT_SHADOW = true
  140. #---------------------------------------------------------------------------
  141. # Definição da cor da sombra
  142. #---------------------------------------------------------------------------
  143. NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
  144. #---------------------------------------------------------------------------
  145. # Definição da distância da sombra.
  146. #---------------------------------------------------------------------------
  147. NAME_FONT_SHADOW_POSITION = [2,2]
  148. #============================================================================
  149. #============================================================================
  150.  
  151.  
  152. #============================================================================
  153. #============================================================================
  154. # * FACE SPRITE
  155. #============================================================================
  156. # Ativar a face.
  157. # Será necessário o arquivo.
  158. #
  159. # ACTOR_NAME + _Face.png
  160. #
  161. # Eric_Face.png
  162. #
  163. #---------------------------------------------------------------------------
  164. FACE_VISIBLE = false
  165. #---------------------------------------------------------------------------
  166. # Definição da prioridade do sprite.
  167. #---------------------------------------------------------------------------
  168. FACE_Z = 1
  169. #---------------------------------------------------------------------------
  170. # Definição da posição da Face. [X,Y]
  171. #---------------------------------------------------------------------------
  172. FACE_POSITION = [0,0]
  173. #---------------------------------------------------------------------------
  174. # Ativar faces animadas.
  175. # Será necessário ter uma imagem de 4 faces do personagem no mesmo arquivo.
  176. #
  177. # FACE1/FACE2/FACE3/FACE4
  178. #
  179. # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
  180. # a imagem será dividida por 1 frame
  181. #---------------------------------------------------------------------------
  182. FACE_ANIMATION = true
  183. #---------------------------------------------------------------------------
  184. # Definição do tempo duração da animação da face.
  185. #---------------------------------------------------------------------------
  186. FACE_ANIMATION_DURATION = 40
  187. #---------------------------------------------------------------------------
  188. # Ativar o efeito tremor da face quando o personagem sofrer dano.
  189. #---------------------------------------------------------------------------
  190. FACE_SHAKE_EFFECT = true
  191. #============================================================================
  192. #============================================================================
  193.  
  194.  
  195. #============================================================================
  196. #============================================================================
  197. # * HP SPRITE
  198. #============================================================================
  199. # Ativar o número de HP.
  200. # Será necessário o arquivo.
  201. #
  202. # HP_Number.png
  203. #
  204. #---------------------------------------------------------------------------
  205. HP_NUMBER_VISIBLE = false
  206. #---------------------------------------------------------------------------
  207. # Definição da prioridade do Sprite.
  208. #---------------------------------------------------------------------------
  209. HP_NUMBER_Z = 2
  210. #---------------------------------------------------------------------------
  211. # Definição da posição do número de HP. [X,Y]
  212. #---------------------------------------------------------------------------
  213. HP_NUMBER_POSITION = [160,21]
  214. #---------------------------------------------------------------------------
  215. # Ativar o número de HP Total.
  216. # Será necessário o arquivo.
  217. #
  218. # HP_Number_Max.png
  219. #
  220. #---------------------------------------------------------------------------
  221. HP_NUMBER_MAX_VISIBLE = false
  222. #---------------------------------------------------------------------------
  223. # Definição da posição do número de HP Total. [X,Y]
  224. #---------------------------------------------------------------------------
  225. HP_NUMBER_MAX_POSITION = [165,30]
  226. #---------------------------------------------------------------------------
  227. # Definição do tipo alinhamento do número.
  228. #
  229. # 0 - Esquerda
  230. # 1 - Centro
  231. # 2 - Direita
  232. #---------------------------------------------------------------------------
  233. HP_NUMBER_ALIGN_TYPE = 2
  234. #---------------------------------------------------------------------------
  235. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  236. #---------------------------------------------------------------------------
  237. HP_NUMBER_WAVE_ALIGN_EFFECT = false
  238. #---------------------------------------------------------------------------
  239. # Apresentar os números em porcentagem.
  240. #---------------------------------------------------------------------------
  241. HP_NUMBER_PERCENTAGE = false
  242. #---------------------------------------------------------------------------
  243. # Ativar números animados ("Rolantes").
  244. #---------------------------------------------------------------------------
  245. HP_NUMBER_ANIMATION = true
  246. #---------------------------------------------------------------------------
  247. # Ativar a cor do HP baixo.
  248. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  249. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  250. #
  251. # NORMAL_COLOR
  252. # LOW_PARAMETER_COLOR
  253. #
  254. # Caso definir a função como FALSE a imagem será dividida apenas como
  255. # 1 frame de altura.
  256. #---------------------------------------------------------------------------
  257. HP_NUMBER_LOW_COLOR = true
  258. #---------------------------------------------------------------------------
  259. # Ativar o medidor de HP.
  260. # Será necessário o arquivo.
  261. #
  262. # HP_Meter.png
  263. #
  264. #---------------------------------------------------------------------------
  265. HP_METER_VISIBLE = false
  266. #---------------------------------------------------------------------------
  267. # Definição da prioridade do sprite.
  268. #---------------------------------------------------------------------------
  269. HP_METER_Z = 1
  270. #---------------------------------------------------------------------------
  271. # Definição da posição do medidor de HP. [X,Y]
  272. #---------------------------------------------------------------------------
  273. HP_METER_POSITION = [68,30]
  274. #---------------------------------------------------------------------------
  275. # Definição do ângulo do medidor.
  276. #---------------------------------------------------------------------------
  277. HP_METER_ANGLE = 0
  278. #---------------------------------------------------------------------------
  279. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  280. # inverso.
  281. #---------------------------------------------------------------------------
  282. HP_METER_MIRROR_EFFECT = false
  283. #---------------------------------------------------------------------------
  284. # Ativar o efeito animado de dano no medidor.
  285. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  286. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  287. #
  288. # NORMAL_COLOR
  289. # DAMAGE_COLOR
  290. #
  291. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  292. #---------------------------------------------------------------------------
  293. HP_METER_REDUCTION_ANIMATION = true
  294. #---------------------------------------------------------------------------
  295. # Ativar o efeito animado do "medidor fluindo".
  296. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  297. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  298. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  299. #---------------------------------------------------------------------------
  300. HP_METER_GRADIENT_ANIMATION = true
  301. #---------------------------------------------------------------------------
  302. # Ativar HP em ícones.
  303. # Será necessário ter a imagem.
  304. #
  305. # HP_Icon.png
  306. #
  307. #---------------------------------------------------------------------------
  308. HP_ICON_VISIBLE = true
  309. #---------------------------------------------------------------------------
  310. # Definição da prioridade do Sprite.
  311. #---------------------------------------------------------------------------
  312. HP_ICON_Z = 1
  313. #---------------------------------------------------------------------------
  314. # Posição do ícone de HP.
  315. #---------------------------------------------------------------------------
  316. HP_ICON_POSITION = [5,15]
  317. #---------------------------------------------------------------------------
  318. # Ativar o sprite EX do ultimo ícone
  319. # Será necessário ter a imagem.
  320. #
  321. # HP_Icon_EX.png
  322. #
  323. #---------------------------------------------------------------------------
  324. HP_ICON_EX_VISIBLE = true
  325. #---------------------------------------------------------------------------
  326. # Posição do ícone Animado.
  327. #---------------------------------------------------------------------------
  328. HP_ICON_EX_POSITION = [0,0]
  329. #---------------------------------------------------------------------------
  330. # Ativar o efeito de Zoom do Sprite.
  331. #---------------------------------------------------------------------------
  332. HP_ICON_EX_ZOOM_EFFECT = true
  333. #---------------------------------------------------------------------------
  334. # Espaço entre os ícones.
  335. #---------------------------------------------------------------------------
  336. HP_ICON_SPACE = [2,2]
  337. #---------------------------------------------------------------------------
  338. # Definição da quantidade maxima de ícones na horizontal.
  339. #---------------------------------------------------------------------------
  340. HP_ICON_COL_MAX = 10
  341. #---------------------------------------------------------------------------
  342. # Definição da quantidade maxima de ícones na vertical.
  343. #---------------------------------------------------------------------------
  344. HP_ICON_ROW_MAX = 2
  345. #---------------------------------------------------------------------------
  346. # Ativar o número de HP de ícones.
  347. # Será necessário ter a imagem.
  348. #
  349. # HP_Icon_Number.png
  350. #
  351. #---------------------------------------------------------------------------
  352. HP_ICON_NUMBER_VISIBLE = false
  353. #---------------------------------------------------------------------------
  354. # Definição da prioridade do sprite.
  355. #---------------------------------------------------------------------------
  356. HP_ICON_NUMBER_Z = 4
  357. #---------------------------------------------------------------------------
  358. # Posição do número do ícone
  359. #---------------------------------------------------------------------------
  360. HP_ICON_NUMBER_POSITION = [0,0]
  361. #---------------------------------------------------------------------------
  362. # Definição do tipo alinhamento do número.
  363. #
  364. # 0 - Esquerda
  365. # 1 - Centro
  366. # 2 - Direita
  367. #---------------------------------------------------------------------------
  368. HP_ICON_NUMBER_ALIGN_TYPE = 0
  369. #============================================================================
  370. #============================================================================
  371.  
  372.  
  373. #============================================================================
  374. #============================================================================
  375. # * MP SPRITE
  376. #============================================================================
  377. # Ativar o número de MP.
  378. # Será necessário o arquivo.
  379. #
  380. # MP_Number.png
  381. #
  382. #---------------------------------------------------------------------------
  383. MP_NUMBER_VISIBLE = false
  384. #---------------------------------------------------------------------------
  385. # Definição da prioridade do Sprite.
  386. #---------------------------------------------------------------------------
  387. MP_NUMBER_Z = 2
  388. #---------------------------------------------------------------------------
  389. # Definição da posição do número de MP. [X,Y]
  390. #---------------------------------------------------------------------------
  391. MP_NUMBER_POSITION = [123,43]
  392. #---------------------------------------------------------------------------
  393. # Ativar o número de MP Total.
  394. # Será necessário o arquivo.
  395. #
  396. # MP_Number_Max.png
  397. #
  398. #---------------------------------------------------------------------------
  399. MP_NUMBER_MAX_VISIBLE = false
  400. #---------------------------------------------------------------------------
  401. # Definição da posição do número de MP Total. [X,Y]
  402. #---------------------------------------------------------------------------
  403. MP_NUMBER_MAX_POSITION = [128,53]
  404. #---------------------------------------------------------------------------
  405. # Definição do tipo alinhamento do número.
  406. #
  407. # 0 - Esquerda
  408. # 1 - Centro
  409. # 2 - Direita
  410. #---------------------------------------------------------------------------
  411. MP_NUMBER_ALIGN_TYPE = 2
  412. #---------------------------------------------------------------------------
  413. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  414. #---------------------------------------------------------------------------
  415. MP_NUMBER_WAVE_ALIGN_EFFECT = false
  416. #---------------------------------------------------------------------------
  417. # Apresentar os números em porcentagem.
  418. #---------------------------------------------------------------------------
  419. MP_NUMBER_PERCENTAGE = false
  420. #---------------------------------------------------------------------------
  421. # Ativar números animados ("Rolantes").
  422. #---------------------------------------------------------------------------
  423. MP_NUMBER_ANIMATION = false
  424. #---------------------------------------------------------------------------
  425. # Ativar a cor do MP baixo.
  426. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  427. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  428. #
  429. # NORMAL_COLOR
  430. # LOW_PARAMETER_COLOR
  431. #
  432. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  433. #---------------------------------------------------------------------------
  434. MP_NUMBER_LOW_COLOR = false
  435. #---------------------------------------------------------------------------
  436. # Ativar o medidor de MP.
  437. # Será necessário o arquivo.
  438. #
  439. # MP_Meter.png
  440. #
  441. #---------------------------------------------------------------------------
  442. MP_METER_VISIBLE = false
  443. #---------------------------------------------------------------------------
  444. # Definição da prioridade do sprite.
  445. #---------------------------------------------------------------------------
  446. MP_METER_Z = 1
  447. #---------------------------------------------------------------------------
  448. # Definição da posição do medidor de MP. [X,Y]
  449. #---------------------------------------------------------------------------
  450. MP_METER_POSITION = [10,141]
  451. #---------------------------------------------------------------------------
  452. # Definição do ângulo do medidor.
  453. #---------------------------------------------------------------------------
  454. MP_METER_ANGLE = 90
  455. #---------------------------------------------------------------------------
  456. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  457. # inverso.
  458. #---------------------------------------------------------------------------
  459. MP_METER_MIRROR_EFFECT = false
  460. #---------------------------------------------------------------------------
  461. # Ativar o efeito animado de dano no medidor.
  462. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  463. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  464. #
  465. # NORMAL_COLOR
  466. # DAMAGE_COLOR
  467. #
  468. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  469. #---------------------------------------------------------------------------
  470. MP_METER_REDUCTION_ANIMATION = false
  471. #---------------------------------------------------------------------------
  472. # Ativar o efeito animado do "medidor fluindo".
  473. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  474. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  475. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  476. #---------------------------------------------------------------------------
  477. MP_METER_GRADIENT_ANIMATION = false
  478. #---------------------------------------------------------------------------
  479. # Ativar MP em ícones.
  480. # Será necessário ter a imagem.
  481. #
  482. # MP_Icon.png
  483. #
  484. #---------------------------------------------------------------------------
  485. MP_ICON_VISIBLE = false
  486. #---------------------------------------------------------------------------
  487. # Definição da prioridade do Sprite.
  488. #---------------------------------------------------------------------------
  489. MP_ICON_Z = 1
  490. #---------------------------------------------------------------------------
  491. # Posição do ícone de MP.
  492. #---------------------------------------------------------------------------
  493. MP_ICON_POSITION = [200,64]
  494. #---------------------------------------------------------------------------
  495. # Ativar o sprite EX do ultimo ícone
  496. # Será necessário ter a imagem.
  497. #
  498. # MP_Icon_EX.png
  499. #
  500. #---------------------------------------------------------------------------
  501. MP_ICON_EX_VISIBLE = false
  502. #---------------------------------------------------------------------------
  503. # Posição do ícone Animado.
  504. #---------------------------------------------------------------------------
  505. MP_ICON_EX_POSITION = [0,0]
  506. #---------------------------------------------------------------------------
  507. # Ativar o efeito de Zoom do Sprite.
  508. #---------------------------------------------------------------------------
  509. MP_ICON_EX_ZOOM_EFFECT = false
  510. #---------------------------------------------------------------------------
  511. # Espaço entre os ícones.
  512. #---------------------------------------------------------------------------
  513. MP_ICON_SPACE = [-10,-10]
  514. #---------------------------------------------------------------------------
  515. # Definição da quantidade maxima de ícones na horizontal.
  516. #---------------------------------------------------------------------------
  517. MP_ICON_COL_MAX = 10
  518. #---------------------------------------------------------------------------
  519. # Definição da quantidade maxima de ícones na vertical.
  520. #---------------------------------------------------------------------------
  521. MP_ICON_ROW_MAX = 2
  522. #---------------------------------------------------------------------------
  523. # Ativar o número de MP de ícones.
  524. # Será necessário ter a imagem.
  525. #
  526. # MP_Icon_Number.png
  527. #
  528. #---------------------------------------------------------------------------
  529. MP_ICON_NUMBER_VISIBLE = false
  530. #---------------------------------------------------------------------------
  531. # Definição da prioridade do sprite.
  532. #---------------------------------------------------------------------------
  533. MP_ICON_NUMBER_Z = 4
  534. #---------------------------------------------------------------------------
  535. # Posição do número do ícone
  536. #---------------------------------------------------------------------------
  537. MP_ICON_NUMBER_POSITION = [0,64]
  538. #---------------------------------------------------------------------------
  539. # Definição do tipo alinhamento do número.
  540. #
  541. # 0 - Esquerda
  542. # 1 - Centro
  543. # 2 - Direita
  544. #---------------------------------------------------------------------------
  545. MP_ICON_NUMBER_ALIGN_TYPE = 0
  546. #============================================================================
  547. #============================================================================
  548.  
  549.  
  550. #============================================================================
  551. #============================================================================
  552. # * TP SPRITE
  553. #============================================================================
  554. # Ativar o número de TP.
  555. # Será necessário o arquivo.
  556. #
  557. # TP_Number.png
  558. #
  559. #---------------------------------------------------------------------------
  560. TP_NUMBER_VISIBLE = false
  561. #---------------------------------------------------------------------------
  562. # Definição da prioridade do sprite.
  563. #---------------------------------------------------------------------------
  564. TP_NUMBER_Z = 2
  565. #---------------------------------------------------------------------------
  566. # Definição da posição do número de TP. [X,Y]
  567. #---------------------------------------------------------------------------
  568. TP_NUMBER_POSITION = [160,63]
  569. #---------------------------------------------------------------------------
  570. # Ativar o número de TP Total.
  571. # Será necessário o arquivo.
  572. #
  573. # TP_Number_Max.png
  574. #
  575. #---------------------------------------------------------------------------
  576. TP_NUMBER_MAX_VISIBLE = false
  577. #---------------------------------------------------------------------------
  578. # Definição da posição do número de TP Total. [X,Y]
  579. #---------------------------------------------------------------------------
  580. TP_NUMBER_MAX_POSITION = [165,73]
  581. #---------------------------------------------------------------------------
  582. # Definição do tipo alinhamento do número.
  583. #
  584. # 0 - Esquerda
  585. # 1 - Centro
  586. # 2 - Direita
  587. #---------------------------------------------------------------------------
  588. TP_NUMBER_ALIGN_TYPE = 2
  589. #---------------------------------------------------------------------------
  590. # Ativa o efeito de alinhar os números em posições de Y diferentes.
  591. #---------------------------------------------------------------------------
  592. TP_NUMBER_WAVE_ALIGN_EFFECT = false
  593. #---------------------------------------------------------------------------
  594. # Apresentar os números em porcentagem.
  595. #---------------------------------------------------------------------------
  596. TP_NUMBER_PERCENTAGE = false
  597. #---------------------------------------------------------------------------
  598. # Ativar números animados ("Rolantes").
  599. #---------------------------------------------------------------------------
  600. TP_NUMBER_ANIMATION = false
  601. #---------------------------------------------------------------------------
  602. # Ativar a cor do TP baixo.
  603. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  604. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  605. #
  606. # NORMAL_COLOR
  607. # LOW_PARAMETER_COLOR
  608. #
  609. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  610. #---------------------------------------------------------------------------
  611. TP_NUMBER_LOW_COLOR = true
  612. #---------------------------------------------------------------------------
  613. # Ativar o medidor de TP.
  614. # Será necessário o arquivo.
  615. #
  616. # TP_Meter.png
  617. #
  618. #---------------------------------------------------------------------------
  619. TP_METER_VISIBLE = false
  620. #---------------------------------------------------------------------------
  621. # Definição da prioridade do sprite.
  622. #---------------------------------------------------------------------------
  623. TP_METER_Z = 1
  624. #---------------------------------------------------------------------------
  625. # Definição da posição do medidor de TP. [X,Y]
  626. #---------------------------------------------------------------------------
  627. TP_METER_POSITION = [68,74]
  628. #---------------------------------------------------------------------------
  629. # Definição do ângulo do medidor.
  630. #---------------------------------------------------------------------------
  631. TP_METER_ANGLE = 0
  632. #---------------------------------------------------------------------------
  633. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  634. # inverso.
  635. #---------------------------------------------------------------------------
  636. TP_METER_MIRROR_EFFECT = false
  637. #---------------------------------------------------------------------------
  638. # Ativar o efeito animado de dano no medidor.
  639. # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
  640. # arquivo de imagem, a imagem será dividida por 2 frames de altura.
  641. #
  642. # NORMAL_COLOR
  643. # DAMAGE_COLOR
  644. #
  645. # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
  646. #---------------------------------------------------------------------------
  647. TP_METER_REDUCTION_ANIMATION = true
  648. #---------------------------------------------------------------------------
  649. # Ativar o efeito animado do "medidor fluindo".
  650. # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
  651. # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
  652. # Se definir como FALSE use apenas uma imagem com o tamanho normal.
  653. #---------------------------------------------------------------------------
  654. TP_METER_GRADIENT_ANIMATION = true
  655. #---------------------------------------------------------------------------
  656. # Ativar TP em ícones.
  657. # Será necessário ter a imagem.
  658. #
  659. # TP_Icon.png
  660. #
  661. #---------------------------------------------------------------------------
  662. TP_ICON_VISIBLE = false
  663. #---------------------------------------------------------------------------
  664. # Definição da prioridade do sprite.
  665. #---------------------------------------------------------------------------
  666. TP_ICON_Z = 1
  667. #---------------------------------------------------------------------------
  668. # Posição do ícone de TP.
  669. #---------------------------------------------------------------------------
  670. TP_ICON_POSITION = [200,128]
  671. #---------------------------------------------------------------------------
  672. # Ativar o sprite EX do ultimo ícone
  673. # Será necessário ter a imagem.
  674. #
  675. # TP_Icon_EX.png
  676. #
  677. #---------------------------------------------------------------------------
  678. TP_ICON_EX_VISIBLE = false
  679. #---------------------------------------------------------------------------
  680. # Posição do ícone Animado.
  681. #---------------------------------------------------------------------------
  682. TP_ICON_EX_POSITION = [0,0]
  683. #---------------------------------------------------------------------------
  684. # Ativar o efeito de Zoom do Sprite.
  685. #---------------------------------------------------------------------------
  686. TP_ICON_EX_ZOOM_EFFECT = true
  687. #---------------------------------------------------------------------------
  688. # Espaço entre os ícones.
  689. #---------------------------------------------------------------------------
  690. TP_ICON_SPACE = [-10,-10]
  691. #---------------------------------------------------------------------------
  692. # Definição da quantidade maxima de ícones na horizontal.
  693. #---------------------------------------------------------------------------
  694. TP_ICON_COL_MAX = 10
  695. #---------------------------------------------------------------------------
  696. # Definição da quantidade maxima de ícones na vertical.
  697. #---------------------------------------------------------------------------
  698. TP_ICON_ROW_MAX = 2
  699. #---------------------------------------------------------------------------
  700. # Ativar o número de TP de ícones.
  701. # Será necessário ter a imagem.
  702. #
  703. # TP_Icon_Number.png
  704. #
  705. #---------------------------------------------------------------------------
  706. TP_ICON_NUMBER_VISIBLE = false
  707. #---------------------------------------------------------------------------
  708. # Definição da prioridade do sprite.
  709. #---------------------------------------------------------------------------
  710. TP_ICON_NUMBER_Z = 4
  711. #---------------------------------------------------------------------------
  712. # Posição do número do ícone
  713. #---------------------------------------------------------------------------
  714. TP_ICON_NUMBER_POSITION = [0,128]
  715. #---------------------------------------------------------------------------
  716. # Definição do tipo alinhamento do número.
  717. #
  718. # 0 - Esquerda
  719. # 1 - Centro
  720. # 2 - Direita
  721. #---------------------------------------------------------------------------
  722. TP_ICON_NUMBER_ALIGN_TYPE = 0
  723. #============================================================================
  724. #============================================================================
  725.  
  726.  
  727. #============================================================================
  728. #============================================================================
  729. # * LEVEL / EXP SPRITE
  730. #============================================================================
  731. # Ativar o número de Level.
  732. # Será necessário o arquivo.
  733. #
  734. # LV_Number.png
  735. #
  736. #---------------------------------------------------------------------------
  737. LEVEL_NUMBER_VISIBLE = false
  738. #---------------------------------------------------------------------------
  739. # Definição da prioridade do Sprite.
  740. #---------------------------------------------------------------------------
  741. LEVEL_NUMBER_Z = 2
  742. #---------------------------------------------------------------------------
  743. # Definição da posição do número do Level. [X,Y]
  744. #---------------------------------------------------------------------------
  745. LEVEL_NUMBER_POSITION = [84,0]
  746. #---------------------------------------------------------------------------
  747. # Definição do tipo alinhamento do número.
  748. #
  749. # 0 - Esquerda
  750. # 1 - Centro
  751. # 2 - Direita
  752. #---------------------------------------------------------------------------
  753. LEVEL_NUMBER_ALIGN_TYPE = 1
  754. #---------------------------------------------------------------------------
  755. # Ativar o medidor de exp.
  756. # Será necessário o arquivo.
  757. #
  758. # LV_Meter.png
  759. #
  760. #---------------------------------------------------------------------------
  761. LEVEL_METER_VISIBLE = false
  762. #---------------------------------------------------------------------------
  763. # Definição da prioridade do Sprite.
  764. #---------------------------------------------------------------------------
  765. LEVEL_METER_Z = 1
  766. #---------------------------------------------------------------------------
  767. # Definição da posição do medidor de experiência. [X,Y]
  768. #---------------------------------------------------------------------------
  769. LEVEL_METER_POSITION = [56,14]
  770. #---------------------------------------------------------------------------
  771. # Definição do ângulo do medidor.
  772. #---------------------------------------------------------------------------
  773. LEVEL_METER_ANGLE = 0
  774. #---------------------------------------------------------------------------
  775. # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
  776. # inverso.
  777. #---------------------------------------------------------------------------
  778. LEVEL_METER_MIRROR_EFFECT = false
  779. #---------------------------------------------------------------------------
  780. # Ativar o número de exp necessário para atingir o level.
  781. # Será necessário o arquivo.
  782. #
  783. # LV_Number_Exp.png
  784. #
  785. #---------------------------------------------------------------------------
  786. LEVEL_NUMBER_EXP_VISIBLE = false
  787. #---------------------------------------------------------------------------
  788. # Definição da posição do número de experiência. [X,Y]
  789. #---------------------------------------------------------------------------
  790. LEVEL_NUMBER_EXP_POSITION = [180,96]
  791. #---------------------------------------------------------------------------
  792. # Definição do tipo alinhamento do número.
  793. #
  794. # 0 - Esquerda
  795. # 1 - Centro
  796. # 2 - Direita
  797. #---------------------------------------------------------------------------
  798. LEVEL_NUMBER_EXP_ALIGN_TYPE = 2
  799. #---------------------------------------------------------------------------
  800. # Definição do tipo de exp apresentado na HUD.
  801. #
  802. # 0 = Exp necessária para atingir o próximo nível. (Next EXP)
  803. # 1 = Exp total do personagem. (Current EXP)
  804. #---------------------------------------------------------------------------
  805. LEVEL_NUMBER_EXP_TYPE = 0
  806. #============================================================================
  807. #============================================================================
  808.  
  809.  
  810. #============================================================================
  811. #============================================================================
  812. # * STATE SPRITE
  813. #============================================================================
  814. # Ativar as condições.
  815. #---------------------------------------------------------------------------
  816. STATES_VISIBLE = false
  817. #---------------------------------------------------------------------------
  818. # Definição da prioridade do sprite.
  819. #---------------------------------------------------------------------------
  820. STATES_Z = 1
  821. #---------------------------------------------------------------------------
  822. # Definição da posição das condições. [X,Y]
  823. #---------------------------------------------------------------------------
  824. STATES_POSITION = [5,63]
  825. #---------------------------------------------------------------------------
  826. # Ativar o efeito animado das condições deslizando.
  827. #---------------------------------------------------------------------------
  828. STATES_SCROLLING_ANIMATION = true
  829. #---------------------------------------------------------------------------
  830. # Definição do ângulo do sprite.
  831. #---------------------------------------------------------------------------
  832. STATE_ANGLE = 0
  833. #============================================================================
  834. #============================================================================
  835.  
  836.  
  837. #============================================================================
  838. #============================================================================
  839. # * SECOND LAYOUT (Overlayer)
  840. #============================================================================
  841. # Ativar a segunda camada de Layout
  842. # Será necessário o arquivo.
  843. #
  844. # Layout_2.png
  845. #
  846. #============================================================================
  847. SECOND_LAYOUT = false
  848. #---------------------------------------------------------------------------
  849. # Definição da prioridade do sprite.
  850. #---------------------------------------------------------------------------
  851. SECOND_LAYOUT_Z = 10
  852. #---------------------------------------------------------------------------
  853. # Definição da posição do sprite.
  854. #---------------------------------------------------------------------------
  855. SECOND_LAYOUT_POSITION = [0,0]
  856. #============================================================================
  857. #============================================================================
  858.  
  859.  
  860. #============================================================================
  861. #============================================================================
  862. # * GOLD HUD
  863. #============================================================================
  864. # Ativar a HUD de ouro. (Dinheiro)
  865. # Serão necessários os arquivos.
  866. #
  867. # Gold_Layout.png
  868. # Gold_Number.png
  869. #
  870. #============================================================================
  871. GOLD_VISIBLE = false
  872. #---------------------------------------------------------------------------
  873. # Ativar o Smart Fade separado da hud principal.
  874. #---------------------------------------------------------------------------
  875. GOLD_DETACHED_SMART_FADE = false
  876. #---------------------------------------------------------------------------
  877. # Definição da área "extra" do alcance do Smart Fade.
  878. # O alcance é baseado no tamanho da imagem do Layout.
  879. #---------------------------------------------------------------------------
  880. GOLD_SMART_FADE_RANGE_X = [0,0]
  881. GOLD_SMART_FADE_RANGE_Y = [0,0]
  882. #---------------------------------------------------------------------------
  883. # Definição da prioridade da hud.
  884. #---------------------------------------------------------------------------
  885. GOLD_HUD_Z = 0
  886. #---------------------------------------------------------------------------
  887. # Definição da posição geral da hud, influência em todos os sprites da hud.
  888. #---------------------------------------------------------------------------
  889. GOLD_POSITION = [394,5]
  890. #---------------------------------------------------------------------------
  891. # Definição da posição do número.
  892. #---------------------------------------------------------------------------
  893. GOLD_NUMBER_POSITION = [75,5]
  894. #---------------------------------------------------------------------------
  895. # Definição do tipo alinhamento do número.
  896. #
  897. # 0 - Esquerda
  898. # 1 - Centro
  899. # 2 - Direita
  900. #---------------------------------------------------------------------------
  901. GOLD_NUMBER_ALIGN_TYPE = 1
  902. #============================================================================
  903. #============================================================================
  904.  
  905.  
  906. #============================================================================
  907. #============================================================================
  908. # * EQUIPMENT HUD
  909. #============================================================================
  910. # Ativar a HUD de equipamento.
  911. # Será necessário o arquivo.
  912. #
  913. # Equip_Layout.png
  914. #
  915. #============================================================================
  916. EQUIPMENT_VISIBLE = false
  917. #---------------------------------------------------------------------------
  918. # Ativar o Smart Fade separado da hud principal.
  919. #---------------------------------------------------------------------------
  920. EQUIPMENT_DETACHED_SMART_FADE = false
  921. #---------------------------------------------------------------------------
  922. # Definição da área "extra" do alcance do Smart Fade.
  923. # O alcance é baseado no tamanho da imagem do Layout.
  924. #---------------------------------------------------------------------------
  925. EQUIPMENT_SMART_FADE_RANGE_X = [0,0]
  926. EQUIPMENT_SMART_FADE_RANGE_Y = [0,0]
  927. #---------------------------------------------------------------------------
  928. # Definição da prioridade da hud.
  929. #---------------------------------------------------------------------------
  930. EQUIPMENT_Z = 0
  931. #---------------------------------------------------------------------------
  932. # Definição da posição geral da hud, influência em todos os sprites da hud.
  933. #---------------------------------------------------------------------------
  934. EQUIPMENT_POSITION = [460,42]
  935. #---------------------------------------------------------------------------
  936. # Apresentar o ícone da arma e a definição da posição do ícone.
  937. #---------------------------------------------------------------------------
  938. EQUIPMENT_WEAPON_VISIBLE = true
  939. EQUIPMENT_WEAPON_POSITION = [3,2]
  940. #---------------------------------------------------------------------------
  941. # Apresentar o ícone da escudo e a definição da posição do ícone.
  942. #---------------------------------------------------------------------------
  943. EQUIPMENT_SHIELD_VISIBLE = true
  944. EQUIPMENT_SHIELD_POSITION = [41,27]
  945. #---------------------------------------------------------------------------
  946. # Apresentar o ícone da capacete e a definição da posição do ícone.
  947. #---------------------------------------------------------------------------
  948. EQUIPMENT_HEAD_VISIBLE = false
  949. EQUIPMENT_HEAD_POSITION = [48,0]
  950. #---------------------------------------------------------------------------
  951. # Apresentar o ícone da armadura e a definição da posição do ícone.
  952. #---------------------------------------------------------------------------
  953. EQUIPMENT_BODY_VISIBLE = false
  954. EQUIPMENT_BODY_POSITION = [72,0]
  955. #---------------------------------------------------------------------------
  956. # Apresentar o ícone do acessório e a definição da posição do ícone.
  957. #---------------------------------------------------------------------------
  958. EQUIPMENT_ACCESSORY_VISIBLE = false
  959. EQUIPMENT_ACCESSORY_POSITION = [96,0]
  960. #============================================================================
  961. #============================================================================
  962.  
  963.  
  964. end
  965.  
  966.  
  967. #==============================================================================
  968. #==============================================================================
  969. # ** Ultima Hud
  970. #==============================================================================
  971. #==============================================================================
  972.  
  973. #==============================================================================
  974. # ** Game System
  975. #==============================================================================
  976. class Game_System
  977.  
  978. attr_accessor :hud_face
  979. attr_accessor :hud_visible
  980. attr_accessor :hud_position
  981.  
  982. #--------------------------------------------------------------------------
  983. # * Initialize
  984. #--------------------------------------------------------------------------
  985. alias mog_master_hud_initialize initialize
  986. def initialize
  987. @hud_face = [0,0]
  988. @hud_visible = MOG_ULTIMA_HUD::INITIAL_VISIBLE
  989. @hud_position = [MOG_ULTIMA_HUD::HUD_POSITION[0],MOG_ULTIMA_HUD::HUD_POSITION[1]]
  990. mog_master_hud_initialize
  991. end
  992.  
  993. end
  994.  
  995. #==============================================================================
  996. # ** Game Interpreter
  997. #==============================================================================
  998. class Game_Interpreter
  999.  
  1000. #--------------------------------------------------------------------------
  1001. # * Hud Visible
  1002. #--------------------------------------------------------------------------
  1003. def hud_visible(value = true)
  1004. $game_system.hud_visible = value
  1005. end
  1006.  
  1007. #--------------------------------------------------------------------------
  1008. # * Hud Visible
  1009. #--------------------------------------------------------------------------
  1010. def hud_position(x = 0, y = 0)
  1011. $game_system.hud_position = [x,y]
  1012. SceneManager.goto(Scene_Refresh_Map)
  1013. end
  1014.  
  1015. #--------------------------------------------------------------------------
  1016. # * Refresh Screen
  1017. #--------------------------------------------------------------------------
  1018. def refresh_screen
  1019. SceneManager.goto(Scene_Refresh_Map)
  1020. end
  1021.  
  1022. #--------------------------------------------------------------------------
  1023. # * Testing Hud
  1024. #--------------------------------------------------------------------------
  1025. def testing_hud(perc = 15, death = false)
  1026. return if $game_party.members[0] == nil
  1027. return if $game_party.members[0].hp == 0
  1028. actor = $game_party.members[0]
  1029. hp_per = actor.mhp * perc / 100
  1030. mp_per = actor.mmp * perc / 100
  1031. tp_per = actor.max_tp * perc / 100
  1032. hp_per = perc > 0 ? 1 : -1 if hp_per == 0
  1033. mp_per = perc > 0 ? 1 : -1 if mp_per == 0
  1034. tp_per = perc > 0 ? 1 : -1 if tp_per == 0
  1035. actor.hp -= hp_per
  1036. actor.hp = 1 if !death and actor.hp == 0
  1037. actor.mp -= mp_per
  1038. actor.tp -= tp_per
  1039. end
  1040.  
  1041. #--------------------------------------------------------------------------
  1042. # * Testing Hud Level
  1043. #--------------------------------------------------------------------------
  1044. def testing_hud_level
  1045. return if $game_party.members[0] == nil
  1046. actor = $game_party.members[0]
  1047. actor.change_level(actor.level + 1, false)
  1048. actor.gain_exp_test
  1049. end
  1050.  
  1051. end
  1052.  
  1053. #==============================================================================
  1054. # ** Cache
  1055. #==============================================================================
  1056. module Cache
  1057.  
  1058. #--------------------------------------------------------------------------
  1059. # * Hud
  1060. #--------------------------------------------------------------------------
  1061. def self.ultima_hud(filename)
  1062. load_bitmap("Graphics/Huds/Ultima/", filename)
  1063. end
  1064.  
  1065. end
  1066.  
  1067. #==============================================================================
  1068. # ** Game Actor
  1069. #==============================================================================
  1070. class Game_Actor < Game_Battler
  1071.  
  1072. #--------------------------------------------------------------------------
  1073. # ● Real Next Level
  1074. #--------------------------------------------------------------------------
  1075. def real_next_level
  1076. next_level_exp - exp_for_level(level)
  1077. end
  1078.  
  1079. #--------------------------------------------------------------------------
  1080. # ● Remain Exp
  1081. #--------------------------------------------------------------------------
  1082. def remain_exp
  1083. exp - exp_for_level(level)
  1084. end
  1085.  
  1086. #--------------------------------------------------------------------------
  1087. # ● Gain Exp Test
  1088. #--------------------------------------------------------------------------
  1089. def gain_exp_test
  1090. exp_r = rand(next_level_exp)
  1091. change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
  1092. end
  1093.  
  1094. #--------------------------------------------------------------------------
  1095. # ● Low HP?
  1096. #--------------------------------------------------------------------------
  1097. def low_hp?
  1098. hp <= (mhp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
  1099. end
  1100.  
  1101. #--------------------------------------------------------------------------
  1102. # ● Low MP?
  1103. #--------------------------------------------------------------------------
  1104. def low_mp?
  1105. mp <= (mmp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
  1106. end
  1107.  
  1108. #--------------------------------------------------------------------------
  1109. # ● Low TP?
  1110. #--------------------------------------------------------------------------
  1111. def low_tp?
  1112. tp <= (max_tp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
  1113. end
  1114.  
  1115. end
  1116.  
  1117. #==============================================================================
  1118. # ** Scene Refresh Map
  1119. #==============================================================================
  1120. class Scene_Refresh_Map
  1121.  
  1122. #--------------------------------------------------------------------------
  1123. # * Main
  1124. #--------------------------------------------------------------------------
  1125. def main
  1126. Graphics.transition(10)
  1127. SceneManager.goto(Scene_Map)
  1128. Graphics.freeze
  1129. end
  1130.  
  1131. end
  1132.  
  1133. #==============================================================================
  1134. # ** Spriteset Map
  1135. #==============================================================================
  1136. class Spriteset_Map
  1137.  
  1138. #--------------------------------------------------------------------------
  1139. # * Initialize
  1140. #--------------------------------------------------------------------------
  1141. alias mog_ultima_hud_initialize initialize
  1142. def initialize
  1143. create_ultima_hud
  1144. mog_ultima_hud_initialize
  1145. end
  1146.  
  1147. #--------------------------------------------------------------------------
  1148. # * Dispose
  1149. #--------------------------------------------------------------------------
  1150. alias mog_ultima_hud_dispose dispose
  1151. def dispose
  1152. mog_ultima_hud_dispose
  1153. dispose_ultima_hud
  1154. end
  1155.  
  1156. #--------------------------------------------------------------------------
  1157. # * Update
  1158. #--------------------------------------------------------------------------
  1159. alias mog_ultima_hud_update update
  1160. def update
  1161. mog_ultima_hud_update
  1162. update_ultima_hud
  1163. end
  1164.  
  1165. #--------------------------------------------------------------------------
  1166. # * Create Ultima Hud
  1167. #--------------------------------------------------------------------------
  1168. def create_ultima_hud
  1169. return if @mhud != nil
  1170. @ultima_hud = Ultima_Hud.new
  1171. end
  1172.  
  1173. #--------------------------------------------------------------------------
  1174. # * Dispose Ultima Hud
  1175. #--------------------------------------------------------------------------
  1176. def dispose_ultima_hud
  1177. return if @ultima_hud == nil
  1178. @ultima_hud.dispose
  1179. @ultima_hud = nil
  1180. end
  1181.  
  1182. #--------------------------------------------------------------------------
  1183. # * Update Ultima Hud
  1184. #--------------------------------------------------------------------------
  1185. def update_ultima_hud
  1186. return if @ultima_hud == nil
  1187. @ultima_hud.update
  1188. end
  1189.  
  1190. end
  1191.  
  1192. #==============================================================================
  1193. #==============================================================================
  1194. # ** Ultima Hud (INITIALIZE)
  1195. #==============================================================================
  1196. #==============================================================================
  1197. class Ultima_Hud
  1198. include MOG_ULTIMA_HUD
  1199.  
  1200. #--------------------------------------------------------------------------
  1201. # * Initialize
  1202. #--------------------------------------------------------------------------
  1203. def initialize
  1204. pre_cache
  1205. setup
  1206. create_sprites
  1207. end
  1208.  
  1209. #--------------------------------------------------------------------------
  1210. # * Setup
  1211. #--------------------------------------------------------------------------
  1212. def setup
  1213. @actor = $game_party.members[0]
  1214. $game_system.hud_face = [1,0]
  1215. @hp_icon_max = -1
  1216. @hp_icon_old = -1
  1217. @hp_icon_col_max = HP_ICON_COL_MAX
  1218. @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
  1219. @hp_icon_row_max = HP_ICON_ROW_MAX
  1220. @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
  1221. @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
  1222. @mp_icon_max = -1
  1223. @mp_icon_old = -1
  1224. @mp_icon_col_max = MP_ICON_COL_MAX
  1225. @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
  1226. @mp_icon_row_max = MP_ICON_ROW_MAX
  1227. @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
  1228. @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
  1229. @tp_icon_max = -1
  1230. @tp_icon_old = -1
  1231. @tp_icon_col_max = TP_ICON_COL_MAX
  1232. @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
  1233. @tp_icon_row_max = TP_ICON_ROW_MAX
  1234. @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
  1235. @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
  1236. setup_actor
  1237. end
  1238.  
  1239. #--------------------------------------------------------------------------
  1240. # * Setup Actor
  1241. #--------------------------------------------------------------------------
  1242. def setup_actor
  1243. return if @actor == nil
  1244. @hp_number_refresh = true
  1245. @hp_number2_refresh = true
  1246. @hp_number_old = @actor.hp
  1247. @hp_number2_old = @actor.mhp
  1248. @hp_old_meter = 0
  1249. @mp_number_refresh = true
  1250. @mp_number2_refresh = true
  1251. @mp_number_old = @actor.mp
  1252. @mp_number2_old = @actor.mmp
  1253. @mp_old_meter = 0
  1254. @tp_number_refresh = true
  1255. @tp_number2_refresh = true
  1256. @tp_number_old = @actor.tp
  1257. @tp_number2_old = @actor.max_tp
  1258. @tp_old_meter = 0
  1259. end
  1260.  
  1261. #--------------------------------------------------------------------------
  1262. # * Create Sprites
  1263. #--------------------------------------------------------------------------
  1264. def create_sprites
  1265. dispose
  1266. return if @actor == nil
  1267. create_layout
  1268. create_layout_2
  1269. create_name
  1270. create_face
  1271. create_hp_number
  1272. create_hp_number_max
  1273. create_hp_meter
  1274. create_hp_icon
  1275. create_hp_icon_ex
  1276. create_hp_icon_number
  1277. create_mp_number
  1278. create_mp_number_max
  1279. create_mp_meter
  1280. create_mp_icon
  1281. create_mp_icon_ex
  1282. create_mp_icon_number
  1283. create_tp_number
  1284. create_tp_number_max
  1285. create_tp_meter
  1286. create_tp_icon
  1287. create_tp_icon_ex
  1288. create_tp_icon_number
  1289. create_level_number
  1290. create_level_number_exp
  1291. create_level_meter
  1292. create_states
  1293. create_equipment
  1294. create_gold
  1295. update
  1296. end
  1297.  
  1298. end
  1299.  
  1300. #==============================================================================
  1301. #==============================================================================
  1302. # ** Ultima Hud (PRE CACHE)
  1303. #==============================================================================
  1304. #==============================================================================
  1305. class Ultima_Hud
  1306.  
  1307. #--------------------------------------------------------------------------
  1308. # * Pre Cache
  1309. #--------------------------------------------------------------------------
  1310. def pre_cache
  1311. @force_hide = false
  1312. @force_hide_time = 0
  1313. @fade_hud = false
  1314. @fade_hud_gold = false
  1315. @fade_hud_equip = false
  1316. #------------------------------------------------
  1317. # HP
  1318. #------------------------------------------------
  1319. if HP_NUMBER_VISIBLE
  1320. @hp_number_image = Cache.ultima_hud("HP_Number")
  1321. @hp_number_cw = @hp_number_image.width / 10
  1322. if HP_NUMBER_LOW_COLOR
  1323. @hp_number_ch = @hp_number_image.height / 2
  1324. else
  1325. @hp_number_ch = @hp_number_image.height
  1326. end
  1327. @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
  1328. @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number
  1329. end
  1330. if HP_NUMBER_MAX_VISIBLE
  1331. @hp_number2_image = Cache.ultima_hud("HP_Number_Max")
  1332. @hp_number2_cw = @hp_number2_image.width / 10
  1333. @hp_number2_ch = @hp_number2_image.height
  1334. end
  1335. if HP_METER_VISIBLE
  1336. @hp_meter_image = Cache.ultima_hud("HP_Meter")
  1337. if HP_METER_GRADIENT_ANIMATION
  1338. @hp_meter_cw = @hp_meter_image.width / 3
  1339. else
  1340. @hp_meter_cw = @hp_meter_image.width
  1341. end
  1342. if HP_METER_REDUCTION_ANIMATION
  1343. @hp_meter_ch = @hp_meter_image.height / 2
  1344. else
  1345. @hp_meter_ch = @hp_meter_image.height
  1346. end
  1347. end
  1348. if HP_ICON_VISIBLE
  1349. @hp_icon_image = Cache.ultima_hud("HP_Icon")
  1350. @hp_icon_cw = @hp_icon_image.width / 2
  1351. @hp_icon_ch = @hp_icon_image.height
  1352. end
  1353. if HP_ICON_EX_VISIBLE
  1354. @hp_icon2_image = Cache.ultima_hud("HP_Icon_EX")
  1355. @hp_icon2_cw = @hp_icon2_image.width
  1356. @hp_icon2_ch = @hp_icon2_image.height
  1357. end
  1358. if HP_ICON_NUMBER_VISIBLE
  1359. @hp_icon_number_image = Cache.ultima_hud("HP_Icon_Number")
  1360. @hp_icon_number_cw = @hp_icon_number_image.width / 10
  1361. @hp_icon_number_ch = @hp_icon_number_image.height
  1362. end
  1363. #------------------------------------------------
  1364. # MP
  1365. #------------------------------------------------
  1366. if MP_NUMBER_VISIBLE
  1367. @mp_number_image = Cache.ultima_hud("MP_Number")
  1368. @mp_number_cw = @mp_number_image.width / 10
  1369. if MP_NUMBER_LOW_COLOR
  1370. @mp_number_ch = @mp_number_image.height / 2
  1371. else
  1372. @mp_number_ch = @mp_number_image.height
  1373. end
  1374. @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
  1375. @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
  1376. end
  1377. if MP_NUMBER_MAX_VISIBLE
  1378. @mp_number2_image = Cache.ultima_hud("MP_Number_Max")
  1379. @mp_number2_cw = @mp_number2_image.width / 10
  1380. @mp_number2_ch = @mp_number2_image.height
  1381. end
  1382. if MP_METER_VISIBLE
  1383. @mp_meter_image = Cache.ultima_hud("MP_Meter")
  1384. if MP_METER_GRADIENT_ANIMATION
  1385. @mp_meter_cw = @mp_meter_image.width / 3
  1386. else
  1387. @mp_meter_cw = @mp_meter_image.width
  1388. end
  1389. if MP_METER_REDUCTION_ANIMATION
  1390. @mp_meter_ch = @mp_meter_image.height / 2
  1391. else
  1392. @mp_meter_ch = @mp_meter_image.height
  1393. end
  1394. end
  1395. if MP_ICON_VISIBLE
  1396. @mp_icon_image = Cache.ultima_hud("MP_Icon")
  1397. @mp_icon_cw = @mp_icon_image.width / 2
  1398. @mp_icon_ch = @mp_icon_image.height
  1399. end
  1400. if MP_ICON_EX_VISIBLE
  1401. @mp_icon2_image = Cache.ultima_hud("MP_Icon_EX")
  1402. @mp_icon2_cw = @mp_icon2_image.width
  1403. @mp_icon2_ch = @mp_icon2_image.height
  1404. end
  1405. if MP_ICON_NUMBER_VISIBLE
  1406. @mp_icon_number_image = Cache.ultima_hud("MP_Icon_Number")
  1407. @mp_icon_number_cw = @mp_icon_number_image.width / 10
  1408. @mp_icon_number_ch = @mp_icon_number_image.height
  1409. end
  1410. #------------------------------------------------
  1411. # TP
  1412. #------------------------------------------------
  1413. if TP_NUMBER_VISIBLE
  1414. @tp_number_image = Cache.ultima_hud("TP_Number")
  1415. @tp_number_cw = @tp_number_image.width / 10
  1416. if TP_NUMBER_LOW_COLOR
  1417. @tp_number_ch = @tp_number_image.height / 2
  1418. else
  1419. @tp_number_ch = @tp_number_image.height
  1420. end
  1421. @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
  1422. @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number
  1423. end
  1424. if TP_NUMBER_MAX_VISIBLE
  1425. @tp_number2_image = Cache.ultima_hud("TP_Number_Max")
  1426. @tp_number2_cw = @tp_number2_image.width / 10
  1427. @tp_number2_ch = @tp_number2_image.height
  1428. end
  1429. if TP_METER_VISIBLE
  1430. @tp_meter_image = Cache.ultima_hud("TP_Meter")
  1431. if TP_METER_GRADIENT_ANIMATION
  1432. @tp_meter_cw = @tp_meter_image.width / 3
  1433. else
  1434. @tp_meter_cw = @tp_meter_image.width
  1435. end
  1436. if TP_METER_REDUCTION_ANIMATION
  1437. @tp_meter_ch = @tp_meter_image.height / 2
  1438. else
  1439. @tp_meter_ch = @tp_meter_image.height
  1440. end
  1441. end
  1442. if TP_ICON_VISIBLE
  1443. @tp_icon_image = Cache.ultima_hud("TP_Icon")
  1444. @tp_icon_cw = @tp_icon_image.width / 2
  1445. @tp_icon_ch = @tp_icon_image.height
  1446. end
  1447. if TP_ICON_EX_VISIBLE
  1448. @tp_icon2_image = Cache.ultima_hud("TP_Icon_EX")
  1449. @tp_icon2_cw = @tp_icon2_image.width
  1450. @tp_icon2_ch = @tp_icon2_image.height
  1451. end
  1452. if TP_ICON_NUMBER_VISIBLE
  1453. @tp_icon_number_image = Cache.ultima_hud("TP_Icon_Number")
  1454. @tp_icon_number_cw = @tp_icon_number_image.width / 10
  1455. @tp_icon_number_ch = @tp_icon_number_image.height
  1456. end
  1457. #------------------------------------------------
  1458. # LV
  1459. #------------------------------------------------
  1460. if LEVEL_NUMBER_VISIBLE
  1461. @lv_number_image = Cache.ultima_hud("LV_Number")
  1462. @lv_number_cw = @lv_number_image.width / 10
  1463. @lv_number_ch = @lv_number_image.height
  1464. end
  1465. if LEVEL_NUMBER_EXP_VISIBLE
  1466. @lv_number2_image = Cache.ultima_hud("LV_Number_Exp")
  1467. @lv_number2_cw = @lv_number2_image.width / 10
  1468. @lv_number2_ch = @lv_number2_image.height
  1469. end
  1470. if LEVEL_METER_VISIBLE
  1471. @lv_meter_image = Cache.ultima_hud("LV_Meter")
  1472. @lv_meter_cw = @lv_meter_image.width
  1473. @lv_meter_ch = @lv_meter_image.height
  1474. end
  1475. #------------------------------------------------
  1476. # ICON
  1477. #------------------------------------------------
  1478. if STATES_VISIBLE or EQUIPMENT_VISIBLE
  1479. @icon_image = Cache.system("Iconset")
  1480. end
  1481. end
  1482.  
  1483. #--------------------------------------------------------------------------
  1484. # * Check Icon Image
  1485. #--------------------------------------------------------------------------
  1486. def check_icon_image
  1487. if @icon_image == nil or @icon_image.disposed?
  1488. @icon_image = Cache.system("Iconset")
  1489. end
  1490. end
  1491.  
  1492. end
  1493.  
  1494. #==============================================================================
  1495. #==============================================================================
  1496. # ** Ultima Hud (SPRITE SYSTEM)
  1497. #==============================================================================
  1498. #==============================================================================
  1499. class Ultima_Hud
  1500.  
  1501. #--------------------------------------------------------------------------
  1502. # * Update Number
  1503. #--------------------------------------------------------------------------
  1504. def update_number(type,value)
  1505. actor_value = @actor.hp if type == 0
  1506. actor_value = @actor.mp if type == 1
  1507. actor_value = @actor.tp if type == 2
  1508. actor_value = @actor.mhp if type == 3
  1509. actor_value = @actor.mmp if type == 4
  1510. actor_value = @actor.max_tp if type == 5
  1511. actor_value = $game_party.gold if type == 6
  1512. if value < actor_value
  1513. value += number_refresh_speed(actor_value,value)
  1514. value = actor_value if value >= actor_value
  1515. refresh_sprite_number(type,value)
  1516. elsif value > actor_value
  1517. value -= number_refresh_speed(actor_value,value)
  1518. value = actor_value if value <= actor_value
  1519. refresh_sprite_number(type,value)
  1520. end
  1521. end
  1522.  
  1523. #--------------------------------------------------------------------------
  1524. # * Number Refresh Speed
  1525. #--------------------------------------------------------------------------
  1526. def number_refresh_speed(actor_value,value)
  1527. n = 1 * (actor_value - value).abs / 10
  1528. return [[n, 99999999].min,1].max
  1529. end
  1530.  
  1531. #--------------------------------------------------------------------------
  1532. # * Update Number Fix
  1533. #--------------------------------------------------------------------------
  1534. def update_number_fix(type)
  1535. if type == 0
  1536. @hp_number_old = @actor.hp
  1537. @hp_number_refresh = true
  1538. elsif type == 1
  1539. @mp_number_old = @actor.mp
  1540. @mp_number_refresh = true
  1541. elsif type == 2
  1542. @tp_number_old = @actor.tp
  1543. @tp_number_refresh = true
  1544. elsif type == 3
  1545. @hp_number2_old = @actor.mhp
  1546. @hp_number2_refresh = true
  1547. elsif type == 4
  1548. @mp_number2_old = @actor.mmp
  1549. @mp_number2_refresh = true
  1550. elsif type == 5
  1551. @tp_number2_old = @actor.max_tp
  1552. @tp_number2_refresh = true
  1553. end
  1554. end
  1555.  
  1556. #--------------------------------------------------------------------------
  1557. # * Refresh Sprite Number
  1558. #--------------------------------------------------------------------------
  1559. def refresh_sprite_number(type,value)
  1560. @hp_number_refresh = true if type == 0
  1561. @hp_number_old = value if type == 0
  1562. @mp_number_refresh = true if type == 1
  1563. @mp_number_old = value if type == 1
  1564. @tp_number_refresh = true if type == 2
  1565. @tp_number_old = value if type == 2
  1566. @hp_number2_refresh = true if type == 3
  1567. @hp_number2_old = value if type == 3
  1568. @mp_number2_refresh = true if type == 4
  1569. @mp_number2_old = value if type == 4
  1570. @tp_number2_refresh = true if type == 5
  1571. @tp_number2_old = value if type == 5
  1572. @gold_refresh = true if type == 6
  1573. @gold_old = value if type == 6
  1574. end
  1575.  
  1576. #--------------------------------------------------------------------------
  1577. # * Refresh Number
  1578. #--------------------------------------------------------------------------
  1579. def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
  1580. sprite.bitmap.clear
  1581. clear_number_refresh(type)
  1582. number_color = low_number_color(type,number_ch)
  1583. if type == 0 and HP_NUMBER_PERCENTAGE
  1584. value_max = @actor.mhp
  1585. value = value.to_f / value_max.to_f * 100
  1586. value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
  1587. elsif type == 1 and MP_NUMBER_PERCENTAGE
  1588. value_max = @actor.mmp
  1589. value = value.to_f / value_max.to_f * 100
  1590. elsif type == 2 and TP_NUMBER_PERCENTAGE
  1591. value_max = @actor.max_tp
  1592. value = value.to_f / value_max.to_f * 100
  1593. elsif type == 3 and HP_NUMBER_PERCENTAGE
  1594. value = 100
  1595. elsif type == 4 and MP_NUMBER_PERCENTAGE
  1596. value = 100
  1597. elsif type == 5 and TP_NUMBER_PERCENTAGE
  1598. value = 100
  1599. end
  1600. value = 9999999 if value > 9999999
  1601. number_value = value.truncate.abs.to_s.split(//)
  1602. wave_h = 0
  1603. wave_h2 = wave_number ? (number_ch / 3) : 0
  1604. wave_h3 = number_color != 0 ? wave_h2 : 0
  1605. for r in 0..number_value.size - 1
  1606. number_value_abs = number_value[r].to_i
  1607. wh = wave_h2 * wave_h
  1608. wh2 = wave_h == 0 ? wave_h2 : 0
  1609. nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
  1610. sprite.bitmap.blt(number_cw * r, wh, image, nsrc_rect)
  1611. wave_h = wave_h == 0 ? 1 : 0
  1612. end
  1613. refresh_number_position(type,number_value.size,number_cw)
  1614. end
  1615.  
  1616. #--------------------------------------------------------------------------
  1617. # * Refresh Number
  1618. #--------------------------------------------------------------------------
  1619. def refresh_number_position(type,number_value,number_cw)
  1620. cx = number_value * number_cw
  1621. if type == 0
  1622. case HP_NUMBER_ALIGN_TYPE
  1623. when 0; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0]
  1624. when 1; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
  1625. when 2; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0] - cx
  1626. end
  1627. elsif type == 1
  1628. case MP_NUMBER_ALIGN_TYPE
  1629. when 0; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0]
  1630. when 1; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
  1631. when 2; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0] - cx
  1632. end
  1633. elsif type == 2
  1634. case TP_NUMBER_ALIGN_TYPE
  1635. when 0; @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0]
  1636. when 1; @tp_number.x = $game_system.hud_position[0]+ TP_NUMBER_POSITION[0] - (cx / 2)
  1637. when 2; @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0] - cx
  1638. end
  1639. elsif type == 3
  1640. case HP_NUMBER_ALIGN_TYPE
  1641. when 0; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  1642. when 1; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
  1643. when 2; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
  1644. end
  1645. elsif type == 4
  1646. case MP_NUMBER_ALIGN_TYPE
  1647. when 0; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  1648. when 1; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
  1649. when 2; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
  1650. end
  1651. elsif type == 5
  1652. case TP_NUMBER_ALIGN_TYPE
  1653. when 0; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  1654. when 1; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
  1655. when 2; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
  1656. end
  1657. elsif type == 6
  1658. case GOLD_NUMBER_ALIGN_TYPE
  1659. when 0; @gold_number.x = @gold_pos[0]
  1660. when 1; @gold_number.x = @gold_pos[0] - (cx / 2)
  1661. when 2; @gold_number.x = @gold_pos[0] - cx
  1662. end
  1663. end
  1664. end
  1665.  
  1666. #--------------------------------------------------------------------------
  1667. # * Low Number Color
  1668. #--------------------------------------------------------------------------
  1669. def low_number_color(type,number_ch)
  1670. if type == 0
  1671. if HP_NUMBER_LOW_COLOR
  1672. return @actor.low_hp? ? number_ch : 0
  1673. else
  1674. return 0
  1675. end
  1676. elsif type == 1
  1677. if MP_NUMBER_LOW_COLOR
  1678. return @actor.low_mp? ? number_ch : 0
  1679. else
  1680. return 0
  1681. end
  1682. elsif type == 2
  1683. if TP_NUMBER_LOW_COLOR
  1684. return @actor.low_tp? ? number_ch : 0
  1685. else
  1686. return 0
  1687. end
  1688. else
  1689. return 0
  1690. end
  1691. end
  1692.  
  1693. #--------------------------------------------------------------------------
  1694. # * Clear Number Refresh
  1695. #--------------------------------------------------------------------------
  1696. def clear_number_refresh(type)
  1697. @hp_number_refresh = false if type == 0
  1698. @mp_number_refresh = false if type == 1
  1699. @tp_number_refresh = false if type == 2
  1700. @hp_number2_refresh = false if type == 3
  1701. @mp_number2_refresh = false if type == 4
  1702. @tp_number2_refresh = false if type == 5
  1703. @gold_refresh = false if type == 6
  1704. end
  1705.  
  1706. #--------------------------------------------------------------------------
  1707. # * Fade Sprite
  1708. #--------------------------------------------------------------------------
  1709. def fade_sprite(sprite,fade_hud)
  1710. if @force_hide
  1711. sprite.opacity = 0 if @force_hide_time > 5
  1712. else
  1713. if fade_hud
  1714. sprite.opacity -= 15 if sprite.opacity > SMART_FADE_LIMIT
  1715. sprite.opacity = SMART_FADE_LIMIT if sprite.opacity < SMART_FADE_LIMIT
  1716. else
  1717. sprite.opacity += 15
  1718. end
  1719. end
  1720. end
  1721.  
  1722. #--------------------------------------------------------------------------
  1723. # * Icon Limit
  1724. #--------------------------------------------------------------------------
  1725. def icon_limit(value,value_max)
  1726. n1 = value / value_max
  1727. n2 = value - (n1 * value_max)
  1728. n2 = value_max if (n2 == 0 and value > 0)
  1729. return n2
  1730. end
  1731.  
  1732. end
  1733.  
  1734. #==============================================================================
  1735. #==============================================================================
  1736. # ** Ultima Hud (LAYOUT)
  1737. #==============================================================================
  1738. #==============================================================================
  1739. class Ultima_Hud
  1740.  
  1741. #--------------------------------------------------------------------------
  1742. # * Create Layout
  1743. #--------------------------------------------------------------------------
  1744. def create_layout
  1745. @layout = Sprite.new
  1746. @layout.bitmap = Cache.ultima_hud("Layout")
  1747. @layout.z = HUD_Z
  1748. @layout.x = $game_system.hud_position[0]
  1749. @layout.y = $game_system.hud_position[1]
  1750. @layout.opacity = 0 if !$game_system.hud_visible
  1751. @hud_size_x = [$game_system.hud_position[0] + SMART_FADE_RANGE_X[0], $game_system.hud_position[0] + @layout.bitmap.width + SMART_FADE_RANGE_X[1]]
  1752. @hud_size_y = [$game_system.hud_position[1] + SMART_FADE_RANGE_Y[0], $game_system.hud_position[1] + @layout.bitmap.height + SMART_FADE_RANGE_Y[1]]
  1753. end
  1754.  
  1755. #--------------------------------------------------------------------------
  1756. # * Update Layout
  1757. #--------------------------------------------------------------------------
  1758. def update_layout
  1759. return if @layout == nil
  1760. fade_sprite(@layout,@fade_hud)
  1761. end
  1762.  
  1763. #--------------------------------------------------------------------------
  1764. # * Create Layout
  1765. #--------------------------------------------------------------------------
  1766. def create_layout_2
  1767. return if !SECOND_LAYOUT
  1768. @layout2 = Sprite.new
  1769. @layout2.bitmap = Cache.ultima_hud("Layout_2")
  1770. @layout2.z = HUD_Z + SECOND_LAYOUT_Z
  1771. @layout2.x = $game_system.hud_position[0] + SECOND_LAYOUT_POSITION[0]
  1772. @layout2.y = $game_system.hud_position[1] + SECOND_LAYOUT_POSITION[1]
  1773. @layout2.opacity = 0 if !$game_system.hud_visible
  1774. end
  1775.  
  1776. #--------------------------------------------------------------------------
  1777. # * Update Layout
  1778. #--------------------------------------------------------------------------
  1779. def update_layout_2
  1780. return if @layout2 == nil
  1781. fade_sprite(@layout2,@fade_hud)
  1782. end
  1783.  
  1784. end
  1785.  
  1786. #==============================================================================
  1787. #==============================================================================
  1788. # ** Ultima Hud (NAME)
  1789. #==============================================================================
  1790. #==============================================================================
  1791. class Ultima_Hud
  1792.  
  1793. #--------------------------------------------------------------------------
  1794. # * Create Name
  1795. #--------------------------------------------------------------------------
  1796. def create_name
  1797. return if !NAME_VISIBLE
  1798. @name = Sprite.new
  1799. @name.bitmap = Bitmap.new(160,32)
  1800. @name.bitmap.font.name = NAME_FONT_NAME
  1801. @name.bitmap.font.size = NAME_FONT_SIZE
  1802. @name.bitmap.font.bold = NAME_FONT_BOLD
  1803. @name.bitmap.font.italic = NAME_FONT_ITALIC
  1804. @name.bitmap.font.color = NAME_FONT_COLOR
  1805. @name.z = HUD_Z + NAME_Z
  1806. @name.x = $game_system.hud_position[0] + NAME_POSITION[0]
  1807. @name.y = $game_system.hud_position[1] + NAME_POSITION[1]
  1808. @name.opacity = 0 if !$game_system.hud_visible
  1809. refresh_name
  1810. end
  1811.  
  1812. #--------------------------------------------------------------------------
  1813. # * Refresh Name
  1814. #--------------------------------------------------------------------------
  1815. def refresh_name
  1816. return if @name == nil
  1817. @name.bitmap.clear
  1818. if NAME_FONT_SHADOW
  1819. @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
  1820. @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
  1821. @name.bitmap.font.color = NAME_FONT_COLOR
  1822. end
  1823. @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
  1824. end
  1825.  
  1826. #--------------------------------------------------------------------------
  1827. # * Update Name
  1828. #--------------------------------------------------------------------------
  1829. def update_name
  1830. return if @name == nil
  1831. fade_sprite(@name,@fade_hud)
  1832. end
  1833.  
  1834. end
  1835.  
  1836. #==============================================================================
  1837. #==============================================================================
  1838. # ** Ultima Hud (HP)
  1839. #==============================================================================
  1840. #==============================================================================
  1841. class Ultima_Hud
  1842.  
  1843. #--------------------------------------------------------------------------
  1844. # * Create HP Number
  1845. #--------------------------------------------------------------------------
  1846. def create_hp_number
  1847. return if !HP_NUMBER_VISIBLE
  1848. @hp_number = Sprite.new
  1849. @hp_number.bitmap = Bitmap.new(@hp_number_cw * 4,@hp_number_ch)
  1850. @hp_number.z = HUD_Z + HP_NUMBER_Z
  1851. @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0]
  1852. @hp_number.y = $game_system.hud_position[1] + HP_NUMBER_POSITION[1]
  1853. @hp_number.opacity = 0 if !$game_system.hud_visible
  1854. end
  1855.  
  1856. #--------------------------------------------------------------------------
  1857. # * Create HP Number Max
  1858. #--------------------------------------------------------------------------
  1859. def create_hp_number_max
  1860. return if !HP_NUMBER_MAX_VISIBLE
  1861. @hp_number2 = Sprite.new
  1862. @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 4,@hp_number2_ch)
  1863. @hp_number2.z = HUD_Z + HP_NUMBER_Z
  1864. @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0]
  1865. @hp_number2.y = $game_system.hud_position[1] + HP_NUMBER_MAX_POSITION[1]
  1866. @hp_number2.opacity = 0 if !$game_system.hud_visible
  1867. end
  1868.  
  1869. #--------------------------------------------------------------------------
  1870. # * Create HP Meter
  1871. #--------------------------------------------------------------------------
  1872. def create_hp_meter
  1873. return if !HP_METER_VISIBLE
  1874. @hp_flow_max = @hp_meter_cw * 2
  1875. @hp_flow = rand(@hp_flow_max)
  1876. @hp_meter = Sprite.new
  1877. @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
  1878. @hp_meter.z = HUD_Z + HP_METER_Z
  1879. @hp_meter.x = $game_system.hud_position[0] + HP_METER_POSITION[0]
  1880. @hp_meter.y = $game_system.hud_position[1] + HP_METER_POSITION[1]
  1881. @hp_meter.angle = HP_METER_ANGLE
  1882. @hp_meter.mirror = HP_METER_MIRROR_EFFECT
  1883. @hp_meter.opacity = 0 if !$game_system.hud_visible
  1884. end
  1885.  
  1886. #--------------------------------------------------------------------------
  1887. # ● Update Flow HP
  1888. #--------------------------------------------------------------------------
  1889. def update_flow_hp
  1890. @hp_meter.bitmap.clear
  1891. @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
  1892. meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
  1893. meter_width = 0 if meter_width == nil
  1894. execute_hp_damage_flow(meter_width)
  1895. meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
  1896. @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)
  1897. @hp_flow += 5
  1898. @hp_flow = 0 if @hp_flow >= @hp_flow_max
  1899. end
  1900.  
  1901. #--------------------------------------------------------------------------
  1902. # ● Execute HP Damage Flow
  1903. #--------------------------------------------------------------------------
  1904. def execute_hp_damage_flow(meter_width)
  1905. return if !HP_METER_REDUCTION_ANIMATION
  1906. return if @hp_old_meter == meter_width
  1907. n = (@hp_old_meter - meter_width).abs * 3 / 100
  1908. damage_flow = [[n, 2].min,0.5].max
  1909. @hp_old_meter -= damage_flow
  1910. @hp_old_meter = meter_width if @hp_old_meter <= meter_width
  1911. src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
  1912. @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)
  1913. end
  1914.  
  1915. #--------------------------------------------------------------------------
  1916. # * Create HP Icon
  1917. #--------------------------------------------------------------------------
  1918. def create_hp_icon
  1919. return if !HP_ICON_VISIBLE
  1920. @hp_icon = Sprite.new
  1921. icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
  1922. icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
  1923. @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  1924. @hp_icon.z = HUD_Z + HP_ICON_Z
  1925. @hp_icon.x = $game_system.hud_position[0] + HP_ICON_POSITION[0]
  1926. @hp_icon.y = $game_system.hud_position[1] + HP_ICON_POSITION[1]
  1927. @hp_icon.opacity = 0 if !$game_system.hud_visible
  1928. end
  1929.  
  1930. #--------------------------------------------------------------------------
  1931. # * Refresh HP Icon
  1932. #--------------------------------------------------------------------------
  1933. def refresh_hp_icon
  1934. @hp_icon_old = @actor.hp
  1935. @hp_icon.bitmap.clear
  1936. max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
  1937. if @actor.hp > max_value
  1938. icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
  1939. else
  1940. icon_max = @actor.mhp
  1941. end
  1942. for i in 0...icon_max
  1943. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  1944. 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)
  1945. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  1946. i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
  1947. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  1948. end
  1949. icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
  1950. rx = 0
  1951. ry = 0
  1952. for i in 0...icon_max
  1953. break if (i / @hp_icon_col_max) >= @hp_icon_row_max
  1954. 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)
  1955. ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
  1956. i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
  1957. @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
  1958. end
  1959. refresh_hp_icon_ex(rx,ry)
  1960. end
  1961.  
  1962. #--------------------------------------------------------------------------
  1963. # * Create HP Icon EX
  1964. #--------------------------------------------------------------------------
  1965. def create_hp_icon_ex
  1966. return if !HP_ICON_EX_VISIBLE
  1967. @hp_icon3_anime_phase = 0
  1968. @hp_icon3 = Sprite.new
  1969. @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
  1970. @hp_icon3.ox = @hp_icon3.bitmap.width / 2
  1971. @hp_icon3.oy = @hp_icon3.bitmap.height / 2
  1972. @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
  1973. @hp_icon3_org = [$game_system.hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
  1974. $game_system.hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
  1975. @hp_icon3.x = @hp_icon3_org[0]
  1976. @hp_icon3.y = @hp_icon3_org[1]
  1977. @hp_icon3.opacity = 0 if !$game_system.hud_visible
  1978. end
  1979.  
  1980. #--------------------------------------------------------------------------
  1981. # * Refresh HP Icon EX
  1982. #--------------------------------------------------------------------------
  1983. def refresh_hp_icon_ex(rx,ry)
  1984. return if @hp_icon3 == nil
  1985. @hp_icon3.bitmap.clear
  1986. return if @actor.hp == 0
  1987. i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
  1988. @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
  1989. @hp_icon3.x = @hp_icon3_org[0] + rx
  1990. @hp_icon3.y = @hp_icon3_org[1] + ry
  1991. end
  1992.  
  1993. #--------------------------------------------------------------------------
  1994. # * Update Icon HP EX Anime
  1995. #--------------------------------------------------------------------------
  1996. def update_icon_hp_ex_anime
  1997. return if !HP_ICON_EX_ZOOM_EFFECT
  1998. if @hp_icon3_anime_phase == 0
  1999. @hp_icon3.zoom_x += 0.01
  2000. if @hp_icon3.zoom_x >= 1.30
  2001. @hp_icon3.zoom_x = 1.30
  2002. @hp_icon3_anime_phase = 1
  2003. end
  2004. else
  2005. @hp_icon3.zoom_x -= 0.01
  2006. if @hp_icon3.zoom_x <= 1.05
  2007. @hp_icon3.zoom_x = 1.05
  2008. @hp_icon3_anime_phase = 0
  2009. end
  2010. end
  2011. @hp_icon3.zoom_y = @hp_icon3.zoom_x
  2012. end
  2013.  
  2014. #--------------------------------------------------------------------------
  2015. # * Create HP Icon Nummber
  2016. #--------------------------------------------------------------------------
  2017. def create_hp_icon_number
  2018. return if !HP_ICON_NUMBER_VISIBLE
  2019. @hp_icon_number_old = [-1,-1]
  2020. @hp_icon_number = Sprite.new
  2021. @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
  2022. @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
  2023. @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  2024. @hp_icon_number.y = $game_system.hud_position[1] + HP_ICON_NUMBER_POSITION[1]
  2025. @hp_icon_number.opacity = 0 if !$game_system.hud_visible
  2026. end
  2027.  
  2028. #--------------------------------------------------------------------------
  2029. # * Refresh Icon Number HP
  2030. #--------------------------------------------------------------------------
  2031. def refresh_icon_number_hp
  2032. @hp_icon_number_old[0] = @actor.hp
  2033. @hp_icon_number_old[1] = @actor.mhp
  2034. @hp_icon_number.bitmap.clear
  2035. value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
  2036. value = 0 if value < 0
  2037. number_value = value.truncate.abs.to_s.split(//)
  2038. for r in 0..number_value.size - 1
  2039. number_value_abs = number_value[r].to_i
  2040. nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
  2041. @hp_icon_number.bitmap.blt(@hp_icon_number_cw * r, 0, @hp_icon_number_image, nsrc_rect)
  2042. end
  2043. cx = (number_value.size * @hp_icon_number_cw)
  2044. case HP_ICON_NUMBER_ALIGN_TYPE
  2045. when 0; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0]
  2046. when 1; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
  2047. when 2; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
  2048. end
  2049. end
  2050.  
  2051. #--------------------------------------------------------------------------
  2052. # * Can Refresh Icon Number HP
  2053. #--------------------------------------------------------------------------
  2054. def can_refresh_icon_number_hp?
  2055. return true if @hp_icon_number_old[0] != @actor.hp
  2056. return true if @hp_icon_number_old[1] != @actor.mhp
  2057. return false
  2058. end
  2059.  
  2060. #--------------------------------------------------------------------------
  2061. # * Update HP
  2062. #--------------------------------------------------------------------------
  2063. def update_hp
  2064. if @hp_number != nil
  2065. if HP_NUMBER_ANIMATION
  2066. update_number(0,@hp_number_old)
  2067. else
  2068. update_number_fix(0) if @hp_number_old != @actor.hp
  2069. end
  2070. refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
  2071. fade_sprite(@hp_number,@fade_hud)
  2072. end
  2073. if @hp_number2 != nil
  2074. if HP_NUMBER_ANIMATION
  2075. update_number(3,@hp_number2_old)
  2076. else
  2077. update_number_fix(3) if @hp_number2_old != @actor.mhp
  2078. end
  2079. refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
  2080. fade_sprite(@hp_number2,@fade_hud)
  2081. end
  2082. if @hp_meter != nil
  2083. update_flow_hp
  2084. fade_sprite(@hp_meter,@fade_hud)
  2085. end
  2086. if @hp_icon != nil
  2087. refresh_hp_icon if @hp_icon_old != @actor.hp
  2088. fade_sprite(@hp_icon,@fade_hud)
  2089. end
  2090. if @hp_icon3 != nil
  2091. update_icon_hp_ex_anime
  2092. fade_sprite(@hp_icon3,@fade_hud)
  2093. end
  2094. if @hp_icon_number != nil
  2095. refresh_icon_number_hp if can_refresh_icon_number_hp?
  2096. fade_sprite(@hp_icon_number,@fade_hud)
  2097. end
  2098. end
  2099.  
  2100. end
  2101.  
  2102. #==============================================================================
  2103. #==============================================================================
  2104. # ** Ultima Hud (MP)
  2105. #==============================================================================
  2106. #==============================================================================
  2107. class Ultima_Hud
  2108.  
  2109. #--------------------------------------------------------------------------
  2110. # * Create MP Number
  2111. #--------------------------------------------------------------------------
  2112. def create_mp_number
  2113. return if !MP_NUMBER_VISIBLE
  2114. @mp_number = Sprite.new
  2115. @mp_number.bitmap = Bitmap.new(@mp_number_cw * 4, @mp_number_ch)
  2116. @mp_number.z = HUD_Z + MP_NUMBER_Z
  2117. @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0]
  2118. @mp_number.y = $game_system.hud_position[1] + MP_NUMBER_POSITION[1]
  2119. @mp_number.opacity = 0 if !$game_system.hud_visible
  2120. end
  2121.  
  2122. #--------------------------------------------------------------------------
  2123. # * Create MP Number Max
  2124. #--------------------------------------------------------------------------
  2125. def create_mp_number_max
  2126. return if !MP_NUMBER_MAX_VISIBLE
  2127. @mp_number2 = Sprite.new
  2128. @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 4, @mp_number2_ch)
  2129. @mp_number2.z = HUD_Z + MP_NUMBER_Z
  2130. @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0]
  2131. @mp_number2.y = $game_system.hud_position[1] + MP_NUMBER_MAX_POSITION[1]
  2132. @mp_number2.opacity = 0 if !$game_system.hud_visible
  2133. end
  2134.  
  2135. #--------------------------------------------------------------------------
  2136. # * Create MP Meter
  2137. #--------------------------------------------------------------------------
  2138. def create_mp_meter
  2139. return if !MP_METER_VISIBLE
  2140. @mp_flow_max = @mp_meter_cw * 2
  2141. @mp_flow = rand(@mp_flow_max)
  2142. @mp_meter = Sprite.new
  2143. @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
  2144. @mp_meter.z = HUD_Z + MP_METER_Z
  2145. @mp_meter.x = $game_system.hud_position[0] + MP_METER_POSITION[0]
  2146. @mp_meter.y = $game_system.hud_position[1] + MP_METER_POSITION[1]
  2147. @mp_meter.angle = MP_METER_ANGLE
  2148. @mp_meter.mirror = MP_METER_MIRROR_EFFECT
  2149. @mp_meter.opacity = 0 if !$game_system.hud_visible
  2150. end
  2151.  
  2152. #--------------------------------------------------------------------------
  2153. # ● Update Flow MP
  2154. #--------------------------------------------------------------------------
  2155. def update_flow_mp
  2156. @mp_meter.bitmap.clear
  2157. @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
  2158. meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
  2159. meter_width = 0 if meter_width == nil
  2160. execute_mp_damage_flow(meter_width)
  2161. meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
  2162. @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)
  2163. @mp_flow += 5
  2164. @mp_flow = 0 if @mp_flow >= @mp_flow_max
  2165. end
  2166.  
  2167. #--------------------------------------------------------------------------
  2168. # ● Execute MP Damage Flow
  2169. #--------------------------------------------------------------------------
  2170. def execute_mp_damage_flow(meter_width)
  2171. return if !MP_METER_REDUCTION_ANIMATION
  2172. return if @mp_old_meter == meter_width
  2173. n = (@mp_old_meter - meter_width).abs * 3 / 100
  2174. damage_flow = [[n, 2].min,0.5].max
  2175. @mp_old_meter -= damage_flow
  2176. @mp_old_meter = meter_width if @mp_old_meter <= meter_width
  2177. src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
  2178. @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)
  2179. end
  2180.  
  2181. #--------------------------------------------------------------------------
  2182. # * Create MP Icon
  2183. #--------------------------------------------------------------------------
  2184. def create_mp_icon
  2185. return if !MP_ICON_VISIBLE
  2186. @mp_icon = Sprite.new
  2187. icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
  2188. icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
  2189. @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  2190. @mp_icon.z = HUD_Z + MP_ICON_Z
  2191. @mp_icon.x = $game_system.hud_position[0] + MP_ICON_POSITION[0]
  2192. @mp_icon.y = $game_system.hud_position[1] + MP_ICON_POSITION[1]
  2193. @mp_icon.opacity = 0 if !$game_system.hud_visible
  2194. end
  2195.  
  2196. #--------------------------------------------------------------------------
  2197. # * Refresh MP Icon
  2198. #--------------------------------------------------------------------------
  2199. def refresh_mp_icon
  2200. @mp_icon_old = @actor.mp
  2201. @mp_icon.bitmap.clear
  2202. max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
  2203. if @actor.mp > max_value
  2204. icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
  2205. else
  2206. icon_max = @actor.mmp
  2207. end
  2208. for i in 0...icon_max
  2209. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  2210. 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)
  2211. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  2212. i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
  2213. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  2214. end
  2215. icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
  2216. rx = 0
  2217. ry = 0
  2218. for i in 0...icon_max
  2219. break if (i / @mp_icon_col_max) >= @mp_icon_row_max
  2220. 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)
  2221. ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
  2222. i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
  2223. @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
  2224. end
  2225. refresh_mp_icon_ex(rx,ry)
  2226. end
  2227.  
  2228. #--------------------------------------------------------------------------
  2229. # * Create MP Icon EX
  2230. #--------------------------------------------------------------------------
  2231. def create_mp_icon_ex
  2232. return if !MP_ICON_EX_VISIBLE
  2233. @mp_icon3_anime_phase = 0
  2234. @mp_icon3 = Sprite.new
  2235. @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
  2236. @mp_icon3.ox = @mp_icon3.bitmap.width / 2
  2237. @mp_icon3.oy = @mp_icon3.bitmap.height / 2
  2238. @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
  2239. @mp_icon3_org = [$game_system.hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
  2240. $game_system.hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
  2241. @mp_icon3.x = @mp_icon3_org[0]
  2242. @mp_icon3.y = @mp_icon3_org[1]
  2243. @mp_icon3.opacity = 0 if !$game_system.hud_visible
  2244. end
  2245.  
  2246. #--------------------------------------------------------------------------
  2247. # * Refresh MP Icon EX
  2248. #--------------------------------------------------------------------------
  2249. def refresh_mp_icon_ex(rx,ry)
  2250. return if @mp_icon3 == nil
  2251. @mp_icon3.bitmap.clear
  2252. return if @actor.mp == 0
  2253. i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
  2254. @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
  2255. @mp_icon3.x = @mp_icon3_org[0] + rx
  2256. @mp_icon3.y = @mp_icon3_org[1] + ry
  2257. end
  2258.  
  2259. #--------------------------------------------------------------------------
  2260. # * Update Icon MP EX Anime
  2261. #--------------------------------------------------------------------------
  2262. def update_icon_mp_ex_anime
  2263. return if !MP_ICON_EX_ZOOM_EFFECT
  2264. if @mp_icon3_anime_phase == 0
  2265. @mp_icon3.zoom_x += 0.01
  2266. if @mp_icon3.zoom_x >= 1.30
  2267. @mp_icon3.zoom_x = 1.30
  2268. @mp_icon3_anime_phase = 1
  2269. end
  2270. else
  2271. @mp_icon3.zoom_x -= 0.01
  2272. if @mp_icon3.zoom_x <= 1.05
  2273. @mp_icon3.zoom_x = 1.05
  2274. @mp_icon3_anime_phase = 0
  2275. end
  2276. end
  2277. @mp_icon3.zoom_y = @mp_icon3.zoom_x
  2278. end
  2279.  
  2280. #--------------------------------------------------------------------------
  2281. # * Create MP Icon Number
  2282. #--------------------------------------------------------------------------
  2283. def create_mp_icon_number
  2284. return if !MP_ICON_NUMBER_VISIBLE
  2285. @mp_icon_number_old = [-1,-1]
  2286. @mp_icon_number = Sprite.new
  2287. @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
  2288. @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
  2289. @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  2290. @mp_icon_number.y = $game_system.hud_position[1] + MP_ICON_NUMBER_POSITION[1]
  2291. @mp_icon_number.opacity = 0 if !$game_system.hud_visible
  2292. end
  2293.  
  2294. #--------------------------------------------------------------------------
  2295. # * Refresh Icon Number MP
  2296. #--------------------------------------------------------------------------
  2297. def refresh_icon_number_mp
  2298. @mp_icon_number_old[0] = @actor.mp
  2299. @mp_icon_number_old[1] = @actor.mmp
  2300. @mp_icon_number.bitmap.clear
  2301. value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
  2302. value = 0 if value < 0
  2303. number_value = value.truncate.abs.to_s.split(//)
  2304. for r in 0..number_value.size - 1
  2305. number_value_abs = number_value[r].to_i
  2306. nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
  2307. @mp_icon_number.bitmap.blt(@mp_icon_number_cw * r, 0, @mp_icon_number_image, nsrc_rect)
  2308. end
  2309. cx = (number_value.size * @mp_icon_number_cw)
  2310. case MP_ICON_NUMBER_ALIGN_TYPE
  2311. when 0; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0]
  2312. when 1; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
  2313. when 2; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
  2314. end
  2315. end
  2316.  
  2317. #--------------------------------------------------------------------------
  2318. # * Can Refresh Icon Number MP
  2319. #--------------------------------------------------------------------------
  2320. def can_refresh_icon_number_mp?
  2321. return true if @mp_icon_number_old[0] != @actor.mp
  2322. return true if @mp_icon_number_old[1] != @actor.mmp
  2323. return false
  2324. end
  2325.  
  2326. #--------------------------------------------------------------------------
  2327. # * Update MP
  2328. #--------------------------------------------------------------------------
  2329. def update_mp
  2330. if @mp_number != nil
  2331. if MP_NUMBER_ANIMATION
  2332. update_number(1,@mp_number_old)
  2333. else
  2334. update_number_fix(1) if @mp_number_old != @actor.mp
  2335. end
  2336. refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
  2337. fade_sprite(@mp_number,@fade_hud)
  2338. end
  2339. if @mp_number2 != nil
  2340. if MP_NUMBER_ANIMATION
  2341. update_number(4,@mp_number2_old)
  2342. else
  2343. update_number_fix(4) if @mp_number2_old != @actor.mmp
  2344. end
  2345. refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
  2346. fade_sprite(@mp_number2,@fade_hud)
  2347. end
  2348. if @mp_meter != nil
  2349. update_flow_mp
  2350. fade_sprite(@mp_meter,@fade_hud)
  2351. end
  2352. if @mp_icon != nil
  2353. refresh_mp_icon if @mp_icon_old != @actor.mp
  2354. fade_sprite(@mp_icon,@fade_hud)
  2355. end
  2356. if @mp_icon3 != nil
  2357. update_icon_mp_ex_anime
  2358. fade_sprite(@mp_icon3,@fade_hud)
  2359. end
  2360. if @mp_icon_number != nil
  2361. refresh_icon_number_mp if can_refresh_icon_number_mp?
  2362. fade_sprite(@mp_icon_number,@fade_hud)
  2363. end
  2364. end
  2365.  
  2366. end
  2367.  
  2368. #==============================================================================
  2369. #==============================================================================
  2370. # ** Ultima Hud (TP)
  2371. #==============================================================================
  2372. #==============================================================================
  2373. class Ultima_Hud
  2374.  
  2375. #--------------------------------------------------------------------------
  2376. # * Create TP Number
  2377. #--------------------------------------------------------------------------
  2378. def create_tp_number
  2379. return if !TP_NUMBER_VISIBLE
  2380. @tp_number = Sprite.new
  2381. @tp_number.bitmap = Bitmap.new(@tp_number_cw * 3, @tp_number_ch)
  2382. @tp_number.z = HUD_Z + TP_NUMBER_Z
  2383. @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0]
  2384. @tp_number.y = $game_system.hud_position[1]+ TP_NUMBER_POSITION[1]
  2385. @tp_number.opacity = 0 if !$game_system.hud_visible
  2386. end
  2387.  
  2388. #--------------------------------------------------------------------------
  2389. # * Create TP Number MAX
  2390. #--------------------------------------------------------------------------
  2391. def create_tp_number_max
  2392. return if !TP_NUMBER_MAX_VISIBLE
  2393. @tp_number2 = Sprite.new
  2394. @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 3, @tp_number2_ch)
  2395. @tp_number2.z = HUD_Z + TP_NUMBER_Z
  2396. @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0]
  2397. @tp_number2.y = $game_system.hud_position[1] + TP_NUMBER_MAX_POSITION[1]
  2398. @tp_number2.opacity = 0 if !$game_system.hud_visible
  2399. end
  2400.  
  2401. #--------------------------------------------------------------------------
  2402. # * Create TP Meter
  2403. #--------------------------------------------------------------------------
  2404. def create_tp_meter
  2405. return if !TP_METER_VISIBLE
  2406. @tp_flow_max = @tp_meter_cw * 2
  2407. @tp_flow = rand(@tp_flow_max)
  2408. @tp_meter = Sprite.new
  2409. @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
  2410. @tp_meter.z = HUD_Z + TP_METER_Z
  2411. @tp_meter.x = $game_system.hud_position[0] + TP_METER_POSITION[0]
  2412. @tp_meter.y = $game_system.hud_position[1] + TP_METER_POSITION[1]
  2413. @tp_meter.angle = TP_METER_ANGLE
  2414. @tp_meter.mirror = TP_METER_MIRROR_EFFECT
  2415. @tp_meter.opacity = 0 if !$game_system.hud_visible
  2416. end
  2417.  
  2418. #--------------------------------------------------------------------------
  2419. # ● Update Flow TP
  2420. #--------------------------------------------------------------------------
  2421. def update_flow_tp
  2422. @tp_meter.bitmap.clear
  2423. @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
  2424. meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil
  2425. meter_width = 0 if meter_width == nil
  2426. execute_tp_damage_flow(meter_width)
  2427. meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
  2428. @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)
  2429. @tp_flow += 5
  2430. @tp_flow = 0 if @tp_flow >= @tp_flow_max
  2431. end
  2432.  
  2433. #--------------------------------------------------------------------------
  2434. # ● Execute TP Damage Flow
  2435. #--------------------------------------------------------------------------
  2436. def execute_tp_damage_flow(meter_width)
  2437. return if !TP_METER_REDUCTION_ANIMATION
  2438. return if @tp_old_meter == meter_width
  2439. n = (@tp_old_meter - meter_width).abs * 3 / 100
  2440. damage_flow = [[n, 2].min,0.5].max
  2441. @tp_old_meter -= damage_flow
  2442. @tp_old_meter = meter_width if @tp_old_meter <= meter_width
  2443. src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
  2444. @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)
  2445. end
  2446.  
  2447. #--------------------------------------------------------------------------
  2448. # * Create TP Icon
  2449. #--------------------------------------------------------------------------
  2450. def create_tp_icon
  2451. return if !TP_ICON_VISIBLE
  2452. @tp_icon = Sprite.new
  2453. icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
  2454. icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
  2455. @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)
  2456. @tp_icon.z = HUD_Z + TP_ICON_Z
  2457. @tp_icon.x = $game_system.hud_position[0] + TP_ICON_POSITION[0]
  2458. @tp_icon.y = $game_system.hud_position[1] + TP_ICON_POSITION[1]
  2459. @tp_icon.opacity = 0 if !$game_system.hud_visible
  2460. end
  2461.  
  2462. #--------------------------------------------------------------------------
  2463. # * Refresh TP Icon
  2464. #--------------------------------------------------------------------------
  2465. def refresh_tp_icon
  2466. @tp_icon_old = @actor.tp
  2467. @tp_icon.bitmap.clear
  2468. max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
  2469. if @actor.mp > max_value
  2470. icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
  2471. else
  2472. icon_max = @actor.max_tp
  2473. end
  2474. for i in 0...icon_max
  2475. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  2476. 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)
  2477. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  2478. i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
  2479. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  2480. end
  2481. icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
  2482. rx = 0
  2483. ry = 0
  2484. for i in 0...icon_max
  2485. break if (i / @tp_icon_col_max) >= @tp_icon_row_max
  2486. 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)
  2487. ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
  2488. i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
  2489. @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
  2490. end
  2491. refresh_tp_icon_ex(rx,ry)
  2492. end
  2493.  
  2494. #--------------------------------------------------------------------------
  2495. # * Create TP Icon EX
  2496. #--------------------------------------------------------------------------
  2497. def create_tp_icon_ex
  2498. return if !TP_ICON_EX_VISIBLE
  2499. @tp_icon3_anime_phase = 0
  2500. @tp_icon3 = Sprite.new
  2501. @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
  2502. @tp_icon3.ox = @tp_icon3.bitmap.width / 2
  2503. @tp_icon3.oy = @tp_icon3.bitmap.height / 2
  2504. @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
  2505. @tp_icon3_org = [$game_system.hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
  2506. $game_system.hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
  2507. @tp_icon3.x = @tp_icon3_org[0]
  2508. @tp_icon3.y = @tp_icon3_org[1]
  2509. @tp_icon3.opacity = 0 if !$game_system.hud_visible
  2510. end
  2511.  
  2512. #--------------------------------------------------------------------------
  2513. # * Refresh TP Icon EX
  2514. #--------------------------------------------------------------------------
  2515. def refresh_tp_icon_ex(rx,ry)
  2516. return if @tp_icon3 == nil
  2517. @tp_icon3.bitmap.clear
  2518. return if @actor.tp == 0
  2519. i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
  2520. @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
  2521. @tp_icon3.x = @tp_icon3_org[0] + rx
  2522. @tp_icon3.y = @tp_icon3_org[1] + ry
  2523. end
  2524.  
  2525. #--------------------------------------------------------------------------
  2526. # * Update Icon TP EX Anime
  2527. #--------------------------------------------------------------------------
  2528. def update_icon_tp_ex_anime
  2529. return if !MP_ICON_EX_ZOOM_EFFECT
  2530. if @tp_icon3_anime_phase == 0
  2531. @tp_icon3.zoom_x += 0.01
  2532. if @tp_icon3.zoom_x >= 1.30
  2533. @tp_icon3.zoom_x = 1.30
  2534. @tp_icon3_anime_phase = 1
  2535. end
  2536. else
  2537. @tp_icon3.zoom_x -= 0.01
  2538. if @tp_icon3.zoom_x <= 1.05
  2539. @tp_icon3.zoom_x = 1.05
  2540. @tp_icon3_anime_phase = 0
  2541. end
  2542. end
  2543. @tp_icon3.zoom_y = @tp_icon3.zoom_x
  2544. end
  2545.  
  2546. #--------------------------------------------------------------------------
  2547. # * Create HP Icon Number
  2548. #--------------------------------------------------------------------------
  2549. def create_tp_icon_number
  2550. return if !TP_ICON_NUMBER_VISIBLE
  2551. @tp_icon_number_old = [-1,-1]
  2552. @tp_icon_number = Sprite.new
  2553. @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
  2554. @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
  2555. @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  2556. @tp_icon_number.y = $game_system.hud_position[1] + TP_ICON_NUMBER_POSITION[1]
  2557. @tp_icon_number.opacity = 0 if !$game_system.hud_visible
  2558. end
  2559.  
  2560. #--------------------------------------------------------------------------
  2561. # * Refresh Icon Number TP
  2562. #--------------------------------------------------------------------------
  2563. def refresh_icon_number_tp
  2564. @tp_icon_number_old[0] = @actor.tp
  2565. @tp_icon_number_old[1] = @actor.max_tp
  2566. @tp_icon_number.bitmap.clear
  2567. value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
  2568. value = 0 if value < 0
  2569. number_value = value.truncate.abs.to_s.split(//)
  2570. for r in 0..number_value.size - 1
  2571. number_value_abs = number_value[r].to_i
  2572. nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
  2573. @tp_icon_number.bitmap.blt(@tp_icon_number_cw * r, 0, @tp_icon_number_image, nsrc_rect)
  2574. end
  2575. cx = (number_value.size * @tp_icon_number_cw)
  2576. case TP_ICON_NUMBER_ALIGN_TYPE
  2577. when 0; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0]
  2578. when 1; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
  2579. when 2; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
  2580. end
  2581. end
  2582.  
  2583. #--------------------------------------------------------------------------
  2584. # * Can Refresh Icon Number TP
  2585. #--------------------------------------------------------------------------
  2586. def can_refresh_icon_number_tp?
  2587. return true if @tp_icon_number_old[0] != @actor.tp
  2588. return true if @tp_icon_number_old[1] != @actor.max_tp
  2589. return false
  2590. end
  2591.  
  2592. #--------------------------------------------------------------------------
  2593. # * Update TP
  2594. #--------------------------------------------------------------------------
  2595. def update_tp
  2596. if @tp_number != nil
  2597. if MP_NUMBER_ANIMATION
  2598. update_number(2,@tp_number_old)
  2599. else
  2600. update_number_fix(2) if @tp_number_old != @actor.tp
  2601. end
  2602. refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh
  2603. fade_sprite(@tp_number,@fade_hud)
  2604. end
  2605. if @tp_number2 != nil
  2606. if MP_NUMBER_ANIMATION
  2607. update_number(5,@tp_number2_old)
  2608. else
  2609. update_number_fix(5) if @tp_number2_old != @actor.max_tp
  2610. end
  2611. refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
  2612. fade_sprite(@tp_number2,@fade_hud)
  2613. end
  2614. if @tp_meter != nil
  2615. update_flow_tp
  2616. fade_sprite(@tp_meter,@fade_hud)
  2617. end
  2618. if @tp_icon != nil
  2619. refresh_tp_icon if @tp_icon_old != @actor.tp
  2620. fade_sprite(@tp_icon,@fade_hud)
  2621. end
  2622. if @tp_icon3 != nil
  2623. update_icon_tp_ex_anime
  2624. fade_sprite(@tp_icon3,@fade_hud)
  2625. end
  2626. if @tp_icon_number != nil
  2627. refresh_icon_number_tp if can_refresh_icon_number_tp?
  2628. fade_sprite(@tp_icon_number,@fade_hud)
  2629. end
  2630. end
  2631.  
  2632. end
  2633.  
  2634. #==============================================================================
  2635. #==============================================================================
  2636. # ** Ultima Hud (LEVEL)
  2637. #==============================================================================
  2638. #==============================================================================
  2639. class Ultima_Hud
  2640.  
  2641. #--------------------------------------------------------------------------
  2642. # * Create Level Number
  2643. #--------------------------------------------------------------------------
  2644. def create_level_number
  2645. return if !LEVEL_NUMBER_VISIBLE
  2646. @old_level = -1
  2647. @lv_number = Sprite.new
  2648. @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
  2649. @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
  2650. @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0]
  2651. @lv_number.y = $game_system.hud_position[1] + LEVEL_NUMBER_POSITION[1]
  2652. @lv_number.opacity = 0 if !$game_system.hud_visible
  2653. end
  2654.  
  2655. #--------------------------------------------------------------------------
  2656. # * Create Level Number EXP
  2657. #--------------------------------------------------------------------------
  2658. def create_level_number_exp
  2659. return if !LEVEL_NUMBER_EXP_VISIBLE
  2660. @old_exp = -1
  2661. @lv_number2 = Sprite.new
  2662. @lv_number2.bitmap = Bitmap.new(@lv_number2_cw * 7, @lv_number2_ch)
  2663. @lv_number2.z = HUD_Z + LEVEL_NUMBER_Z
  2664. @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0]
  2665. @lv_number2.y = $game_system.hud_position[1] + LEVEL_NUMBER_EXP_POSITION[1]
  2666. @lv_number2.opacity = 0 if !$game_system.hud_visible
  2667. end
  2668.  
  2669. #--------------------------------------------------------------------------
  2670. # * Create Level Meter
  2671. #--------------------------------------------------------------------------
  2672. def create_level_meter
  2673. return if !LEVEL_METER_VISIBLE
  2674. @old_exp_meter = -1
  2675. @lv_meter = Sprite.new
  2676. @lv_meter.bitmap = Bitmap.new(@lv_meter_cw,@lv_meter_ch)
  2677. @lv_meter.z = HUD_Z + LEVEL_METER_Z
  2678. @lv_meter.x = $game_system.hud_position[0] + LEVEL_METER_POSITION[0]
  2679. @lv_meter.y = $game_system.hud_position[1] + LEVEL_METER_POSITION[1]
  2680. @lv_meter.angle = LEVEL_METER_ANGLE
  2681. @lv_meter.mirror = LEVEL_METER_MIRROR_EFFECT
  2682. @lv_meter.opacity = 0 if !$game_system.hud_visible
  2683. end
  2684.  
  2685. #--------------------------------------------------------------------------
  2686. # * Refresh Level Number
  2687. #--------------------------------------------------------------------------
  2688. def refresh_level_number
  2689. @lv_number.bitmap.clear
  2690. @old_level = @actor.level
  2691. number_value = @actor.level.abs.to_s.split(//)
  2692. for r in 0..number_value.size - 1
  2693. number_value_abs = number_value[r].to_i
  2694. nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
  2695. @lv_number.bitmap.blt(@lv_number_cw * r, 0, @lv_number_image, nsrc_rect)
  2696. end
  2697. cx = (number_value.size * @lv_number_cw)
  2698. case LEVEL_NUMBER_ALIGN_TYPE
  2699. when 0; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0]
  2700. when 1; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
  2701. when 2; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
  2702. end
  2703. end
  2704.  
  2705. #--------------------------------------------------------------------------
  2706. # * Refresh Level Number EXP
  2707. #--------------------------------------------------------------------------
  2708. def refresh_level_number_exp
  2709. @lv_number2.bitmap.clear
  2710. @old_exp = @actor.exp
  2711. if LEVEL_NUMBER_EXP_TYPE == 0
  2712. value = @actor.next_level_exp - @actor.exp
  2713. value = 0 if @actor.max_level?
  2714. else
  2715. value = @actor.exp
  2716. end
  2717. value = 9999999 if value > 9999999
  2718. number_value = value.abs.to_s.split(//)
  2719. for r in 0..number_value.size - 1
  2720. number_value_abs = number_value[r].to_i
  2721. nsrc_rect = Rect.new(@lv_number2_cw * number_value_abs, 0, @lv_number2_cw, @lv_number2_ch)
  2722. @lv_number2.bitmap.blt(@lv_number2_cw * r, 0, @lv_number2_image, nsrc_rect)
  2723. end
  2724. cx = (number_value.size * @lv_number2_cw)
  2725. case LEVEL_NUMBER_EXP_ALIGN_TYPE
  2726. when 0; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0]
  2727. when 1; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0] - (cx / 2)
  2728. when 2; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0] - cx
  2729. end
  2730.  
  2731. end
  2732.  
  2733. #--------------------------------------------------------------------------
  2734. # * Refresh Level Meter
  2735. #--------------------------------------------------------------------------
  2736. def refresh_level_meter
  2737. @lv_meter.bitmap.clear
  2738. @old_exp_meter = @actor.exp
  2739. new_level = 0
  2740. lv_width = @lv_meter_cw * @actor.remain_exp / @actor.real_next_level rescue nil
  2741. lv_width = @lv_meter_cw if lv_width == nil or @actor.level == 99
  2742. lv_scr = Rect.new(0,0,lv_width,@lv_meter_ch)
  2743. @lv_meter.bitmap.blt(0,0,@lv_meter_image,lv_scr)
  2744. end
  2745.  
  2746. #--------------------------------------------------------------------------
  2747. # * Update Level
  2748. #--------------------------------------------------------------------------
  2749. def update_level
  2750. if @lv_number != nil
  2751. refresh_level_number if @old_level != @actor.level
  2752. fade_sprite(@lv_number,@fade_hud)
  2753. end
  2754. if @lv_number2 != nil
  2755. refresh_level_number_exp if @old_exp != @actor.exp
  2756. fade_sprite(@lv_number2,@fade_hud)
  2757. end
  2758. if @lv_meter != nil
  2759. refresh_level_meter if @old_exp_meter != @actor.exp
  2760. fade_sprite(@lv_meter,@fade_hud)
  2761. end
  2762. end
  2763.  
  2764. end
  2765.  
  2766. #==============================================================================
  2767. #==============================================================================
  2768. # ** Ultima Hud (STATES)
  2769. #==============================================================================
  2770. #==============================================================================
  2771. class Ultima_Hud
  2772.  
  2773. #--------------------------------------------------------------------------
  2774. # * Create States
  2775. #--------------------------------------------------------------------------
  2776. def create_states
  2777. return if !STATES_VISIBLE
  2778. @status_old = nil
  2779. @status_flow = [-24,0]
  2780. @status = Sprite.new
  2781. @status.bitmap = Bitmap.new(24,24)
  2782. @status.x = $game_system.hud_position[0] + STATES_POSITION[0]
  2783. @status.y = $game_system.hud_position[1] + STATES_POSITION[1]
  2784. @status.z = HUD_Z + STATES_Z
  2785. @status.angle = STATE_ANGLE
  2786. @status.opacity = 0 if !$game_system.hud_visible
  2787. end
  2788.  
  2789. #--------------------------------------------------------------------------
  2790. # * Refresh States
  2791. #--------------------------------------------------------------------------
  2792. def refresh_states
  2793. check_icon_image
  2794. @status_old = @actor.states
  2795. @status_flow = [0,0]
  2796. @actor_status.dispose if @actor_status != nil
  2797. @states_size = @actor.states.size > 0 ? (26 * @actor.states.size) : 24
  2798. @actor_status = Bitmap.new(@states_size,24)
  2799. index = 0
  2800. for i in @actor.states
  2801. rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
  2802. @actor_status.blt(26 * index , 0, @icon_image, rect)
  2803. index += 1
  2804. end
  2805. end
  2806.  
  2807. #--------------------------------------------------------------------------
  2808. # * Flow_Status
  2809. #--------------------------------------------------------------------------
  2810. def flow_states
  2811. return if @actor_status == nil
  2812. @status.bitmap.clear
  2813. return if @actor.states.size == 0
  2814. st_src_rect = Rect.new(@status_flow[0],0, 24,24)
  2815. @status.bitmap.blt(0,0, @actor_status, st_src_rect)
  2816. if STATES_SCROLLING_ANIMATION
  2817. @status_flow[0] += 1
  2818. @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
  2819. else
  2820. @status_flow[1] += 1 unless @actor.states.size <= 1
  2821. if @status_flow[1] > 30
  2822. @status_flow[1] = 0
  2823. @status_flow[0] += 26
  2824. @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
  2825. end
  2826. end
  2827. end
  2828.  
  2829. #--------------------------------------------------------------------------
  2830. # * Update States
  2831. #--------------------------------------------------------------------------
  2832. def update_states
  2833. return if @status == nil
  2834. refresh_states if @status_old != @actor.states
  2835. flow_states
  2836. fade_sprite(@status,@fade_hud)
  2837. end
  2838.  
  2839. end
  2840.  
  2841. #==============================================================================
  2842. #==============================================================================
  2843. # ** Ultima Hud (FACE)
  2844. #==============================================================================
  2845. #==============================================================================
  2846. class Ultima_Hud
  2847.  
  2848. #--------------------------------------------------------------------------
  2849. # * Create Face
  2850. #--------------------------------------------------------------------------
  2851. def create_face
  2852. return if !FACE_VISIBLE
  2853. @face_old_hp = @actor.hp
  2854. @face_old_mp = @actor.mp
  2855. @face_old_tp = @actor.tp
  2856. @face_name = ""
  2857. @face = Sprite.new
  2858. @face_org = [$game_system.hud_position[0] + FACE_POSITION[0], $game_system.hud_position[1] + FACE_POSITION[1]]
  2859. @face.x = @face_org[0]
  2860. @face.y = @face_org[1]
  2861. @face.z = HUD_Z + FACE_Z
  2862. @face.opacity = 0 if !$game_system.hud_visible
  2863. refresh_face_name
  2864. end
  2865.  
  2866. #--------------------------------------------------------------------------
  2867. # * Refresh Face Name
  2868. #--------------------------------------------------------------------------
  2869. def refresh_face_name
  2870. @face_name = @actor.name
  2871. @face_image.dispose if @face_image != nil
  2872. @face.bitmap.dispose if @face.bitmap != nil
  2873. return if @actor.name == nil or @actor.name == ""
  2874. @face_image = Cache.ultima_hud(@actor.name + "_Face") rescue nil
  2875. @face_image = Bitmap.new(32,32) if @face_image == nil
  2876. @face_cw = FACE_ANIMATION ? @face_image.width / 4 : @face_image.width
  2877. @face_ch = @face_image.height
  2878. @face.bitmap = Bitmap.new(@face_cw,@face_ch)
  2879. refresh_face
  2880. end
  2881.  
  2882. #--------------------------------------------------------------------------
  2883. # * Refresh Face
  2884. #--------------------------------------------------------------------------
  2885. def refresh_face
  2886. @face_index = $game_system.hud_face[1]
  2887. @face.bitmap.clear
  2888. f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
  2889. @face.bitmap.blt(0,0,@face_image,f_scr)
  2890. end
  2891.  
  2892. #--------------------------------------------------------------------------
  2893. # * Update Face Duration
  2894. #--------------------------------------------------------------------------
  2895. def update_face_duration
  2896. return if $game_system.hud_face[0] == 0
  2897. $game_system.hud_face[0] -= 1
  2898. return if $game_system.hud_face[0] > 0
  2899. $game_system.hud_face[1] = @actor.low_hp? ? 2 : 0
  2900. refresh_face
  2901. end
  2902.  
  2903. #--------------------------------------------------------------------------
  2904. # * Can Refresh Index MP TP?
  2905. #--------------------------------------------------------------------------
  2906. def can_refresh_index_mp_tp?
  2907. return true if @face_old_mp != @actor.mp
  2908. return true if @face_old_tp != @actor.tp
  2909. return false
  2910. end
  2911.  
  2912. #--------------------------------------------------------------------------
  2913. # * Refresh Face Index HP
  2914. #--------------------------------------------------------------------------
  2915. def refresh_face_index_hp
  2916. $game_system.hud_face[0] = FACE_ANIMATION_DURATION
  2917. $game_system.hud_face[1] = @face_old_hp > @actor.hp ? 2 : 1
  2918. @face_old_hp = @actor.hp
  2919. end
  2920.  
  2921. #--------------------------------------------------------------------------
  2922. # * Refresh Face Index MP TP
  2923. #--------------------------------------------------------------------------
  2924. def refresh_face_index_mp_tp
  2925. $game_system.hud_face[0] = FACE_ANIMATION_DURATION
  2926. $game_system.hud_face[1] = @face_old_mp > @actor.mp ? 3 : 1
  2927. $game_system.hud_face[1] = 3 if @face_old_tp > @actor.tp
  2928. @face_old_mp = @actor.mp
  2929. @face_old_tp = @actor.tp
  2930. end
  2931.  
  2932. #--------------------------------------------------------------------------
  2933. # * Update Face Shake Effect
  2934. #--------------------------------------------------------------------------
  2935. def update_face_shake_effect
  2936. return if !FACE_SHAKE_EFFECT
  2937. if FACE_ANIMATION
  2938. update_shake_animated_face
  2939. else
  2940. update_shake_still_face
  2941. end
  2942. end
  2943.  
  2944. #--------------------------------------------------------------------------
  2945. # * Update Shake Still Effect Face
  2946. #--------------------------------------------------------------------------
  2947. def update_shake_still_face
  2948. if $game_system.hud_face[0] > 0 and $game_system.hud_face[1] == 2 and @actor.hp > 0
  2949. $game_system.hud_face[0] -= 1
  2950. @face.x = @face_org[0] - 4 + rand(8)
  2951. else
  2952. @face.x = @face_org[0]
  2953. end
  2954. end
  2955.  
  2956. #--------------------------------------------------------------------------
  2957. # * Update Shake Animated Face
  2958. #--------------------------------------------------------------------------
  2959. def update_shake_animated_face
  2960. if $game_system.hud_face[0] == 0
  2961. @face.x = @face_org[0]
  2962. return
  2963. end
  2964. if $game_system.hud_face[1] == 2 and @actor.hp > 0
  2965. @face.x = @face_org[0] - 4 + rand(8)
  2966. else
  2967. @face.x = @face_org[0]
  2968. end
  2969. end
  2970.  
  2971. #--------------------------------------------------------------------------
  2972. # * Update Face
  2973. #--------------------------------------------------------------------------
  2974. def update_face
  2975. return if @face == nil
  2976. fade_sprite(@face,@fade_hud)
  2977. refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
  2978. update_face_shake_effect
  2979. return if !FACE_ANIMATION
  2980. update_face_duration
  2981. refresh_face_index_mp_tp if can_refresh_index_mp_tp?
  2982. refresh_face_index_hp if @face_old_hp != @actor.hp
  2983. refresh_face if @face_index != $game_system.hud_face[1]
  2984. end
  2985.  
  2986. end
  2987.  
  2988. #==============================================================================
  2989. #==============================================================================
  2990. # ** Ultima Hud (STATES)
  2991. #==============================================================================
  2992. #==============================================================================
  2993. class Ultima_Hud
  2994.  
  2995. #--------------------------------------------------------------------------
  2996. # * Create Equipment
  2997. #--------------------------------------------------------------------------
  2998. def create_equipment
  2999. return if !EQUIPMENT_VISIBLE
  3000. return if @equip_layout != nil
  3001. create_equipment_layout
  3002. create_equipment_icons
  3003. end
  3004.  
  3005. #--------------------------------------------------------------------------
  3006. # * Create Equipment Layout
  3007. #--------------------------------------------------------------------------
  3008. def create_equipment_layout
  3009. @equip_layout = Sprite.new
  3010. @equip_layout.bitmap = Cache.ultima_hud("Equip_Layout")
  3011. @equip_layout.z = HUD_Z + EQUIPMENT_Z
  3012. @equip_layout.x = EQUIPMENT_POSITION[0]
  3013. @equip_layout.y = EQUIPMENT_POSITION[1]
  3014. @equip_smart_fade = EQUIPMENT_DETACHED_SMART_FADE
  3015. @equip_hud_size_x = [EQUIPMENT_POSITION[0] + EQUIPMENT_SMART_FADE_RANGE_X[0], EQUIPMENT_POSITION[0] + @equip_layout.bitmap.width + EQUIPMENT_SMART_FADE_RANGE_X[1]]
  3016. @equip_hud_size_y = [EQUIPMENT_POSITION[1] + EQUIPMENT_SMART_FADE_RANGE_Y[0], EQUIPMENT_POSITION[1] + @equip_layout.bitmap.height + EQUIPMENT_SMART_FADE_RANGE_Y[1]]
  3017. end
  3018.  
  3019. #--------------------------------------------------------------------------
  3020. # * Create Icon Weapon
  3021. #--------------------------------------------------------------------------
  3022. def create_equipment_icons
  3023. @equip_icon = Sprite.new
  3024. icon_cw = @equip_layout.bitmap.width + 48
  3025. icon_ch = @equip_layout.bitmap.height + 48
  3026. @equip_icon.bitmap = Bitmap.new(icon_cw,icon_ch)
  3027. @equip_icon.z = HUD_Z + EQUIPMENT_Z + 1
  3028. @equip_icon.x = EQUIPMENT_POSITION[0] - 24
  3029. @equip_icon.y = EQUIPMENT_POSITION[1] - 24
  3030. refresh_equipment
  3031. end
  3032.  
  3033. #--------------------------------------------------------------------------
  3034. # * Set Equipment
  3035. #--------------------------------------------------------------------------
  3036. def set_equipment
  3037. @equip_wep = @actor != nil ? @actor.equips : nil
  3038. end
  3039.  
  3040. #--------------------------------------------------------------------------
  3041. # * Refresh Equipment
  3042. #--------------------------------------------------------------------------
  3043. def refresh_equipment
  3044. set_equipment
  3045. return if @equip_layout == nil
  3046. @equip_icon.bitmap.clear
  3047. return if @actor == nil
  3048. check_icon_image
  3049. if @actor.equips[0] != nil and EQUIPMENT_WEAPON_VISIBLE
  3050. icon_index = @actor.equips[0].icon_index
  3051. icon_pos = [EQUIPMENT_WEAPON_POSITION[0],EQUIPMENT_WEAPON_POSITION[1]]
  3052. draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3053. end
  3054. if @actor.equips[1] != nil and EQUIPMENT_SHIELD_VISIBLE
  3055. icon_index = @actor.equips[1].icon_index
  3056. icon_pos = [EQUIPMENT_SHIELD_POSITION[0],EQUIPMENT_SHIELD_POSITION[1]]
  3057. draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3058. end
  3059. if @actor.equips[2] != nil and EQUIPMENT_HEAD_VISIBLE
  3060. icon_index = @actor.equips[2].icon_index
  3061. icon_pos = [EQUIPMENT_HEAD_POSITION[0],EQUIPMENT_HEAD_POSITION[1]]
  3062. draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3063. end
  3064. if @actor.equips[3] != nil and EQUIPMENT_BODY_VISIBLE
  3065. icon_index = @actor.equips[3].icon_index
  3066. icon_pos = [EQUIPMENT_BODY_POSITION[0],EQUIPMENT_BODY_POSITION[1]]
  3067. draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3068. end
  3069. if @actor.equips[4] != nil and EQUIPMENT_ACCESSORY_VISIBLE
  3070. icon_index = @actor.equips[4].icon_index
  3071. icon_pos = [EQUIPMENT_ACCESSORY_POSITION[0],EQUIPMENT_ACCESSORY_POSITION[1]]
  3072. draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
  3073. end
  3074. end
  3075.  
  3076. #--------------------------------------------------------------------------
  3077. # * draw_icons
  3078. #--------------------------------------------------------------------------
  3079. def draw_icons(sprite,x,y,icon_index)
  3080. icon_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  3081. sprite.bitmap.blt(x, y, @icon_image, icon_rect)
  3082. end
  3083.  
  3084. #--------------------------------------------------------------------------
  3085. # * Update Equipment
  3086. #--------------------------------------------------------------------------
  3087. def update_equipment
  3088. return if @equip_layout == nil
  3089. refresh_equipment if @equip_wep != @actor.equips
  3090. if @equip_smart_fade
  3091. fade_sprite(@equip_layout,@fade_hud_equip)
  3092. fade_sprite(@equip_icon,@fade_hud_equip)
  3093. else
  3094. fade_sprite(@equip_layout,@fade_hud)
  3095. fade_sprite(@equip_icon,@fade_hud)
  3096. end
  3097. end
  3098.  
  3099. end
  3100.  
  3101. #==============================================================================
  3102. #==============================================================================
  3103. # ** Ultima Hud (GOLD)
  3104. #==============================================================================
  3105. #==============================================================================
  3106. class Ultima_Hud
  3107.  
  3108. #--------------------------------------------------------------------------
  3109. # * Create Gold
  3110. #--------------------------------------------------------------------------
  3111. def create_gold
  3112. return if !GOLD_VISIBLE
  3113. return if @gold != nil
  3114. create_gold_layout
  3115. create_gold_number
  3116. end
  3117.  
  3118. #--------------------------------------------------------------------------
  3119. # * Create Gold Layout
  3120. #--------------------------------------------------------------------------
  3121. def create_gold_layout
  3122. @gold = Sprite.new
  3123. @gold.bitmap = Cache.ultima_hud("Gold_Layout")
  3124. @gold.x = GOLD_POSITION[0]
  3125. @gold.y = GOLD_POSITION[1]
  3126. @gold.z = HUD_Z + GOLD_HUD_Z
  3127. @gold_smart_fade = GOLD_DETACHED_SMART_FADE
  3128. @gold_hud_size_x = [GOLD_POSITION[0] + GOLD_SMART_FADE_RANGE_X[0], GOLD_POSITION[0] + @gold.bitmap.width + GOLD_SMART_FADE_RANGE_X[1]]
  3129. @gold_hud_size_y = [GOLD_POSITION[1] + GOLD_SMART_FADE_RANGE_Y[0], GOLD_POSITION[1] + @gold.bitmap.height + GOLD_SMART_FADE_RANGE_Y[1]]
  3130. end
  3131.  
  3132. #--------------------------------------------------------------------------
  3133. # * Create Gold Number
  3134. #--------------------------------------------------------------------------
  3135. def create_gold_number
  3136. @gold_old = $game_party.gold
  3137. @gold_refresh = true
  3138. @gold_number_image = Cache.ultima_hud("Gold_Number")
  3139. @gold_cw = @gold_number_image.width / 10
  3140. @gold_ch = @gold_number_image.height
  3141. @gold_number = Sprite.new
  3142. @gold_number.bitmap = Bitmap.new(@gold_cw * 7,@gold_ch)
  3143. @gold_pos = [GOLD_POSITION[0] + GOLD_NUMBER_POSITION[0],
  3144. GOLD_POSITION[1] + GOLD_NUMBER_POSITION[1]]
  3145. @gold_number.x = @gold_pos[0]
  3146. @gold_number.y = @gold_pos[1]
  3147. @gold_number.z = HUD_Z + GOLD_HUD_Z + 1
  3148. end
  3149.  
  3150. #--------------------------------------------------------------------------
  3151. # * Update Gold
  3152. #--------------------------------------------------------------------------
  3153. def update_gold
  3154. return if @gold == nil
  3155. update_number(6,@gold_old)
  3156. refresh_number(6,@gold_old,@gold_number,@gold_number_image,@gold_cw,@gold_ch,false)
  3157. if @gold_smart_fade
  3158. fade_sprite(@gold,@fade_hud_gold)
  3159. fade_sprite(@gold_number,@fade_hud_gold)
  3160. else
  3161. fade_sprite(@gold,@fade_hud)
  3162. fade_sprite(@gold_number,@fade_hud)
  3163. end
  3164. end
  3165.  
  3166. end
  3167.  
  3168. #==============================================================================
  3169. #==============================================================================
  3170. # ** Ultima Hud (DISPOSE)
  3171. #==============================================================================
  3172. #==============================================================================
  3173. class Ultima_Hud
  3174.  
  3175. #--------------------------------------------------------------------------
  3176. # * Dispose
  3177. #--------------------------------------------------------------------------
  3178. def dispose
  3179. dispose_layout
  3180. dispose_layout_2
  3181. dispose_name
  3182. dispose_face
  3183. dispose_hp_number
  3184. dispose_hp_number_max
  3185. dispose_hp_meter
  3186. dispose_hp_icon
  3187. dispose_hp_icon_ex
  3188. dispose_hp_icon_number
  3189. dispose_mp_number
  3190. dispose_mp_number_max
  3191. dispose_mp_meter
  3192. dispose_mp_icon
  3193. dispose_mp_icon_ex
  3194. dispose_mp_icon_number
  3195. dispose_tp_number
  3196. dispose_tp_number_max
  3197. dispose_tp_meter
  3198. dispose_tp_icon
  3199. dispose_tp_icon_ex
  3200. dispose_tp_icon_number
  3201. dispose_lv_number
  3202. dispose_lv_number_exp
  3203. dispose_lv_meter
  3204. dispose_states
  3205. dispose_equipment
  3206. dispose_gold
  3207. end
  3208.  
  3209. #--------------------------------------------------------------------------
  3210. # * Dispose Layout
  3211. #--------------------------------------------------------------------------
  3212. def dispose_layout
  3213. return if @layout == nil
  3214. @layout.bitmap.dispose
  3215. @layout.dispose
  3216. end
  3217.  
  3218. #--------------------------------------------------------------------------
  3219. # * Dispose Layout 2
  3220. #--------------------------------------------------------------------------
  3221. def dispose_layout_2
  3222. return if @layout2 == nil
  3223. @layout2.bitmap.dispose
  3224. @layout2.dispose
  3225. end
  3226.  
  3227. #--------------------------------------------------------------------------
  3228. # * Dispose Name
  3229. #--------------------------------------------------------------------------
  3230. def dispose_name
  3231. return if @name == nil
  3232. @name.bitmap.dispose
  3233. @name.dispose
  3234. end
  3235.  
  3236. #--------------------------------------------------------------------------
  3237. # * Dispose Face
  3238. #--------------------------------------------------------------------------
  3239. def dispose_face
  3240. return if @face == nil
  3241. @face_image.dispose if @face_image != nil
  3242. @face.bitmap.dispose if @face.bitmap != nil
  3243. @face.dispose
  3244. end
  3245.  
  3246. #--------------------------------------------------------------------------
  3247. # * Dispose HP Number
  3248. #--------------------------------------------------------------------------
  3249. def dispose_hp_number
  3250. return if @hp_number == nil
  3251. @hp_number.bitmap.dispose
  3252. @hp_number.dispose
  3253. end
  3254.  
  3255. #--------------------------------------------------------------------------
  3256. # * Dispose HP Number Max
  3257. #--------------------------------------------------------------------------
  3258. def dispose_hp_number_max
  3259. return if @hp_number2 == nil
  3260. @hp_number2.bitmap.dispose
  3261. @hp_number2.dispose
  3262. end
  3263.  
  3264. #--------------------------------------------------------------------------
  3265. # * Dispose HP Meter
  3266. #--------------------------------------------------------------------------
  3267. def dispose_hp_meter
  3268. return if @hp_meter == nil
  3269. @hp_meter.bitmap.dispose
  3270. @hp_meter.dispose
  3271. end
  3272.  
  3273. #--------------------------------------------------------------------------
  3274. # * Dispose HP Icon
  3275. #--------------------------------------------------------------------------
  3276. def dispose_hp_icon
  3277. return if @hp_icon == nil
  3278. @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
  3279. @hp_icon.dispose
  3280. end
  3281.  
  3282. #--------------------------------------------------------------------------
  3283. # * Dispose HP Icon EX
  3284. #--------------------------------------------------------------------------
  3285. def dispose_hp_icon_ex
  3286. return if @hp_icon3 == nil
  3287. @hp_icon3.bitmap.dispose
  3288. @hp_icon3.dispose
  3289. end
  3290.  
  3291. #--------------------------------------------------------------------------
  3292. # * Dispose HP Icon Number
  3293. #--------------------------------------------------------------------------
  3294. def dispose_hp_icon_number
  3295. return if @hp_icon_number == nil
  3296. @hp_icon_number.bitmap.dispose
  3297. @hp_icon_number.dispose
  3298. end
  3299.  
  3300. #--------------------------------------------------------------------------
  3301. # * Dispose MP Number
  3302. #--------------------------------------------------------------------------
  3303. def dispose_mp_number
  3304. return if @mp_number == nil
  3305. @mp_number.bitmap.dispose
  3306. @mp_number.dispose
  3307. end
  3308.  
  3309. #--------------------------------------------------------------------------
  3310. # * Dispose MP Number Max
  3311. #--------------------------------------------------------------------------
  3312. def dispose_mp_number_max
  3313. return if @mp_number2 == nil
  3314. @mp_number2.bitmap.dispose
  3315. @mp_number2.dispose
  3316. end
  3317.  
  3318. #--------------------------------------------------------------------------
  3319. # * Dispose MP Meter
  3320. #--------------------------------------------------------------------------
  3321. def dispose_mp_meter
  3322. return if @mp_meter == nil
  3323. @mp_meter.bitmap.dispose
  3324. @mp_meter.dispose
  3325. end
  3326.  
  3327. #--------------------------------------------------------------------------
  3328. # * Dispose MP Icon
  3329. #--------------------------------------------------------------------------
  3330. def dispose_mp_icon
  3331. return if @mp_icon == nil
  3332. @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
  3333. @mp_icon.dispose
  3334. end
  3335.  
  3336. #--------------------------------------------------------------------------
  3337. # * Dispose MP Icon EX
  3338. #--------------------------------------------------------------------------
  3339. def dispose_mp_icon_ex
  3340. return if @mp_icon3 == nil
  3341. @mp_icon3.bitmap.dispose
  3342. @mp_icon3.dispose
  3343. end
  3344.  
  3345. #--------------------------------------------------------------------------
  3346. # * Dispose MP Icon Number
  3347. #--------------------------------------------------------------------------
  3348. def dispose_mp_icon_number
  3349. return if @mp_icon_number == nil
  3350. @mp_icon_number.bitmap.dispose
  3351. @mp_icon_number.dispose
  3352. end
  3353.  
  3354. #--------------------------------------------------------------------------
  3355. # * Dispose TP Number
  3356. #--------------------------------------------------------------------------
  3357. def dispose_tp_number
  3358. return if @tp_number == nil
  3359. @tp_number.bitmap.dispose
  3360. @tp_number.dispose
  3361. end
  3362.  
  3363. #--------------------------------------------------------------------------
  3364. # * Dispose TP Number Max
  3365. #--------------------------------------------------------------------------
  3366. def dispose_tp_number_max
  3367. return if @tp_number2 == nil
  3368. @tp_number2.bitmap.dispose
  3369. @tp_number2.dispose
  3370. end
  3371.  
  3372. #--------------------------------------------------------------------------
  3373. # * Dispose TP Meter
  3374. #--------------------------------------------------------------------------
  3375. def dispose_tp_meter
  3376. return if @tp_meter == nil
  3377. @tp_meter.bitmap.dispose
  3378. @tp_meter.dispose
  3379. end
  3380.  
  3381. #--------------------------------------------------------------------------
  3382. # * Dispose TP Icon
  3383. #--------------------------------------------------------------------------
  3384. def dispose_tp_icon
  3385. return if @tp_icon == nil
  3386. @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
  3387. @tp_icon.dispose
  3388. end
  3389.  
  3390. #--------------------------------------------------------------------------
  3391. # * Dispose TP Icon EX
  3392. #--------------------------------------------------------------------------
  3393. def dispose_tp_icon_ex
  3394. return if @tp_icon3 == nil
  3395. @tp_icon3.bitmap.dispose
  3396. @tp_icon3.dispose
  3397. end
  3398.  
  3399. #--------------------------------------------------------------------------
  3400. # * Dispose TP Icon Number
  3401. #--------------------------------------------------------------------------
  3402. def dispose_tp_icon_number
  3403. return if @tp_icon_number == nil
  3404. @tp_icon_number.bitmap.dispose
  3405. @tp_icon_number.dispose
  3406. end
  3407.  
  3408. #--------------------------------------------------------------------------
  3409. # * Dispose Lv Number
  3410. #--------------------------------------------------------------------------
  3411. def dispose_lv_number
  3412. return if @lv_number == nil
  3413. @lv_number.bitmap.dispose
  3414. @lv_number.dispose
  3415. end
  3416.  
  3417. #--------------------------------------------------------------------------
  3418. # * Dispose Lv Number EXP
  3419. #--------------------------------------------------------------------------
  3420. def dispose_lv_number_exp
  3421. return if @lv_number2 == nil
  3422. @lv_number2.bitmap.dispose
  3423. @lv_number2.dispose
  3424. end
  3425.  
  3426. #--------------------------------------------------------------------------
  3427. # * Dispose Lv Meter
  3428. #--------------------------------------------------------------------------
  3429. def dispose_lv_meter
  3430. return if @lv_meter == nil
  3431. @lv_meter.bitmap.dispose
  3432. @lv_meter.dispose
  3433. end
  3434.  
  3435. #--------------------------------------------------------------------------
  3436. # * Dispose States
  3437. #--------------------------------------------------------------------------
  3438. def dispose_states
  3439. return if @status == nil
  3440. @status.bitmap.dispose if @status.bitmap != nil
  3441. @status.dispose
  3442. @actor_status.dispose if @actor_status != nil
  3443. end
  3444.  
  3445. #--------------------------------------------------------------------------
  3446. # * Dispose Equipment
  3447. #--------------------------------------------------------------------------
  3448. def dispose_equipment
  3449. return if @equip_layout == nil
  3450. @equip_layout.bitmap.dispose
  3451. @equip_layout.dispose
  3452. @equip_icon.bitmap.dispose
  3453. @equip_icon.dispose
  3454. end
  3455.  
  3456. #--------------------------------------------------------------------------
  3457. # * Dispose Gold
  3458. #--------------------------------------------------------------------------
  3459. def dispose_gold
  3460. return if @gold == nil
  3461. @gold_number.bitmap.dispose
  3462. @gold.dispose
  3463. @gold_number.bitmap.dispose
  3464. @gold_number.dispose
  3465. end
  3466.  
  3467. end
  3468.  
  3469. #==============================================================================
  3470. #==============================================================================
  3471. # ** Ultima Hud (UPDATE)
  3472. #==============================================================================
  3473. #==============================================================================
  3474. class Ultima_Hud
  3475.  
  3476. #--------------------------------------------------------------------------
  3477. # * Update
  3478. #--------------------------------------------------------------------------
  3479. def update
  3480. refresh_actor if @actor != $game_party.members[0]
  3481. return if @actor == nil
  3482. update_visible
  3483. update_layout
  3484. update_layout_2
  3485. update_name
  3486. update_face
  3487. update_hp
  3488. update_mp
  3489. update_tp
  3490. update_level
  3491. update_states
  3492. update_equipment
  3493. update_gold
  3494. end
  3495.  
  3496. #--------------------------------------------------------------------------
  3497. # * Update Visible
  3498. #--------------------------------------------------------------------------
  3499. def update_visible
  3500. update_auto_hide
  3501. return if !SMART_FADE_EFFECT
  3502. @fade_hud = smart_fade_in_range?(@hud_size_x,@hud_size_y)
  3503. update_gold_smart_fade
  3504. update_equip_smart_fade
  3505. end
  3506.  
  3507. #--------------------------------------------------------------------------
  3508. # * Update Auto Hide
  3509. #--------------------------------------------------------------------------
  3510. def update_auto_hide
  3511. if can_auto_hide?
  3512. @force_hide = true
  3513. @force_hide_time += 1
  3514. else
  3515. @force_hide = false
  3516. @force_hide_time = 0
  3517. end
  3518. end
  3519.  
  3520. #--------------------------------------------------------------------------
  3521. # * Can Auto Hide
  3522. #--------------------------------------------------------------------------
  3523. def can_auto_hide?
  3524. return true if !$game_system.hud_visible
  3525. return false if !AUTO_HIDE_FOR_INTERPRETER
  3526. return true if $game_map.interpreter.running?
  3527. return true if $game_message.visible
  3528. return false
  3529. end
  3530.  
  3531. #--------------------------------------------------------------------------
  3532. # * Smart Fade In Range
  3533. #--------------------------------------------------------------------------
  3534. def smart_fade_in_range?(range_x,range_y)
  3535. if $game_player.screen_x.between?(range_x[0],range_x[1]) and
  3536. $game_player.screen_y.between?(range_y[0],range_y[1])
  3537. return true
  3538. else
  3539. return false
  3540. end
  3541. end
  3542.  
  3543. #--------------------------------------------------------------------------
  3544. # * Update Gold Smart Fade
  3545. #--------------------------------------------------------------------------
  3546. def update_gold_smart_fade
  3547. return if @gold == nil
  3548. return if !@gold_smart_fade
  3549. @fade_hud_gold = smart_fade_in_range?(@gold_hud_size_x,@gold_hud_size_y)
  3550. end
  3551.  
  3552. #--------------------------------------------------------------------------
  3553. # * Update Equip Smart Fade
  3554. #--------------------------------------------------------------------------
  3555. def update_equip_smart_fade
  3556. return if @equip_layout == nil
  3557. return if !@equip_smart_fade
  3558. @fade_hud_equip = smart_fade_in_range?(@equip_hud_size_x,@equip_hud_size_y)
  3559. end
  3560.  
  3561. #--------------------------------------------------------------------------
  3562. # * Refresh Actor
  3563. #--------------------------------------------------------------------------
  3564. def refresh_actor
  3565. if can_initialize_hud?
  3566. setup
  3567. create_sprites
  3568. end
  3569. clear_base_parameters
  3570. end
  3571.  
  3572. #--------------------------------------------------------------------------
  3573. # * Clear Base Parameters
  3574. #--------------------------------------------------------------------------
  3575. def clear_base_parameters
  3576. @actor = $game_party.members[0]
  3577. $game_system.hud_face = [1,0]
  3578. @hp_old_meter = 0
  3579. @mp_old_meter = 0
  3580. @tp_old_meter = 0
  3581. refresh_equipment
  3582. if @actor != nil
  3583. if @face != nil
  3584. refresh_face_name rescue nil
  3585. @face_old_hp = @actor.hp
  3586. @face_old_mp = @actor.mp
  3587. @face_old_tp = @actor.tp
  3588. end
  3589. if @name != nil
  3590. refresh_name rescue nil
  3591. end
  3592. end
  3593. end
  3594.  
  3595. #--------------------------------------------------------------------------
  3596. # * Can Initialize HUD?
  3597. #--------------------------------------------------------------------------
  3598. def can_initialize_hud?
  3599. return false if @actor != nil and $game_party.members[0] != nil
  3600. return true
  3601. end
  3602.  
  3603. end
  3604.  
  3605. $mog_rgss3_ultima_hud = true
RAW Paste Data