Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 72.71 KB | None | 0 0
  1.  
  2. #==============================================================================
  3. # ** Blackmorning -> YEA - STATUS Addon: Elemental/Status Resistances & Rates
  4. #------------------------------------------------------------------------------
  5. # Blackmorning
  6. # Version 3.01
  7. # released 01/29/2014
  8. # updated Dec/30/2015
  9. # - fixed small status issue with luna engine
  10. #==============================================================================
  11. # - INTRODUCTION -
  12. # - include resistances and infliction rates as well as parameters in YEA status
  13. # screen
  14. # resistances and parameter ratios in polygon graphical format.
  15. # - can toggle between windows with toggle button
  16. # - allows the actor's portraits to appear or not in different status windows
  17. # - large portrait for actor if available
  18. # found in folder assigned to portrait/bust images (see BM-Base)
  19. # file format - face_name-face-index
  20. # (size:270px x 290px)
  21. # - adds bio info (height, age, birthplace. etc) can be switched with YEA by
  22. # clicking on it
  23. #==============================================================================
  24. # ? Instructions
  25. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26. # To install this script, open up your script editor and copy/paste this script
  27. # to an open slot below BM - Base and YEA - Status Menu but above ? Main.
  28. # * need TRGSSX.dll in folder with game.exe
  29. # If using BM - Advanced Menu, put this below it.
  30. # Remember to save.
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # Actor's Notetag
  33. # To set an actor's initial age, enter:
  34. # <age: number>
  35. # To set an actor's birthplace to x, enter:
  36. # <birthplace: x>
  37. # To set an actor's height to x, enter:
  38. # <height: x>
  39. # To set an actor's custom bio y to x, enter:
  40. # <cbio y: x>
  41. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  42. # Message Codes (x is actor_id)
  43. # To write an actor's age, enter:
  44. # \aage[x]
  45. # To write an actor's birthplace, enter:
  46. # \abirth[x]
  47. # To write an actor's height, enter:
  48. # \aheight[x]
  49. # To write an actor's custom bio y, enter:
  50. # \abio[y, x]
  51. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  52. # Script Codes (x is actor_id, n is new value, c is custombio id)
  53. # change bio properties ingame:
  54. # $game_actors[x].set_age = n
  55. # $game_actors[x].set_height = n
  56. # $game_actors[x].set_birthplace = "n"
  57. # $game_actors[x].set_custom_bio[c] = "n"
  58. #------------------------------------------------------------------------------
  59. # * add this to the COMMANDS on YEA - status menu where you want it to show:
  60. # [ :element, "Elements"],
  61. # [ :state, "States"],
  62. # [ :infliction, "Attributes"],
  63. # [ :resistance, "Resistances"],
  64. # [ :bmproperties, "Properties"], #can be used instead of :properties
  65. #==============================================================================
  66. module BM
  67. module STATUS
  68. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  69. # - Main Page Settings
  70. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  71. GAUGE = {# show gauge with numbers
  72. :exp => true,
  73. :hp => true,
  74. :mp => true,
  75. :tp => true,
  76. :param => true,
  77. }
  78. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  79. # Background Options
  80. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  81. BG_OPTIONS ={
  82. :win_opacity => 255, # window opacity for menu
  83. :show_bg_img => false, # show background image
  84. :bg_image => "Wallpaper", # image name (Located in Graphics/System
  85. :bg_opacity => 255, # background image opacity
  86. :bg_scroll_x => 1, # horizontal movement
  87. :bg_scroll_y => 0, # vertical movement
  88. }# DO NOT REMOVE
  89. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  90. # - BM Properties Window Settings -
  91. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  92. # BM properties is similar to Properties in YEA Status, but the properties
  93. # will automatically split into equal columns.
  94. # These settings adjust the way the properties window visually appears.
  95. # Change whether or not they appear, and what order they will appear in.
  96. # can use YEA's if you want to assign each column.
  97. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  98. # :hit,:eva,:cri,:cev,:mev,:mrf,:cnt,:hrg,:mrg,:trg
  99. # :tgr,:grd,:rec,:pha,:mcr,:tcr,:pdr,:mdr,:fdr,:exr
  100. # :wur,:gut,:hcr,:tcr_y,:hp_physical,:mp_physical,:hp_magical,:mp_magical
  101. # :blank (makes a empty entry for spacing, can be used in YEA or BM)
  102. # :hblank when you want half line empty
  103. BMPROPERTIES_COLUMN =[
  104. :hit, :eva, :cri, :cev, :mev, :mrf, :cnt,
  105. :cdr, :wur, # Requires YEA - Skill Restrictions
  106. :gut, # Requires Bubs - Guts Effects
  107. :tgr, :grd, :rec, :pha, :mcr,
  108. :hcr, :tcr_y, # Requires YEA - Skill Cost Manager
  109. :tcr, :exr, :hrg, :mrg, :trg, :pdr, :mdr, :fdr,
  110. :hp_physical, :mp_physical, :hp_magical, :mp_magical, # Requires YEA - Convert Damage
  111. ] # DO NOT REMOVE
  112. NUM_COL = 2 #default = 3
  113. PROPERTIES_FULL_NAME = true # values set in BM-Base script
  114. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  115. # - Biography Window Settings -
  116. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  117. # These settings adjust the way the biography appears
  118. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  119. BIO_INFO = [:blank,:align, :age, :gender, :birthplace, :height, :custom_bio1, :custom_bio2]
  120. ACTOR_BIO_INFO = {}
  121. # for custom actor bio list
  122. #format: ACTOR_BIO_INFO[actor_id] = [custom list]
  123. ACTOR_BIO_INFO[1] = [:blank,:align, :age, :gender, :birthplace, :height]
  124. #ACTOR_BIO_INFO[2] = [:blank,:align, :age, :gender, :birthplace, :height]
  125.  
  126.  
  127. # put :blank when you want a line empty,:hblank when you want half line empty
  128. BIO_INFO_TEXT = {
  129. :align => "Alignment:", # requires BM alignment
  130. :age => "Age:",
  131. :gender => "Gender:", # Bubs
  132. :birthplace => "Birthplace:",
  133. :height => "Height:",
  134. :nickname => "Nickname:",
  135. } # DO NOT REMOVE
  136. CBIO_INFO_TEXT ={ # custom bio info that you create, up to custom_bio10
  137. :custom_bio1 => "Species:",
  138. :custom_bio2 => "Weight:",
  139. :custom_bio3 => "",
  140. :custom_bio4 => "",
  141. :custom_bio5 => "",
  142. :custom_bio6 => "",
  143. :custom_bio7 => "",
  144. :custom_bio8 => "",
  145. :custom_bio9 => "",
  146. :custom_bio10 => "",
  147. } # DO NOT REMOVE
  148. BIO_FONT_SIZE = 22 # font size of bio info text
  149. YEA_BIO_BOX = false # background box for YEA bio
  150. HEIGHT_UNIT = "%s cm" # %s is the height given in actor's notebox
  151. EMPTY_BIO = "--"
  152. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  153. # - ACTOR Portrait -
  154. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  155. # shows the actor's portrait in the background for the status screens you want,
  156. # using the COMMANDS from YEA Status.
  157. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  158. PORTRAIT_BACKGROUND = [:general,:biography,:titles,:rename,:retitle,:yeabio,:bmbio]
  159. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  160. # Chart Options
  161. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  162. # * all info on window for new element/state/infliction/resistance Scene when
  163. # selected in status menu, otherwise will toggle
  164. ONE_PAGE = {
  165. :element => true,
  166. :state => true,
  167. :infliction => false,
  168. :resistance => false,
  169. } # DO NOT REMOVE
  170. LIST_ITEMS_ORDER={
  171. :element => [9,10,3,4,5,6,7,8], # elements you want shown
  172. :state => [2..8], # states you want shown
  173. :param => [2..7], # parameters you want shown
  174. } # DO NOT REMOVE
  175. CHART_ITEMS_ORDER={#order can differ from list for better visuals
  176. :element => [9,3,4,5,10,6,7,8], # elements you want shown
  177. :state => [2..8], # states you want shown
  178. :param => [2..7], # parameters you want shown
  179. } # DO NOT REMOVE
  180. # * format of info
  181. # 0 .. numbers
  182. # 1 .. chart
  183. # 2 .. chart & numbers
  184. # 3 .. numbers (: spacing leaves blank size of chart)
  185. # 1, 2 must have «KGC bitmap expansion».
  186. INFO_STYLE = {
  187. :element => 2,
  188. :state => 2,
  189. :param => 2,
  190. :resist => 2,
  191. :inflict => 3,
  192. } # DO NOT REMOVE
  193. CHART_FONT_SIZE = 18
  194. # * resistance number format
  195. # 0 .. Attributes: normal 100, (negative absorption) 99 or less reduce, weakness more than 101
  196. # State: Additional success rate (susceptibility)
  197. # boosted resistance to inside, susceptibility to outside
  198. # 1 .. Attribute: Normal, (absorption 101 or more) reduction, plus weakness minus 0
  199. # State: Additional evasion rate (hardness apply)
  200. # boosted resistance to outside, susceptibility to inside
  201. NUMBER_STYLE = {
  202. :element => 1,
  203. :state => 1,
  204. :param => 0,
  205. } # DO NOT REMOVE
  206. PARAMETER_NAME = {
  207. :element => "Elemental",
  208. :state => "States",
  209. :resist => "Resistance",
  210. :inflict => "Infliction",
  211. } # DO NOT REMOVE
  212. #------------------------------------------------------------------------
  213. # Chart Icons
  214. #------------------------------------------------------------------------
  215. # Assign Icons for the charts (parameters, elements and states)
  216. # *Note* If you're using BM-Icons, and want to use those same icons,
  217. # remove or comment (#) them out. (states would be made default from database)
  218. CHART_ICONS={
  219. :param => {
  220. 2 => 900, # ATK, ATtacK power
  221. 3 => 901, # DEF, DEFense power
  222. 4 => 902, # MAT, Magic ATtack power
  223. 5 => 903, # MDF, Magic DeFense power
  224. 6 => 904, # AGI, AGIlity
  225. 7 => 905, # LUK, LUcK
  226. }, # DO NOT REMOVE
  227. :element => {
  228. 3 => 104, # Fire element.
  229. 4 => 105, # Ice element.
  230. 5 => 106, # Volt element.
  231. 6 => 107, # Earth element.
  232. 7 => 108, # Water element.
  233. 8 => 109, # Air element.
  234. 9 => 110, # Light element.
  235. 10 => 111, # Dark element.
  236. }, # DO NOT REMOVE
  237. :state => {
  238. # 2 => 104,
  239. # 3 => 105,
  240. # 4 => 106,
  241. # 5 => 107,
  242. # 6 => 108,
  243. # 7 => 109,
  244. # 8 => 110,
  245. # 9 => 111,
  246. }, # DO NOT REMOVE
  247. } # DO NOT REMOVE
  248. #------------------------------------------------------------------------
  249. # Chart Graphics
  250. #------------------------------------------------------------------------
  251. LINE_COLOR = {
  252. :element => Color.new(128, 255, 128),
  253. :state => Color.new(228, 255, 128),
  254. :param => Color.new(228, 55, 28),
  255. } # DO NOT REMOVE
  256. BASE_COLOR = {
  257. :element => Color.new(128, 192, 255),
  258. :state => Color.new(128, 192, 255),
  259. :param => Color.new(128, 192, 255),
  260. } # DO NOT REMOVE
  261. FLASH_COLOR = {
  262. :element => Color.new(128, 255, 128),
  263. :state => Color.new(228, 255, 128),
  264. :param => Color.new(228, 55, 28),
  265. } # DO NOT REMOVE
  266. CHART_HIGHQUALITY = true
  267. CHART_FRAME_RATE = 0.2 # speed of blinking chart (<1 slower, >1 faster)
  268.  
  269. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  270. # - Switch & Toggle Settings -
  271. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  272. # These are the switches that govern whether or not certain status items will
  273. # appear and/or will be enabled. By binding them to a Switch, you can just
  274. # set the Switch ON/OFF to show/hide or enable/disable a status command. If
  275. # you do not wish to use this feature, set these commands to 0.
  276. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  277. TOGGLE_ICON = 1027 #appears in bottom corner to show you can toggle screens
  278. TOGGLE_BUTTON = :Z
  279. TOGGLE_SOUND = true # uses default select sound if true
  280. # toggle between multiple windows
  281. # command => [command1, command2, command3, ...]
  282. # command is what is placed in the YEA commands list
  283. TOGGLE_WINDOWS={
  284. :element => [:element, :state],
  285. :state => [:state, :element],
  286. # :element => [:ele_resist, :ele_inflict],
  287. # :state => [:state_resist, :state_inflict],
  288. # :general => [:general, :bmbio,:yeabio],
  289. :biography => [:yeabio, :bmbio],
  290. :parameters => [:parameters, :bmproperties],
  291. :bmproperties => [:bmproperties, :parameters],
  292. :resistance => [:ele_resist, :state_resist],
  293. :infliction => [:ele_inflict, :state_inflict],
  294. }# DO NOT REMOVE
  295. CHART_STATUS_COMMANDS ={
  296. # switch Handler Method to :do_nothing when you don't want the confirm button
  297. # to do anything
  298. # :command => [EnableSwitch, ShowSwitch, Handler Method, Window Draw],
  299. :bmproperties => [ 0, 0, :do_nothing, :draw_bmprop],
  300. :resistance => [ 0, 0, :command_resist, :draw_resist],
  301. :infliction => [ 0, 0, :command_inflict, :draw_inflict],
  302. :element => [ 0, 0, :command_elements, :draw_elemental],
  303. :ele_resist => [ 0, 0, :command_elements, :draw_ele_resist],
  304. :ele_inflict => [ 0, 0, :command_elements, :draw_ele_inflict],
  305. :state => [ 0, 0, :command_states, :draw_states],
  306. :state_inflict => [ 0, 0, :command_states, :draw_state_inflict],
  307. :state_resist => [ 0, 0, :command_states, :draw_state_resist],
  308. :yeabio => [ 0, 0, :command_bio, :draw_actor_yeabiography],
  309. :bmbio => [ 0, 0, :command_bio, :draw_actor_bmbiography],
  310. } # DO NOT REMOVE
  311. end
  312. end
  313. #===============================================================================
  314. # Editting anything past this point may potentially result in causing computer
  315. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  316. # Therefore, edit at your own risk.
  317. #==============================================================================
  318. # ** module BM
  319. #==============================================================================
  320. module BM
  321. def self.required(name, req, version, type = nil)
  322. if !$imported[:bm_base]
  323. msg = "The script '%s' requires the script\n"
  324. msg += "'BM - Base' v%s or higher above it to work properly\n"
  325. msg += "Go to bmscripts.weebly.com to download this script."
  326. msgbox(sprintf(msg, self.script_name(name), version))
  327. exit
  328. else
  329. self.required_script(name, req, version, type)
  330. end
  331. end
  332. #--------------------------------------------------------------------------
  333. # * script_name
  334. # Get the script name base on the imported value
  335. #--------------------------------------------------------------------------
  336. def self.script_name(name, ext = "BM")
  337. name = name.to_s.gsub("_", " ").upcase.split
  338. name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
  339. name.join(" ")
  340. end
  341. end
  342. $imported ||= {}
  343. $imported[:bm_status] = 3.01
  344. BM.required(:bm_status, :bm_base, 1.00, :above)
  345. BM.required(:bm_status, "YEA-StatusMenu", true, :above)
  346. BM.required(:bm_status, "BitmapExtension", true, :above)
  347. #==========================================================================
  348. # ** BM::Regexp
  349. #==========================================================================
  350. module BM
  351. module REGEXP
  352. module ACTOR
  353. AGE = /<(?:AGE|age):[ ](\d+)>/i
  354. BIRTHPLACE = /<(?:BIRTHPLACE|birthplace|birth|BIRTH):[ ](.*)>/i
  355. HEIGHT = /<(?:HEIGHT|height):[ ](.*)>/i
  356. CUSTOMBIO = /<(?:CBIO|cbio)[ ](\d+):[ ](.*)>/i
  357. end
  358. end
  359. end
  360. #==========================================================================
  361. # ** BM::STATUS
  362. #==========================================================================
  363. module BM::STATUS
  364. module_function
  365. def convert_integer_array(chart)
  366. array = LIST_ITEMS_ORDER[chart]
  367. result = []
  368. array.each { |i|
  369. case i
  370. when Range
  371. result |= i.to_a
  372. when Integer
  373. result |= [i]
  374. end
  375. }
  376. return result
  377. end
  378. #--------------------------------------------------------------------------
  379. def convert_integer_chart_array(chart)
  380. array = CHART_ITEMS_ORDER[chart]
  381. result = []
  382. array.each { |i|
  383. case i
  384. when Range
  385. result |= i.to_a
  386. when Integer
  387. result |= [i]
  388. end
  389. }
  390. return result
  391. end
  392. LIST_ITEMS_ORDER[:element] = convert_integer_array(:element)
  393. LIST_ITEMS_ORDER[:state] = convert_integer_array(:state)
  394. LIST_ITEMS_ORDER[:param] = convert_integer_array(:param)
  395. CHART_ITEMS_ORDER[:element] = convert_integer_chart_array(:element)
  396. CHART_ITEMS_ORDER[:state] = convert_integer_chart_array(:state)
  397. CHART_ITEMS_ORDER[:param] = convert_integer_chart_array(:param)
  398. end
  399. #==============================================================================
  400. # ** DataManager
  401. #==============================================================================
  402. module DataManager
  403. #--------------------------------------------------------------------------
  404. # * Alias: load_database
  405. #--------------------------------------------------------------------------
  406. class << self; alias :bm_status_ld :load_database; end
  407. def self.load_database
  408. bm_status_ld
  409. load_notetags_bm_status
  410. end
  411. #--------------------------------------------------------------------------
  412. # * New Method: load_notetags_bm_status
  413. #--------------------------------------------------------------------------
  414. def self.load_notetags_bm_status
  415. groups = [$data_actors]
  416. for group in groups
  417. for obj in group
  418. next if obj.nil?
  419. obj.load_notetags_bm_status
  420. end
  421. end
  422. end
  423. end
  424. #==============================================================================
  425. # ** RPG::Actor
  426. #==============================================================================
  427. class RPG::Actor < RPG::BaseItem
  428. #--------------------------------------------------------------------------
  429. # * Public Instance Variables
  430. #--------------------------------------------------------------------------
  431. attr_accessor :age
  432. attr_accessor :birthplace
  433. attr_accessor :height
  434. attr_accessor :custom_bio
  435. #--------------------------------------------------------------------------
  436. # * Cache: load_notetags_bm_status
  437. #--------------------------------------------------------------------------
  438. def load_notetags_bm_status
  439. @custom_bio = {}
  440. for i in 1..10
  441. @custom_bio[i] = BM::STATUS::EMPTY_BIO
  442. end
  443. @age = BM::STATUS::EMPTY_BIO
  444. @birthplace = BM::STATUS::EMPTY_BIO
  445. @height = BM::STATUS::EMPTY_BIO
  446. self.note.split(/[\r\n]+/).each { |line|
  447. case line
  448. #---
  449. when BM::REGEXP::ACTOR::AGE
  450. @age = $1.to_i
  451. when BM::REGEXP::ACTOR::BIRTHPLACE
  452. @birthplace = $1
  453. when BM::REGEXP::ACTOR::HEIGHT
  454. @height = $1
  455. when BM::REGEXP::ACTOR::CUSTOMBIO
  456. @custom_bio[$1.to_i] = $2
  457. #---
  458. end
  459. } # self.note.split
  460. end
  461. end
  462. #==============================================================================
  463. # ** Game_Actor
  464. #==============================================================================
  465. class Game_Actor < Game_Battler
  466. #--------------------------------------------------------------------------
  467. # * Public Instance Variables
  468. #--------------------------------------------------------------------------
  469. attr_accessor :age
  470. attr_accessor :set_age
  471. attr_accessor :birthplace
  472. attr_accessor :set_birthplace
  473. attr_accessor :height
  474. attr_accessor :set_height
  475. attr_accessor :gender
  476. attr_accessor :custom_bio
  477. attr_accessor :set_custom_bio
  478. #--------------------------------------------------------------------------
  479. # Alias: Setup
  480. #--------------------------------------------------------------------------
  481. alias :bm_status_setup :setup
  482. def setup(actor_id)
  483. bm_status_setup(actor_id)
  484. init_bio
  485. end
  486. #--------------------------------------------------------------------------
  487. # * New Method: init_bio
  488. #--------------------------------------------------------------------------
  489. def init_bio
  490. @init_year = 0
  491. @init_year = $game_variables[HM_SEL::YEAR] if BM::SELCHAR_CALENDER
  492. @set_age = actor.age
  493. @set_height = actor.height
  494. @set_birthplace = actor.birthplace
  495. @gender = gender
  496. @set_custom_bio = {}
  497. for i in 1..10
  498. @set_custom_bio[i] = actor.custom_bio[i]
  499. end
  500. end
  501. #--------------------------------------------------------------------------
  502. alias_bio = 1..10
  503. alias_bio.each {|i|
  504. aStr = %Q(
  505. attr_accessor :custom_bio#{i}
  506. attr_accessor :set_custom_bio#{i}
  507. def custom_bio#{i}
  508. @set_custom_bio[#{i}]
  509. end
  510. )
  511. module_eval(aStr)
  512. } # Do not remove this.
  513. #--------------------------------------------------------------------------
  514. def height
  515. return @set_height if @set_height == BM::STATUS::EMPTY_BIO
  516. height = sprintf(BM::STATUS::HEIGHT_UNIT, @set_height)
  517. end
  518. #--------------------------------------------------------------------------
  519. def birthplace
  520. @set_birthplace
  521. end
  522. #--------------------------------------------------------------------------
  523. # * New Method: gender
  524. #--------------------------------------------------------------------------
  525. def gender
  526. return "" unless $imported["BubsGenderFunctions"]
  527. n = BM::STATUS::EMPTY_BIO
  528. n = "Male" if male?
  529. n = "Female" if female?
  530. return n
  531. end
  532. #--------------------------------------------------------------------------
  533. # * New Method: age
  534. #--------------------------------------------------------------------------
  535. def age
  536. return @set_age unless BM::SELCHAR_CALENDER
  537. @set_age = actor.age + ($game_variables[HM_SEL::YEAR] - @init_year)
  538. end
  539. end
  540. #==============================================================================
  541. # ** Window_Base
  542. #==============================================================================
  543. class Window_Base < Window
  544. #--------------------------------------------------------------------------
  545. # * Alias: convert_escape_characters
  546. #--------------------------------------------------------------------------
  547. alias :bm_status_cec :convert_escape_characters
  548. def convert_escape_characters(text)
  549. result = bm_status_cec(text)
  550. result = convert_bm_status_characters(result)
  551. return result
  552. end
  553. #--------------------------------------------------------------------------
  554. def convert_bm_status_characters(result)
  555. result.gsub!(/\eAAGE\[([-+]?\w+)\]/i) { escape_actor_bio(:age, $1.to_i) }
  556. result.gsub!(/\eABIRTH\[([-+]?\w+)\]/i) { escape_actor_bio(:birthplace, $1.to_i) }
  557. result.gsub!(/\eAHEIGHT\[([-+]?\w+)\]/i) { escape_actor_bio(:height, $1.to_i) }
  558. result.gsub!(/\eAGEN\[([-+]?\w+)\]/i) { escape_actor_bio(:gender, $1.to_i) }
  559. result.gsub!(/\eABIO\[(\d+),([-+]?\w+)\]/i) { escape_actor_cbio($1.to_i, $2.to_i) }
  560. return result
  561. end
  562. #--------------------------------------------------------------------------
  563. def escape_actor_bio(type, actor_id)
  564. actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  565. actor = $game_actors[actor_id]
  566. return "" if actor.nil?
  567. text = eval("actor.#{type}")
  568. return text
  569. end
  570. #--------------------------------------------------------------------------
  571. def escape_actor_cbio(type, actor_id)
  572. actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  573. actor = $game_actors[actor_id]
  574. return "" if actor.nil?
  575. text = eval("actor.custom_bio#{type}")
  576. return text
  577. end
  578. end
  579. #==============================================================================
  580. module BMCHART
  581. #--------------------------------------------------------------------------
  582. # * adds to: initialize
  583. #--------------------------------------------------------------------------
  584. def initialize(*args)
  585. super(*args)
  586. @duration = 0
  587. @element_chart_sprite = Sprite_Base.new
  588. @state_chart_sprite = Sprite_Base.new
  589. @param_chart_sprite = Sprite_Base.new
  590. create_chart_sprite(@element_chart_sprite)
  591. create_chart_sprite(@state_chart_sprite)
  592. create_chart_sprite(@param_chart_sprite)
  593. end
  594. #--------------------------------------------------------------------------
  595. # * New Method: chart_starter_visibility
  596. #--------------------------------------------------------------------------
  597. def chart_starter_visibility
  598. return unless @element_chart_sprite != nil
  599. @element_chart_sprite.visible = false
  600. @state_chart_sprite.visible = false
  601. @param_chart_sprite.visible = false
  602. end
  603. #--------------------------------------------------------------------------
  604. # * New Method: Draw Element Block
  605. #--------------------------------------------------------------------------
  606. def draw_elemental
  607. dx = contents.width / 3
  608. contents.draw_text(dx, 0, dx, line_height, BM::STATUS::PARAMETER_NAME[:resist],1)
  609. contents.draw_text(dx * 2, 0, dx, line_height, BM::STATUS::PARAMETER_NAME[:inflict],1)
  610. type = BM::STATUS::INFO_STYLE[:element]
  611. draw_stelpa_info(:element,:both, type)
  612. end
  613. #--------------------------------------------------------------------------
  614. # * New Method: Draw Element resist
  615. #--------------------------------------------------------------------------
  616. def draw_ele_resist
  617. dx = contents.width / 3
  618. contents.draw_text(dx, 0, contents.width - dx, line_height, BM::STATUS::PARAMETER_NAME[:resist],1)
  619. type = BM::STATUS::INFO_STYLE[:resist]
  620. draw_stelpa_info(:element,:resist, type)
  621. end
  622. #--------------------------------------------------------------------------
  623. # * New Method: Draw Element inflict
  624. #--------------------------------------------------------------------------
  625. def draw_ele_inflict
  626. dx = contents.width / 3
  627. contents.draw_text(dx, 0, contents.width - dx, line_height, BM::STATUS::PARAMETER_NAME[:inflict],1)
  628. type = BM::STATUS::INFO_STYLE[:inflict]
  629. draw_stelpa_info(:element,:inflict, type)
  630. end
  631. #--------------------------------------------------------------------------
  632. # * New Method: Draw States Block
  633. #--------------------------------------------------------------------------
  634. def draw_states
  635. dx = contents.width / 3
  636. contents.draw_text(dx, 0, dx, line_height, BM::STATUS::PARAMETER_NAME[:resist],1)
  637. contents.draw_text(dx * 2, 0, dx, line_height, BM::STATUS::PARAMETER_NAME[:inflict],1)
  638. type = BM::STATUS::INFO_STYLE[:state]
  639. draw_stelpa_info(:state,:both, type)
  640. end
  641. #--------------------------------------------------------------------------
  642. # * New Method: Draw Element resist
  643. #--------------------------------------------------------------------------
  644. def draw_state_resist
  645. dx = contents.width / 3
  646. contents.draw_text(dx, 0, contents.width - dx, line_height, BM::STATUS::PARAMETER_NAME[:resist],1)
  647. type = BM::STATUS::INFO_STYLE[:resist]
  648. draw_stelpa_info(:state,:resist, type)
  649. end
  650. #--------------------------------------------------------------------------
  651. # * New Method: Draw Element inflict
  652. #--------------------------------------------------------------------------
  653. def draw_state_inflict
  654. dx = contents.width / 3
  655. contents.draw_text(dx, 0, contents.width - dx, line_height, BM::STATUS::PARAMETER_NAME[:inflict],1)
  656. type = BM::STATUS::INFO_STYLE[:inflict]
  657. draw_stelpa_info(:state,:inflict, type)
  658. end
  659. #--------------------------------------------------------------------------
  660. # * New Method: Draw resist
  661. #--------------------------------------------------------------------------
  662. def draw_resist
  663. contents.font.bold = true
  664. change_color(system_color)
  665. contents.draw_text(0, 0, contents.width, line_height, BM::STATUS::PARAMETER_NAME[:resist],1)
  666. contents.font.bold = false
  667. type = BM::STATUS::INFO_STYLE[:resist]
  668. draw_four_column_info(x, line_height * 3 / 2, :resist, type)
  669. end
  670. #--------------------------------------------------------------------------
  671. # * New Method: Draw inflict
  672. #--------------------------------------------------------------------------
  673. def draw_inflict
  674. contents.font.bold = true
  675. change_color(system_color)
  676. contents.draw_text(0, 0, contents.width, line_height, BM::STATUS::PARAMETER_NAME[:inflict],1)
  677. contents.font.bold = false
  678. type = BM::STATUS::INFO_STYLE[:resist]
  679. draw_four_column_info(x, line_height * 3 / 2, :inflict, type)
  680. end
  681. #--------------------------------------------------------------------------
  682. def draw_four_column_info(x, y, info, type)
  683. chart = :element
  684. r = 0
  685. r = (contents.width - x)/12 - 4 if type > 0
  686. width = (contents.width - r*7)/2
  687. contents.font.size = YEA::STATUS::PROPERTIES_FONT_SIZE
  688. if [1, 2, 3].include?(type) && $imported["BitmapExtension"]
  689. x = draw_actor_chart(x, y, r, chart, type) - 10
  690. else; x = 0
  691. end
  692. if [0, 2, 3].include?(type)
  693. x = draw_actor_numbers(x, y, width, chart, info)
  694. end
  695. chart = :state
  696. if [1, 2, 3].include?(type) && $imported["BitmapExtension"]
  697. x = draw_actor_chart(x, y, r, chart, type)
  698. else; x = 0
  699. end
  700. if [0, 2, 3].include?(type)
  701. x = contents.width - width
  702. x = draw_actor_numbers(x, y, width, chart, info)
  703. end
  704. return x
  705. end
  706. #--------------------------------------------------------------------------
  707. def draw_stelpa_info(chart, info, type)
  708. contents.font.bold = true
  709. change_color(system_color)
  710. contents.draw_text(0, 0, contents.width / 3, line_height, BM::STATUS::PARAMETER_NAME[chart],1)
  711. contents.font.bold = false
  712. reset_font_settings
  713. contents.font.size = BM::STATUS::CHART_FONT_SIZE
  714. draw_actor_chart_and_numbers(0, line_height * 3 / 2, chart, info, type)
  715. end
  716. #--------------------------------------------------------------------------
  717. # * new method: draw_actor_chart_and_numbers
  718. #--------------------------------------------------------------------------
  719. def draw_actor_chart_and_numbers(x, y, chart, info, type)
  720. r = 0
  721. r = [(contents.width - x - 80)/6,(contents.height - y - 80)/2].min if type > 0
  722. if [1, 2, 3].include?(type) && $imported["BitmapExtension"]
  723. x = draw_actor_chart(x, y, r, chart, type)
  724. else; x = 0
  725. end
  726. if [0, 2, 3].include?(type)
  727. contents.font.size = YEA::STATUS::PROPERTIES_FONT_SIZE
  728. w = (contents.width - x)/2 - 4
  729. x = draw_actor_numbers(x, y, w, chart, info)
  730. end
  731. return x
  732. end
  733. #--------------------------------------------------------------------------
  734. # * new method: draw_actor_chart
  735. #--------------------------------------------------------------------------
  736. def draw_actor_chart(x, y, radius, chart, type)
  737. Bitmap.smoothing_mode = TRGSSX::SM_ANTIALIAS if BM::STATUS::CHART_HIGHQUALITY
  738. r = radius
  739. cx = x + r + 28
  740. cy = y + r + 28
  741. pw = (Bitmap.smoothing_mode == TRGSSX::SM_ANTIALIAS ? 2 : 1)
  742. items_shown = BM::STATUS::CHART_ITEMS_ORDER[chart]
  743. size = 0
  744. for i in items_shown; size += 1; end
  745. draw_chart_line(cx, cy, r, size, 3, pw, chart) unless type == 3
  746. points = []
  747. items_shown.each_with_index { |e, i|
  748. icon1 = chart_icon(chart, e)
  749. n = graph_values(chart,e)
  750. n = 100 - n if BM::STATUS::NUMBER_STYLE[chart] == 1
  751. n = [[n, -100].max, 200].min
  752. dr = r * (n + 100) / 100 / 3
  753. rad = Math::PI * (360.0 * i / size - 90.0) / 180.0
  754. dx = cx + Integer(dr * Math.cos(-rad))
  755. dy = cy + Integer(dr * Math.sin(rad))
  756. points << [dx, dy]
  757. dx = cx + Integer((r + 14) * Math.cos(-rad)) - 12
  758. dy = cy + Integer((r + 14) * Math.sin(rad)) - 12
  759. draw_icon(icon1, dx, dy) unless type == 3
  760. i += 1
  761. }
  762. unless type == 3
  763. if chart == :element; @element_chart_sprite.visible = true
  764. elsif chart == :state; @state_chart_sprite.visible = true
  765. elsif chart == :param; @param_chart_sprite.visible = true
  766. end
  767. draw_chart(cx, cy, r, points, pw, chart)
  768. draw_chart_flash(x, y, r, points, pw, chart)
  769. end
  770. Bitmap.smoothing_mode = TRGSSX::SM_DEFAULT
  771. return (x + cx + r + 42)
  772. end
  773. #--------------------------------------------------------------------------
  774. def graph_values(chart,id)
  775. n = 0
  776. case chart
  777. when :element
  778. n = eval("(@actor.#{chart}_rate(#{id})*100).to_i")
  779. if $imported["YEA-ElementReflect"] && @actor.element_reflect_rate(id) != 0
  780. n = -(@actor.element_reflect_rate(id) * 100).to_i
  781. elsif $imported["Elemental_Modifiers"]
  782. n = (@actor.element_resist_rate(id) * 100).to_i
  783. end
  784. when :state
  785. n = eval("(@actor.#{chart}_rate(id)*100).to_i")
  786. n = 0 if @actor.state_resist_set.include?(id)
  787. when :param
  788. n = (param_ratio(@actor, id) * 100).to_i
  789. end
  790. return n
  791. end
  792. #--------------------------------------------------------------------------
  793. def chart_icon(chart, id)
  794. if BM::STATUS::CHART_ICONS[chart].include?(id)
  795. return icon = BM::STATUS::CHART_ICONS[chart][id]
  796. elsif $imported[:bm_icon]
  797. return icon = eval("Icon.#{chart}(id)")
  798. elsif chart == :state
  799. return icon = $data_states[id].icon_index
  800. else
  801. return icon = 0
  802. end
  803. end
  804. #--------------------------------------------------------------------------
  805. # * New Method: draw_actor_numbers
  806. #--------------------------------------------------------------------------
  807. def draw_actor_numbers(x, y, width, chart, info)
  808. dx = contents.width / 3
  809. case info
  810. when :resist
  811. x = show_actor_resist(x, y, width, chart)
  812. when :inflict
  813. x = show_actor_inflict(x, y, width, chart)
  814. when :both
  815. x = show_actor_compound(x, y, width, chart)
  816. end
  817. return x + width
  818. end
  819. #--------------------------------------------------------------------------
  820. # * New Method: draw both resistance and inflictions
  821. #--------------------------------------------------------------------------
  822. def show_actor_compound(x, y, width, chart)
  823. items_shown = BM::STATUS::LIST_ITEMS_ORDER[chart]
  824. for id in items_shown
  825. value = eval("#{chart}_number(id)")
  826. colour = Color.new(0, 0, 0, translucent_alpha/2)
  827. rect = Rect.new(x + 1, y + 1, width - 2, line_height - 2)
  828. contents.fill_rect(rect, colour)
  829. change_color(value[2])
  830. draw_text(x, y, width - 6, line_height, value[0])
  831. draw_text(x, y, width - 6, line_height, value[1], 2)
  832. unless chart == :param
  833. dx = contents.width - (contents.width - x)/2 + 6
  834. colour = Color.new(0, 0, 0, translucent_alpha/2)
  835. rect = Rect.new(dx + 1, y + 1, width - 2, line_height - 2)
  836. contents.fill_rect(rect, colour)
  837. change_color(value[4])
  838. draw_text(dx, y, width - 6, line_height, value[0])
  839. draw_text(dx, y, width - 6, line_height, value[3], 2)
  840. end
  841. y += line_height
  842. break if y + line_height > contents.height
  843.  
  844. end
  845. return x
  846. end
  847. #--------------------------------------------------------------------------
  848. # * New Method: draw inflictions
  849. #--------------------------------------------------------------------------
  850. def show_actor_inflict(x, y, width, chart)
  851. items_shown = BM::STATUS::LIST_ITEMS_ORDER[chart]
  852. dy = y
  853. for id in items_shown
  854. value = eval("#{chart}_number(id)")
  855. colour = Color.new(0, 0, 0, translucent_alpha/2)
  856. rect = Rect.new(x + 1, y + 1, width - 2, line_height - 2)
  857. contents.fill_rect(rect, colour)
  858. change_color(value[4])
  859. draw_text(x, y, width - 6, line_height, value[0])
  860. draw_text(x, y, width - 6, line_height, value[3], 2)
  861. y += line_height
  862. if y + line_height > contents.height
  863. x = x + width + 6
  864. y = dy
  865. end
  866. end
  867. return x
  868. end
  869. #--------------------------------------------------------------------------
  870. # * New Method: draw resist
  871. #--------------------------------------------------------------------------
  872. def show_actor_resist(x, y, width, chart)
  873. items_shown = BM::STATUS::LIST_ITEMS_ORDER[chart]
  874. dy = y
  875. for id in items_shown
  876. value = eval("#{chart}_number(id)")
  877. colour = Color.new(0, 0, 0, translucent_alpha/2)
  878. rect = Rect.new(x + 1, y + 1, width - 2, line_height - 2)
  879. contents.fill_rect(rect, colour)
  880. change_color(value[2])
  881. draw_text(x, y, width - 6, line_height, value[0])
  882. draw_text(x, y, width - 6, line_height, value[1], 2)
  883. y += line_height
  884. if y + line_height > contents.height
  885. x = x + width + 6
  886. y = dy
  887. end
  888. end
  889. return x
  890. end
  891. #--------------------------------------------------------------------------
  892. # * New Method: element_number
  893. #--------------------------------------------------------------------------
  894. def element_number(id)
  895. value1 = graph_values(:element,id)
  896. if $imported["YEA-ElementReflect"] && @actor.element_reflect_rate(id) != 0
  897. value1 = (@actor.element_reflect_rate(id) * 100).to_i
  898. color1 = text_color(22)
  899. text1 = sprintf("#{Vocab.xparam_a(5)} %d%", value1) #shows mrf
  900. else
  901. color1 = percent_color((value1 - 100) * -1.to_i)
  902. if value1 == 0; text1 = 'Immune'
  903. elsif value1 < 0; text1 = 'Absorb'
  904. else
  905. value1 = (value1 - 100) * -1.to_i if BM::STATUS::NUMBER_STYLE[:element] == 1
  906. text1 = sprintf("%d%", value1)
  907. end
  908. end
  909. value2 = (@actor.atk_element_rate(id) * 100).to_i
  910. value2 = (@actor.element_attack_rate(id) * 100).to_i if $imported["Elemental_Modifiers"]
  911. color2 = percent_color(value2)
  912. text2 = sprintf("%d%", value2)
  913. return [Vocab.element(id), text1, color1, text2, color2]
  914. end
  915. #--------------------------------------------------------------------------
  916. # * New Method: state_number
  917. #--------------------------------------------------------------------------
  918. def state_number(id)
  919. value1 = graph_values(:state,id)
  920. color1 = percent_color((value1 - 100) * -1.to_i)
  921. if value1 == 0; text1 = 'Immune'
  922. else
  923. value1 = (value1 - 100) * -1.to_i if BM::STATUS::NUMBER_STYLE[:state] == 1
  924. text1 = sprintf("%d%", value1)
  925. end
  926. value2 = (@actor.atk_states_rate(id) * 100).to_i
  927. color2 = percent_color(value2)
  928. text2 = sprintf("%d%", value2)
  929. return [Vocab.state(id), text1, color1, text2, color2]
  930. end
  931. #--------------------------------------------------------------------------
  932. # * New Method: param_number
  933. #--------------------------------------------------------------------------
  934. def param_number(id)
  935. text1 = @actor.param(id).group
  936. color1 = normal_color
  937. return [Vocab.param(id), text1, color1, text1, color1]
  938. end
  939. #--------------------------------------------------------------------------
  940. # * new method: draw_chart_line
  941. #--------------------------------------------------------------------------
  942. def draw_chart_line(cx, cy, r, n, breaks, pw, chart)
  943. color = BM::STATUS::BASE_COLOR[chart].clone
  944. contents.draw_regular_polygon(cx, cy, r, n, color, pw)
  945. color.alpha = color.alpha * 5 / 8
  946. contents.draw_spoke(cx, cy, r, n, color, pw)
  947. (1..breaks).each { |i|
  948. contents.draw_regular_polygon(cx, cy, r * i / breaks, n, color, pw)
  949. }
  950. end
  951. #--------------------------------------------------------------------------
  952. # * new method: draw_chart
  953. #--------------------------------------------------------------------------
  954. def draw_chart(cx, cy, r, points, pw, chart)
  955. contents.draw_polygon(points, BM::STATUS::LINE_COLOR[chart], 2)
  956. end
  957. #--------------------------------------------------------------------------
  958. # * new method: draw_chart_flash
  959. #--------------------------------------------------------------------------
  960. def draw_chart_flash(x, y, r, points, pw, chart)
  961. if chart == :element; sprite = @element_chart_sprite
  962. elsif chart == :state; sprite = @state_chart_sprite
  963. elsif chart == :param; sprite = @param_chart_sprite
  964. else; return
  965. end
  966. points = points.clone
  967. points.each { |pt| pt[0] -= x }
  968. cx = x + r + 28
  969. cy = y + r + 28
  970. color = BM::STATUS::FLASH_COLOR[chart]
  971. sprite.bitmap.clear
  972. sprite.bitmap.fill_polygon(points, Color.new(0, 0, 0, 0), color)
  973. sprite.ox = cx - x
  974. sprite.oy = cy
  975. sprite.x = self.x + cx + standard_padding
  976. sprite.y = self.y + cy + standard_padding
  977. end
  978. #--------------------------------------------------------------------------
  979. # * new method: update_chart
  980. #--------------------------------------------------------------------------
  981. def update_chart(sprite)
  982. return if sprite == nil
  983. sprite.update
  984. zoom = opacity = 0
  985. case @duration
  986. when 0..11
  987. zoom = @duration / 11.0
  988. opacity = 255
  989. when 12..27
  990. zoom = 1
  991. opacity = (27 - @duration) * 16
  992. end
  993. sprite.zoom_x = sprite.zoom_y = zoom
  994. sprite.opacity = opacity
  995. @duration = (@duration + BM::STATUS::CHART_FRAME_RATE) % Graphics.frame_rate
  996. end
  997. #--------------------------------------------------------------------------
  998. # * new method: create_chart_sprite
  999. #--------------------------------------------------------------------------
  1000. def create_chart_sprite(sprite)
  1001. return if sprite == nil
  1002. sprite.z = 1000
  1003. sprite.bitmap = Bitmap.new(height - 32, height - 32)
  1004. sprite.ox = sprite.width / 2
  1005. sprite.oy = sprite.height / 2
  1006. sprite.blend_type = 1
  1007. sprite.opacity = 0
  1008. sprite.visible = false
  1009. end
  1010. #--------------------------------------------------------------------------
  1011. # * adds to: update
  1012. #--------------------------------------------------------------------------
  1013. def update
  1014. super
  1015. update_chart(@element_chart_sprite)
  1016. update_chart(@state_chart_sprite)
  1017. update_chart(@param_chart_sprite)
  1018. end
  1019. #--------------------------------------------------------------------------
  1020. # * adds to: dispose
  1021. #--------------------------------------------------------------------------
  1022. def dispose
  1023. super
  1024. dispose_sprites(@element_chart_sprite)
  1025. dispose_sprites(@state_chart_sprite)
  1026. dispose_sprites(@param_chart_sprite)
  1027. end
  1028. #--------------------------------------------------------------------------
  1029. # * new Method: dispose
  1030. #--------------------------------------------------------------------------
  1031. def dispose_sprites(sprite)
  1032. return unless sprite != nil
  1033. sprite.bitmap.dispose
  1034. sprite.dispose
  1035. end
  1036. #--------------------------------------------------------------------------
  1037. # * mew method: Z
  1038. #--------------------------------------------------------------------------
  1039. def z=(value)
  1040. super(value)
  1041. @element_chart_sprite.z = z + 1 if @element_chart_sprite != nil
  1042. @state_chart_sprite.z = z + 1 if @state_chart_sprite != nil
  1043. @param_chart_sprite.z = z + 1 if @param_chart_sprite != nil
  1044. end
  1045. end
  1046. #==============================================================================
  1047. # ** Window_StatusActor
  1048. #==============================================================================
  1049. class Window_StatusActor < Window_Base
  1050. if BM::MOVE_STATE_OVER_FACE
  1051. alias :bm_status_dai :draw_actor_icons
  1052. def draw_actor_icons(actor, x, y)
  1053. bm_status_dai(actor, 0, 72)
  1054. end
  1055. end
  1056. end
  1057. #==============================================================================
  1058. # ** Window_StatusItem
  1059. #==============================================================================
  1060. class Window_StatusItem < Window_Base
  1061. include BMCHART
  1062. #--------------------------------------------------------------------------
  1063. # * alias: initialize
  1064. #--------------------------------------------------------------------------
  1065. alias :bm_status_init :initialize
  1066. def initialize(*args)
  1067. @page = {}
  1068. bm_status_init(*args)
  1069. end
  1070. #--------------------------------------------------------------------------
  1071. def current_page
  1072. if @page[@command_window.current_symbol] == nil
  1073. @page[@command_window.current_symbol] = 0
  1074. end
  1075. return @page[@command_window.current_symbol]
  1076. end
  1077. #--------------------------------------------------------------------------
  1078. def new_page(symbol)
  1079. if current_page >= 0 && current_page < BM::STATUS::TOGGLE_WINDOWS[symbol].size-1
  1080. @page[symbol] += 1
  1081. elsif current_page == BM::STATUS::TOGGLE_WINDOWS[symbol].size-1
  1082. @page[symbol] = 0
  1083. end
  1084. refresh
  1085. end
  1086. #--------------------------------------------------------------------------
  1087. # alias: draw_window_contents
  1088. #--------------------------------------------------------------------------
  1089. alias :bm_status_dwc :draw_window_contents
  1090. def draw_window_contents
  1091. chart_starter_visibility
  1092. if BM::STATUS::TOGGLE_WINDOWS.include?(@command_window.current_symbol)
  1093. page_name = BM::STATUS::TOGGLE_WINDOWS[@command_window.current_symbol][current_page]
  1094. if BM::STATUS::PORTRAIT_BACKGROUND.include?(page_name)
  1095. draw_actor_portrait(@actor, 0, 10, false)
  1096. end
  1097. case page_name
  1098. when :general
  1099. draw_actor_general
  1100. when :parameters
  1101. draw_parameter_graph
  1102. when :properties
  1103. draw_properties_list
  1104. when :biography, :rename, :retitle
  1105. draw_actor_biography
  1106. else
  1107. draw_toggle_custom
  1108. end
  1109. dx = contents.width - 24; dy = contents.height - 24
  1110. draw_icon(BM::STATUS::TOGGLE_ICON, dx, dy)
  1111. else
  1112. bm_status_dwc
  1113. end
  1114. end
  1115. #--------------------------------------------------------------------------
  1116. # draw_toggle_custom
  1117. #--------------------------------------------------------------------------
  1118. def draw_toggle_custom
  1119. current_symbol = BM::STATUS::TOGGLE_WINDOWS[@command_window.current_symbol][current_page]
  1120. return unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(current_symbol)
  1121. method(YEA::STATUS::CUSTOM_STATUS_COMMANDS[current_symbol][3]).call
  1122. end
  1123. #--------------------------------------------------------------------------
  1124. # * overwrite: draw_actor_general
  1125. #--------------------------------------------------------------------------
  1126. def draw_actor_general
  1127. contents.font.bold = true
  1128. change_color(system_color)
  1129. text = YEA::STATUS::PARAMETERS_VOCAB
  1130. draw_text(0, 0, contents.width, line_height, text, 1)
  1131. reset_font_settings
  1132. x = 0; y = line_height * 3 / 2
  1133. dx = draw_actor_chart_and_numbers(x, y, :param, :both, 1) - 14
  1134. draw_general_parameters(dx)
  1135. end
  1136. #--------------------------------------------------------------------------
  1137. # * overwrite: draw_general_parameters
  1138. #--------------------------------------------------------------------------
  1139. def draw_general_parameters(dx)
  1140. dy = line_height * 3 / 2
  1141. dw = (contents.width - dx) / 3 - 6
  1142. draw_actor_level(dx + dw * 0, line_height * 0 + dy, dw)
  1143. draw_actor_exp(dx + dw * 1 + 6, line_height * 0 + dy, (dw + 3)*2)
  1144. draw_exp_gauge(dx + dw * 0, line_height * 0.7 + dy, (dw+3)*3) if BM::STATUS::GAUGE[:exp]
  1145.  
  1146. draw_actor_param(0, dx + dw * 0, line_height * 2 + dy, dw)
  1147. draw_gauge(dx + dw * 0, line_height * 2.7 + dy, dw, @actor.hp_rate, hp_gauge_color1, hp_gauge_color2) if BM::STATUS::GAUGE[:hp]
  1148. draw_actor_param(1, dx + dw * 1 + 6, line_height * 2 + dy, dw)
  1149. draw_gauge(dx + dw * 1 + 6, line_height * 2.7 + dy, dw, @actor.mp_rate, mp_gauge_color1, mp_gauge_color2) if BM::STATUS::GAUGE[:mp]
  1150. draw_actor_tp(@actor, dx + dw * 2 + 12, line_height * 2 + dy, dw)
  1151. draw_gauge(dx + dw * 2 + 12, line_height * 2.7 + dy, dw, @actor.tp_rate, tp_gauge_color1, tp_gauge_color2) if BM::STATUS::GAUGE[:tp]
  1152.  
  1153. draw_actor_param(2, dx + dw * 0, line_height * 4 + dy, dw)
  1154. draw_actor_param(4, dx + dw * 1 + 6, line_height * 4 + dy, dw)
  1155. draw_actor_param(6, dx + dw * 2 + 12, line_height * 4 + dy, dw)
  1156. dy += 6
  1157. draw_actor_param(3, dx + dw * 0, line_height * 5 + dy, dw)
  1158. draw_actor_param(5, dx + dw * 1 + 6, line_height * 5 + dy, dw)
  1159. draw_actor_param(7, dx + dw * 2 + 12, line_height * 5 + dy, dw)
  1160. if BM::STATUS::GAUGE[:param]
  1161. draw_gauge(dx + dw * 0, line_height * 4.1 + dy, dw, param_ratio(@actor,2), param_gauge1(2), param_gauge2(2))
  1162. draw_gauge(dx + dw * 1+6, line_height * 4.1 + dy, dw, param_ratio(@actor,4), param_gauge1(4), param_gauge2(4))
  1163. draw_gauge(dx + dw * 2+12, line_height * 4.1 + dy, dw, param_ratio(@actor,6), param_gauge1(6), param_gauge2(6))
  1164. dy += 6
  1165. draw_gauge(dx + dw * 0, line_height * 5.1 + dy, dw, param_ratio(@actor,3), param_gauge1(3), param_gauge2(3))
  1166. draw_gauge(dx + dw * 1+6, line_height * 5.1 + dy, dw, param_ratio(@actor,5), param_gauge1(5), param_gauge2(5))
  1167. draw_gauge(dx + dw * 2+12, line_height * 5.1 + dy, dw, param_ratio(@actor,7), param_gauge1(7), param_gauge2(7))
  1168. end
  1169. end
  1170. #--------------------------------------------------------------------------
  1171. # * Draw EXP Gauge
  1172. #--------------------------------------------------------------------------
  1173. def draw_exp_gauge(x, y, width = 124)
  1174. draw_gauge(x, y, width, exp_rate(@actor), exp_gauge1, exp_gauge2)
  1175. end
  1176. #--------------------------------------------------------------------------
  1177. # * Draw TP
  1178. #--------------------------------------------------------------------------
  1179. def draw_actor_tp(actor, x, y, width = 124)
  1180. colour = Color.new(0, 0, 0, translucent_alpha/2)
  1181. rect = Rect.new(x+1, y+1, width-2, line_height-2)
  1182. contents.fill_rect(rect, colour)
  1183. change_color(system_color)
  1184. draw_text(x+4, y, width-8, line_height, Vocab::tp)
  1185. change_color(normal_color)
  1186. draw_text(x+4, y, width-8, line_height, actor.tp.to_i, 2)
  1187. end
  1188. #--------------------------------------------------------------------------
  1189. # * new method: draw_actor_exp
  1190. #--------------------------------------------------------------------------
  1191. def draw_actor_exp(dx, dy, dw)
  1192. colour = Color.new(0, 0, 0, translucent_alpha/2)
  1193. rect = Rect.new(dx + 1, dy + 1, dw - 2, line_height - 2)
  1194. contents.fill_rect(rect, colour)
  1195. change_color(system_color)
  1196. draw_text(dx + 4, dy, dw - 8, line_height, "#{Vocab.exp} needed")
  1197. s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp
  1198. change_color(normal_color)
  1199. draw_text(dx + 4, dy, dw - 8, line_height, s2, 2)
  1200. end
  1201. #--------------------------------------------------------------------------
  1202. # * overwrite: draw_parameter_graph
  1203. #--------------------------------------------------------------------------
  1204. def draw_parameter_graph
  1205. draw_parameter_title
  1206. type = BM::STATUS::INFO_STYLE[:param]
  1207. draw_actor_chart_and_numbers(0, line_height * 3 / 2, :param, :both, type)
  1208. end
  1209. #--------------------------------------------------------------------------
  1210. # * overwrite: draw_parameter_title
  1211. #--------------------------------------------------------------------------
  1212. def draw_parameter_title
  1213. contents.font.bold = true
  1214. change_color(system_color)
  1215. text = YEA::STATUS::PARAMETERS_VOCAB
  1216. draw_text(0, 0, contents.width, line_height, text, 1)
  1217. reset_font_settings
  1218. end
  1219. #--------------------------------------------------------------------------
  1220. # * new method: draw_bmproper_title
  1221. #--------------------------------------------------------------------------
  1222. def draw_bmproper_title
  1223. contents.font.bold = true
  1224. change_color(system_color)
  1225. text = "Attributes"
  1226. draw_text(0, 0, contents.width, line_height, text, 1)
  1227. reset_font_settings
  1228. end
  1229. #--------------------------------------------------------------------------
  1230. # * new method: draw_bmproper
  1231. #--------------------------------------------------------------------------
  1232. def draw_bmprop
  1233. draw_bmproper_title
  1234. contents.font.size = YEA::STATUS::PROPERTIES_FONT_SIZE
  1235. draw_bmproper_column
  1236. reset_font_settings
  1237. end
  1238. #--------------------------------------------------------------------------
  1239. # * new method: draw_bmproper_column
  1240. #--------------------------------------------------------------------------
  1241. def draw_bmproper_column
  1242. dx = 0
  1243. dw = (contents.width-dx*2) / BM::STATUS::NUM_COL - 6
  1244. dy = line_height * 3 / 2
  1245. size = BM::STATUS::BMPROPERTIES_COLUMN.size
  1246. max_size = contents.height - line_height * 3 / 2
  1247. col = (size / BM::STATUS::NUM_COL * line_height) + dy - line_height
  1248. for property in BM::STATUS::BMPROPERTIES_COLUMN
  1249. dy = draw_property(property, dx, dy, dw)
  1250. if dy > [col, max_size].min
  1251. dy = line_height * 3 / 2
  1252. dx += dw + 6
  1253. end
  1254. if dx > contents.width - dw; return; end
  1255. end
  1256. end
  1257. #--------------------------------------------------------------------------
  1258. # overwrite: draw_properties_column1
  1259. #--------------------------------------------------------------------------
  1260. def draw_properties_column1
  1261. dx = 24
  1262. dw = (contents.width - 24) / 3 - 24
  1263. dy = 0
  1264. for property in YEA::STATUS::PROPERTIES_COLUMN1
  1265. dy = draw_property(property[0], dx, dy, dw)
  1266. end
  1267. end
  1268. #--------------------------------------------------------------------------
  1269. # overwrite: draw_properties_column2
  1270. #--------------------------------------------------------------------------
  1271. def draw_properties_column2
  1272. dx = 24 + (contents.width - 24) / 3
  1273. dw = (contents.width - 24) / 3 - 24
  1274. dy = 0
  1275. for property in YEA::STATUS::PROPERTIES_COLUMN2
  1276. dy = draw_property(property[0], dx, dy, dw)
  1277. end
  1278. end
  1279. #--------------------------------------------------------------------------
  1280. # overwrite: draw_properties_column3
  1281. #--------------------------------------------------------------------------
  1282. def draw_properties_column3
  1283. dx = 24 + (contents.width - 24) / 3 * 2
  1284. dw = (contents.width - 24) / 3 - 24
  1285. dy = 0
  1286. for property in YEA::STATUS::PROPERTIES_COLUMN3
  1287. dy = draw_property(property[0], dx, dy, dw)
  1288. end
  1289. end
  1290. #--------------------------------------------------------------------------
  1291. # * overwrite method: draw_property
  1292. #--------------------------------------------------------------------------
  1293. def draw_property(property, dx, dy, dw)
  1294. case property
  1295. #---
  1296. when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
  1297. text1 = Vocab.xparam_a(property)
  1298. text2 = Vocab.xparam_f(property)
  1299. value = eval("@actor.#{property}")
  1300. when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
  1301. text1 = Vocab.sparam_a(property)
  1302. text2 = Vocab.sparam_f(property)
  1303. value = eval("@actor.#{property}")
  1304. when :gut
  1305. return dy unless $imported["BubsGuts"]
  1306. text1 = Vocab.cparam_a(property)
  1307. text2 = Vocab.cparam_f(property)
  1308. value = eval("@actor.#{property}/@actor.#{property}_max")
  1309. when :hcr, :tcr_y, :gcr
  1310. return dy unless $imported["YEA-SkillCostManager"]
  1311. text1 = Vocab.cparam_a(property)
  1312. text2 = Vocab.cparam_f(property)
  1313. value = eval("@actor.#{property}")
  1314. when :cdr, :wur
  1315. return dy unless $imported["YEA-SkillRestrictions"]
  1316. text1 = Vocab.cparam_a(property)
  1317. text2 = Vocab.cparam_f(property)
  1318. value = eval("@actor.#{property}")
  1319. when :hp_physical, :mp_physical, :hp_magical, :mp_magical
  1320. return dy unless $imported["YEA-ConvertDamage"]
  1321. text1 = Vocab.cparam_a(property)
  1322. text2 = Vocab.cparam_f(property)
  1323. value = @actor.convert_dmg_rate(property)
  1324. #---
  1325. when :blank; return dy + line_height
  1326. when :hblank; return dy + line_height/2
  1327. else; return dy
  1328. end
  1329. value = sprintf("%1.1f%%", value * 100) if value != nil
  1330. colour = Color.new(0, 0, 0, translucent_alpha/2)
  1331. rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  1332. contents.fill_rect(rect, colour)
  1333. change_color(system_color)
  1334. cw = text_size("100.0%").width
  1335. if BM::STATUS::PROPERTIES_FULL_NAME
  1336. draw_text(dx, dy, dw-cw, line_height, text2, 0)
  1337. else
  1338. draw_text(dx, dy, dw-cw, line_height, text1, 0)
  1339. end
  1340. change_color(normal_color)
  1341. draw_text(dx + 4, dy, dw - 8, line_height, value, 2)
  1342. return dy + line_height
  1343. end
  1344. #--------------------------------------------------------------------------
  1345. # * new method: draw_actor_nickname
  1346. #--------------------------------------------------------------------------
  1347. def draw_actor_nickname
  1348. contents.font.bold = true
  1349. fmt = YEA::STATUS::BIOGRAPHY_NICKNAME_TEXT
  1350. text = sprintf(fmt, @actor.name, @actor.nickname)
  1351. contents.font.size = YEA::STATUS::BIOGRAPHY_NICKNAME_SIZE
  1352. draw_text(0, 0, contents.width, line_height*2, text, 1)
  1353. end
  1354. #--------------------------------------------------------------------------
  1355. # draw_actor_yeabiography
  1356. #--------------------------------------------------------------------------
  1357. def draw_actor_yeabiography
  1358. draw_actor_nickname
  1359. reset_font_settings
  1360. x = 24;y = line_height * 2
  1361. if BM::STATUS::YEA_BIO_BOX
  1362. colour = Color.new(0, 0, 0, translucent_alpha/2)
  1363. rect = Rect.new(x, y, contents.width-x*2, contents.height-y - line_height)
  1364. contents.fill_rect(rect, colour)
  1365. end
  1366. draw_text_ex(x, y, @actor.description)
  1367. end
  1368. #--------------------------------------------------------------------------
  1369. # * new method: draw_actor_bmbiography
  1370. #--------------------------------------------------------------------------
  1371. def draw_actor_bmbiography
  1372. draw_actor_nickname
  1373. reset_font_settings
  1374. y = line_height * 1
  1375. contents.font.size = BM::STATUS::BIO_FONT_SIZE
  1376. bio_info_list = BM::STATUS::BIO_INFO
  1377. bio_info_list = BM::STATUS::ACTOR_BIO_INFO[@actor.id] if BM::STATUS::ACTOR_BIO_INFO.include?(@actor.id)
  1378. for id in bio_info_list
  1379. y = draw_actor_bio_info(id, 260, y, contents.width-272)
  1380. break if y + line_height > contents.height
  1381. end
  1382. reset_font_settings
  1383. end
  1384. #--------------------------------------------------------------------------
  1385. # * new method: draw_actor_bio_info
  1386. #--------------------------------------------------------------------------
  1387. def draw_actor_bio_info(id, x, y, width = 100)
  1388. case id
  1389. when :blank; return y + line_height
  1390. when :hblank; return dy + line_height/2
  1391. when :align
  1392. return y unless $imported[:bm_align]
  1393. text1 = BM::STATUS::BIO_INFO_TEXT[id]
  1394. text2 = eval("@actor.#{id}_name")
  1395. when :age, :birthplace, :height, :nickname
  1396. text1 = BM::STATUS::BIO_INFO_TEXT[id]
  1397. text2 = eval("@actor.#{id}")
  1398. when :gender
  1399. return y unless $imported["BubsGenderFunctions"]
  1400. text1 = BM::STATUS::BIO_INFO_TEXT[id]
  1401. text2 = eval("@actor.#{id}")
  1402. else
  1403. return y unless BM::STATUS::CBIO_INFO_TEXT.include?(id)
  1404. text1 = BM::STATUS::CBIO_INFO_TEXT[id]
  1405. text2 = eval("@actor.#{id}")
  1406. end
  1407. cw = text_size(text1).width
  1408. colour = Color.new(0, 0, 0, translucent_alpha/2)
  1409. rect = Rect.new(x-2, y-1, width+4, line_height-2)
  1410. contents.fill_rect(rect, colour)
  1411. change_color(system_color)
  1412. draw_text(x, y, width, line_height, text1)
  1413. change_color(normal_color)
  1414. draw_text(x + cw, y, width-cw, line_height, text2, 2)
  1415. return y + line_height
  1416. end
  1417. end
  1418. #==============================================================================
  1419. # ** Scene_Status
  1420. #==============================================================================
  1421. class Scene_Status < Scene_MenuBase
  1422. #--------------------------------------------------------------------------
  1423. # alias: start
  1424. #--------------------------------------------------------------------------
  1425. alias :bm_status_s :start
  1426. def start
  1427. bm_status_s
  1428. bm_win_opacity
  1429. end
  1430. #--------------------------------------------------------------------------
  1431. def bm_win_opacity
  1432. @command_window.opacity = BM::STATUS::BG_OPTIONS[:win_opacity] unless @command_window.nil?
  1433. @help_window.opacity = BM::STATUS::BG_OPTIONS[:win_opacity] unless @help_window.nil?
  1434. @item_window.opacity = BM::STATUS::BG_OPTIONS[:win_opacity] unless @item_window.nil?
  1435. @status_window.opacity = BM::STATUS::BG_OPTIONS[:win_opacity] unless @status_window.nil?
  1436. end
  1437. #--------------------------------------------------------------------------
  1438. # * Create Background Image
  1439. #--------------------------------------------------------------------------
  1440. alias :bm_status_cb :create_background
  1441. def create_background
  1442. return bm_status_cb unless custom_bg? && !$imported[:bm_menustatus]
  1443. custom_background
  1444. end
  1445. #--------------------------------------------------------------------------
  1446. def custom_bg?
  1447. return false if BM::STATUS::BG_OPTIONS[:bg_image] == ""
  1448. return false unless BM::STATUS::BG_OPTIONS[:show_bg_img]
  1449. return true
  1450. end
  1451. #--------------------------------------------------------------------------
  1452. def custom_background
  1453. @background_sprite = Plane.new
  1454. @background_sprite.bitmap = Cache.system(BM::STATUS::BG_OPTIONS[:bg_image])
  1455. @background_sprite.opacity = BM::STATUS::BG_OPTIONS[:bg_opacity]
  1456. end
  1457. #--------------------------------------------------------------------------
  1458. def update_background
  1459. return if BM::STATUS::BG_OPTIONS[:bg_scroll_x] == 0 && BM::STATUS::BG_OPTIONS[:bg_scroll_y] == 0
  1460. @background_sprite.ox += BM::STATUS::BG_OPTIONS[:bg_scroll_x]
  1461. @background_sprite.oy += BM::STATUS::BG_OPTIONS[:bg_scroll_y]
  1462. end
  1463. #--------------------------------------------------------------------------
  1464. # alias: update
  1465. #--------------------------------------------------------------------------
  1466. alias :bm_status_up :update
  1467. def update
  1468. bm_status_up
  1469. update_background if custom_bg? && !$imported[:bm_menustatus]
  1470. if Input.trigger?(BM::STATUS::TOGGLE_BUTTON)
  1471. if BM::STATUS::TOGGLE_WINDOWS.include?(@command_window.current_symbol)
  1472. command_toggle(@command_window.current_symbol)
  1473. end
  1474. end
  1475. end
  1476. #--------------------------------------------------------------------------
  1477. # new method: command_toggle
  1478. #--------------------------------------------------------------------------
  1479. def command_toggle(symbol)
  1480. Sound.play_ok if BM::STATUS::TOGGLE_SOUND
  1481. @item_window.new_page(symbol)
  1482. @command_window.activate
  1483. return
  1484. end
  1485. #--------------------------------------------------------------------------
  1486. # overwrite: process_custom_status_commands
  1487. #--------------------------------------------------------------------------
  1488. def process_custom_status_commands
  1489. for command in YEA::STATUS::COMMANDS
  1490. if BM::STATUS::TOGGLE_WINDOWS.include?(command)
  1491. end
  1492. end
  1493. for command in YEA::STATUS::COMMANDS
  1494. next unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(command[0])
  1495. called_method = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][2]
  1496. called_method = nil if called_method == :do_nothing
  1497. unless called_method == nil
  1498. @command_window.set_handler(command[0], method(called_method))
  1499. end
  1500. end
  1501. end
  1502. #--------------------------------------------------------------------------
  1503. # new method: command_states
  1504. #--------------------------------------------------------------------------
  1505. def command_states
  1506. SceneManager.call(Scene_StatusStates)
  1507. end
  1508. #--------------------------------------------------------------------------
  1509. # new method: command_resist
  1510. #--------------------------------------------------------------------------
  1511. def command_resist
  1512. SceneManager.call(Scene_StatusResist)
  1513. end
  1514. #--------------------------------------------------------------------------
  1515. # new method: command_inflict
  1516. #--------------------------------------------------------------------------
  1517. def command_inflict
  1518. SceneManager.call(Scene_StatusInflict)
  1519. end
  1520. #--------------------------------------------------------------------------
  1521. # new method: command_elements
  1522. #--------------------------------------------------------------------------
  1523. def command_elements
  1524. SceneManager.call(Scene_StatusElements)
  1525. end
  1526. #--------------------------------------------------------------------------
  1527. # relocate_windows
  1528. #--------------------------------------------------------------------------
  1529. alias :bm_status_rw :relocate_windows
  1530. def relocate_windows
  1531. return unless $imported["YEA-AceMenuEngine"]
  1532. bm_status_rw
  1533. @item_window.refresh
  1534. end
  1535. end
  1536. #==============================================================================
  1537. # ** Window_StatesElements
  1538. #==============================================================================
  1539. class Window_StatesElements < Window_Selectable
  1540. include BMCHART
  1541. #--------------------------------------------------------------------------
  1542. # initialize
  1543. #--------------------------------------------------------------------------
  1544. def initialize(actor, x, y, chart)
  1545. @page = {}
  1546. if BM::STATUS::ONE_PAGE[chart]
  1547. @page[chart] = -1
  1548. else
  1549. @page[chart] = 0
  1550. end
  1551. super(x, y, Graphics.width, Graphics.height-y)
  1552. @actor = actor
  1553. @chart = chart
  1554. @page_index = 0
  1555. refresh
  1556. activate
  1557. end
  1558. #--------------------------------------------------------------------------
  1559. def current_page
  1560. if @page[@chart] == nil
  1561. @page[@chart] = 0
  1562. end
  1563. return @page[@chart]
  1564. end
  1565. #--------------------------------------------------------------------------
  1566. def new_page(symbol)
  1567. if current_page >= 0 && current_page < BM::STATUS::TOGGLE_WINDOWS[@chart].size-1
  1568. @page[symbol] += 1
  1569. elsif current_page == BM::STATUS::TOGGLE_WINDOWS[@chart].size-1
  1570. @page[symbol] = 0
  1571. end
  1572. refresh
  1573. end
  1574. #--------------------------------------------------------------------------
  1575. # actor=
  1576. #--------------------------------------------------------------------------
  1577. def actor=(actor)
  1578. return if @actor == actor
  1579. @actor = actor
  1580. refresh
  1581. end
  1582. #--------------------------------------------------------------------------
  1583. # refresh
  1584. #--------------------------------------------------------------------------
  1585. def refresh
  1586. contents.clear
  1587. reset_font_settings
  1588. return unless @actor
  1589. draw_window_contents
  1590. end
  1591. #--------------------------------------------------------------------------
  1592. def draw_window_contents
  1593. chart_starter_visibility
  1594. draw_custom
  1595. if !BM::STATUS::ONE_PAGE[@chart]
  1596. dx = contents.width - 24; dy = contents.height - 24
  1597. draw_icon(BM::STATUS::TOGGLE_ICON, dx, dy)
  1598. end
  1599. end
  1600. #--------------------------------------------------------------------------
  1601. # draw_toggle_custom
  1602. #--------------------------------------------------------------------------
  1603. def draw_custom
  1604. if BM::STATUS::TOGGLE_WINDOWS.include?(@chart) && !BM::STATUS::ONE_PAGE[@chart]
  1605. current_symbol = BM::STATUS::TOGGLE_WINDOWS[@chart][current_page]
  1606. else
  1607. current_symbol = @chart
  1608. end
  1609. return unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(current_symbol)
  1610. method(YEA::STATUS::CUSTOM_STATUS_COMMANDS[current_symbol][3]).call
  1611. end
  1612. #--------------------------------------------------------------------------
  1613. # alias: update
  1614. #--------------------------------------------------------------------------
  1615. alias :bm_status_up :update
  1616. def update
  1617. bm_status_up
  1618. if Input.trigger?(BM::STATUS::TOGGLE_BUTTON)
  1619. new_page(@chart)
  1620. end
  1621. end
  1622. end
  1623. #==============================================================================
  1624. # ** Scene_PolyVisual
  1625. #==============================================================================
  1626. class Scene_PolyVisual < Scene_MenuBase
  1627. #--------------------------------------------------------------------------
  1628. # * Start Processing
  1629. #--------------------------------------------------------------------------
  1630. def start
  1631. super
  1632. create_status_window
  1633. create_info_window
  1634. bm_win_opacity
  1635. end
  1636. #--------------------------------------------------------------------------
  1637. def bm_win_opacity
  1638. @info_window.opacity = BM::STATUS::BG_OPTIONS[:win_opacity] unless @info_window.nil?
  1639. @status_window.opacity = BM::STATUS::BG_OPTIONS[:win_opacity] unless @status_window.nil?
  1640. end
  1641. #--------------------------------------------------------------------------
  1642. # * Create Background Image
  1643. #--------------------------------------------------------------------------
  1644. unless method_defined?(:bm_menu_cb)
  1645. alias :bm_menu_cb :create_background
  1646. end
  1647. def create_background
  1648. return bm_menu_cb unless custom_bg?
  1649. custom_background
  1650. end
  1651. #--------------------------------------------------------------------------
  1652. def custom_bg?
  1653. return false if BM::STATUS::BG_OPTIONS[:bg_image] == ""
  1654. return false unless BM::STATUS::BG_OPTIONS[:show_bg_img]
  1655. return true
  1656. end
  1657. #--------------------------------------------------------------------------
  1658. def custom_background
  1659. @background_sprite = Plane.new
  1660. @background_sprite.bitmap = Cache.system(BM::STATUS::BG_OPTIONS[:bg_image])
  1661. @background_sprite.opacity = BM::STATUS::BG_OPTIONS[:bg_opacity]
  1662. end
  1663. #--------------------------------------------------------------------------
  1664. def update_background
  1665. return if BM::STATUS::BG_OPTIONS[:bg_scroll_x] == 0 && BM::STATUS::BG_OPTIONS[:bg_scroll_y] == 0
  1666. @background_sprite.ox += BM::STATUS::BG_OPTIONS[:bg_scroll_x]
  1667. @background_sprite.oy += BM::STATUS::BG_OPTIONS[:bg_scroll_y]
  1668. end
  1669. #--------------------------------------------------------------------------
  1670. # * Update_Background_Image
  1671. #--------------------------------------------------------------------------
  1672. unless method_defined?(:bm_menu_u)
  1673. alias :bm_menu_u :update
  1674. end
  1675. def update
  1676. bm_menu_u
  1677. update_background if custom_bg?
  1678. end
  1679. #--------------------------------------------------------------------------
  1680. def type
  1681. return :state
  1682. end
  1683. #--------------------------------------------------------------------------
  1684. # * create_states_window
  1685. #--------------------------------------------------------------------------
  1686. def create_info_window
  1687. wy = @status_window.height
  1688. @info_window = Window_StatesElements.new(@actor,0,wy,type)
  1689. @info_window.set_handler(:cancel, method(:return_scene))
  1690. @info_window.set_handler(:pagedown, method(:next_actor))
  1691. @info_window.set_handler(:pageup, method(:prev_actor))
  1692. end
  1693. #--------------------------------------------------------------------------
  1694. # * Change Actors
  1695. #--------------------------------------------------------------------------
  1696. def on_actor_change
  1697. @info_window.actor = @actor
  1698. @status_window.actor = @actor
  1699. @info_window.activate
  1700. end
  1701. #--------------------------------------------------------------------------
  1702. # * Create Status Window
  1703. #--------------------------------------------------------------------------
  1704. def create_status_window
  1705. @status_window = Window_SkillStatus.new(0, 0)
  1706. @status_window.width = Graphics.width
  1707. @status_window.viewport = @viewport
  1708. @status_window.actor = @actor
  1709. end
  1710. end
  1711. #==============================================================================
  1712. # ** Scene_StatusElements
  1713. #==============================================================================
  1714. class Scene_StatusElements < Scene_PolyVisual
  1715. #--------------------------------------------------------------------------
  1716. def type
  1717. return :element
  1718. end
  1719. end
  1720. #==============================================================================
  1721. # ** Scene_StatusStates
  1722. #==============================================================================
  1723. class Scene_StatusStates < Scene_PolyVisual
  1724. #--------------------------------------------------------------------------
  1725. def type
  1726. return :state
  1727. end
  1728. end
  1729. #==============================================================================
  1730. # ** Scene_StatusResist
  1731. #==============================================================================
  1732. class Scene_StatusResist < Scene_PolyVisual
  1733. #--------------------------------------------------------------------------
  1734. def type
  1735. return :resistance
  1736. end
  1737. end
  1738. #==============================================================================
  1739. # ** Scene_StatusInflict
  1740. #==============================================================================
  1741. class Scene_StatusInflict < Scene_PolyVisual
  1742. #--------------------------------------------------------------------------
  1743. def type
  1744. return :infliction
  1745. end
  1746. end
  1747.  
  1748.  
  1749. if !YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(:resistances)
  1750. YEA::STATUS::CUSTOM_STATUS_COMMANDS.merge!(BM::STATUS::CHART_STATUS_COMMANDS)
  1751. end
  1752. #===============================================================================
  1753. #
  1754. # END OF FILE
  1755. #
  1756. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement