Advertisement
Guest User

Untitled

a guest
Jul 12th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 143.16 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # Y Yanfly Engine Ace - Ace Battle Engine v1.22
  4. # -- Last Updated: 2012.03.04
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-BattleEngine"] = true
  12.  
  13. #==============================================================================
  14. # Y Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.03.04 - Bug fixed: Input crash bug.
  17. # 2012.02.13 - Bug fixed: Odd Victory game crash fixed.
  18. # 2012.02.12 - Bug fixed: Displayed damage in combat log is correct now.
  19. # 2012.01.29 - Visual Changes: Buff stacks now show one popup upon one skill.
  20. # 2012.01.24 - Compatibility Update: Enemy Levels
  21. # 2012.01.18 - Bug Fixed: Help Window clears text upon selecting nil items.
  22. # 2012.01.11 - Added <one animation> tag for multi-hit skills to play an
  23. # animation only once.
  24. # - Reduced lag from battle system constantly recreating bitmaps.
  25. # 2012.01.10 - Compatibility Update: Battle System FTB
  26. # 2012.01.09 - Anticrash methods implemented.
  27. # - Damage Popups are now separate for damage formulas and recovery.
  28. # 2012.01.05 - Bug fixed: Game no longer crashes with escape skills/items.
  29. # 2012.01.02 - Compatibility Update: Target Manager
  30. # - Added Option: AUTO_FAST
  31. # - Random hits now show animations individually.
  32. # 2011.12.30 - Compatibility Update: Enemy Levels
  33. # - Added Option to center the actors in the HUD.
  34. # 2011.12.27 - Bug fixed: TP Damage skills and items no longer crash game.
  35. # - Default battle system bug fixes are now included from YEA's Ace
  36. # Core Engine.
  37. # - Groundwork is also made to support future battle system types.
  38. # - Multi-hit actions no longer linger when a target dies during the
  39. # middle of one of the hits.
  40. # - Compatibility Update: Lunatic Objects v1.02
  41. # 2011.12.26 - Bug fixed: Multi-hit popups occured even after an enemy's dead.
  42. # 2011.12.22 - Bug fixed: Elemental Resistance popup didn't show.
  43. # 2011.12.20 - Bug fixed: Death state popups against immortal states.
  44. # - Bug fixed: During State popup fix.
  45. # - Added HIDE_POPUP_SWITCH.
  46. # 2011.12.17 - Compatibiilty Update: Cast Animations
  47. # 2011.12.15 - Compatibility Update: Battle Command List
  48. # 2011.12.14 - Compatibility Update: Lunatic Objects
  49. # 2011.12.13 - Compatibility Update: Command Party
  50. # 2011.12.12 - Bug fixed: Turn stalling if no inputable members.
  51. # 2011.12.10 - Compatibility update for Automatic Party HUD.
  52. # - Popup graphical bug fixed.
  53. # - Bug fixed: Didn't wait for boss dead animations.
  54. # - Bug fixed: Surprise attacks that froze the game.
  55. # - Bug fixed: Popups didn't show for straight recovery effects.
  56. # 2011.12.08 - Finished Script.
  57. # 2011.12.04 - Started Script.
  58. #
  59. #==============================================================================
  60. # Y Introduction
  61. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  62. # Ace Battle Engine works as a foundation for future battle engine add-ons. It
  63. # allows for easier management of the battle engine without adding too many
  64. # features, allowing users to customize what they want as they see fit. While
  65. # the Ace Battle Engine isn't an entirely new engine, it gives users control
  66. # that RPG Maker VX Ace didn't originally give them.
  67. #
  68. # Furthermore, this script provides some new features. They are as follows:
  69. #
  70. # -----------------------------------------------------------------------------
  71. # Animation Fixes
  72. # -----------------------------------------------------------------------------
  73. # Though the Yanfly Engine Ace - Ace Core Engine script contains these fixes,
  74. # these fixes are included in this script as well to ensure it's working for
  75. # the battle script in the event someone chooses not to work with the Ace Core
  76. # Engine script. The animation fixes prevent excessive animation overlaying
  77. # (and making the screen look really ugly) and prevents animation clashing
  78. # between two dual wielding normal attack animations.
  79. #
  80. # -----------------------------------------------------------------------------
  81. # Enemy Animations
  82. # -----------------------------------------------------------------------------
  83. # Enemies now show battle animations when they deliver attacks and skills
  84. # against the player's party. Before in RPG Maker VX Ace, it was nothing more
  85. # than just sound effects and the screen shaking. Now, animations play where
  86. # the status window is and relative to the position of each party member.
  87. #
  88. # -----------------------------------------------------------------------------
  89. # Left/Right Command Selection
  90. # -----------------------------------------------------------------------------
  91. # While choosing actions, the player can press Left or Right to move freely
  92. # between (alive) actors to change their skills. Players no longer have to
  93. # cancel all the way back to change one person's skill and reselect everything.
  94. # On that note, there is now the option that when a battle starts or at the
  95. # end of a turn, players will start immediately at command selection rather
  96. # than needing to select "Fight" in the Party Command Window.
  97. #
  98. # -----------------------------------------------------------------------------
  99. # Popups
  100. # -----------------------------------------------------------------------------
  101. # Dealing damage, inflicting states, adding buffs, landing critical hits,
  102. # striking weaknesses, missing attacks, you name it, there's probably a popup
  103. # for it. Popups deliver information to the player in a quick or orderly
  104. # fashion without requiring the player to read lines of text.
  105. #
  106. # -----------------------------------------------------------------------------
  107. # Targeting Window
  108. # -----------------------------------------------------------------------------
  109. # When targeting enemies, the window is no longer displayed. Instead, the
  110. # targeted enemies are highlighted and their names are shown at the top of the
  111. # screen in a help window. Another thing that's changed is when skills that
  112. # target multiple targets are selected, there is a confirmation step that the
  113. # player must take before continuing. In this confirmation step, all of the
  114. # multiple targets are selected and in the help window would display the scope
  115. # of the skill (such as "All Foes" or "Random Foes"). RPG Maker VX Ace skipped
  116. # this step by default.
  117. #
  118. # -----------------------------------------------------------------------------
  119. # Toggling On and Off Special Effects and Text
  120. # -----------------------------------------------------------------------------
  121. # Not everybody likes having the screen shake or the enemies blink when they
  122. # take damage. These effects can now be toggled on and off. Certain text can
  123. # also be toggled on and off from appearing. A lot of the displayed text has
  124. # been rendered redundant through the use of popups.
  125. #
  126. # -----------------------------------------------------------------------------
  127. # Visual Battle Status Window
  128. # -----------------------------------------------------------------------------
  129. # Rather than just having rows of names with HP and MP bars next to them, the
  130. # Battle Status Window now displays actors' faces and their gauges aligned at
  131. # the bottom. More status effects can be shown in addition to showing more
  132. # members on screen at once. The Battle Status Window is also optimized to
  133. # refresh less (thus, removing potential lag from the system).
  134. #
  135. # -----------------------------------------------------------------------------
  136. # Window Position Changes
  137. # -----------------------------------------------------------------------------
  138. # Windows such as the Skill Window and Item Window have been rearranged to
  139. # always provide the player a clear view of the battlefield rather than opening
  140. # up and covering everything. As such, the window positions are placed at the
  141. # bottom of the screen and are repositioned.
  142. #
  143. #==============================================================================
  144. # Y Instructions
  145. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  146. # To install this script, open up your script editor and copy/paste this script
  147. # to an open slot below Y Materials/‘f?? but above Y Main. Remember to save.
  148. #
  149. # -----------------------------------------------------------------------------
  150. # Skill Notetags - These notetags go in the skills notebox in the database.
  151. # -----------------------------------------------------------------------------
  152. # <one animation>
  153. # Causes the action to display the action animation only once, even if it's a
  154. # multi-hit action. This is used primarily for non-all scope targeting.
  155. #
  156. # -----------------------------------------------------------------------------
  157. # Item Notetags - These notetags go in the items notebox in the database.
  158. # -----------------------------------------------------------------------------
  159. # <one animation>
  160. # Causes the action to display the action animation only once, even if it's a
  161. # multi-hit action. This is used primarily for non-all scope targeting.
  162. #
  163. # -----------------------------------------------------------------------------
  164. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  165. # -----------------------------------------------------------------------------
  166. # <atk ani 1: x>
  167. # <atk ani 2: x>
  168. # Changes the normal attack animation of the particular enemy to animation x.
  169. # Attack animation 1 is the first one that plays. If there's a second animation
  170. # then the second one will play after in mirrored form.
  171. #
  172. # -----------------------------------------------------------------------------
  173. # State Notetags - These notetags go in the state notebox in the database.
  174. # -----------------------------------------------------------------------------
  175. # <popup add: string>
  176. # <popup rem: string>
  177. # <popup dur: string>
  178. # Status effects now create popups whenever they're inflicted. However, if you
  179. # don't like that a certain status effect uses a particular colour setting,
  180. # change "string" to one of the rulesets below to cause that popup to use a
  181. # different ruleset.
  182. #
  183. # <popup hide add>
  184. # <popup hide rem>
  185. # <popup hide dur>
  186. # Not everybody wants status effects to show popups when inflicted. When this
  187. # is the case, insert the respective tag to hide popups from appearing when the
  188. # state is added, removed, or during the stand-by phases.
  189. #
  190. # -----------------------------------------------------------------------------
  191. # Debug Tools - These tools only work during Test Play.
  192. # -----------------------------------------------------------------------------
  193. # - F5 Key -
  194. # Recovers all actors. Restores their HP and MP to max. Does not affect TP.
  195. # All states and buffs are removed whether they are positive or negative.
  196. #
  197. # - F6 Key -
  198. # Sets all actors to have 1 HP, 0 MP, and 0 TP. States are unaffected.
  199. #
  200. # - F7 Key -
  201. # Sets all actors to have max TP. Everything else is unaffected.
  202. #
  203. # - F8 Key -
  204. # Kills all enemies in battle. Ends the battle quickly.
  205. #
  206. #==============================================================================
  207. # Y Compatibility
  208. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  209. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  210. # it will run with RPG Maker VX without adjusting.
  211. #
  212. #==============================================================================
  213.  
  214. module YEA
  215. module BATTLE
  216.  
  217. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  218. # - General Battle Settings -
  219. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  220. # These settings are adjusted for the overall battle system. These are
  221. # various miscellaneous options to adjust. Each of the settings below will
  222. # explain what they do. Change default enemy battle animations here, too.
  223. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  224. BLINK_EFFECTS = false # Blink sprite when damaged?
  225. FLASH_WHITE_EFFECT = true # Flash enemy white when it starts an attack.
  226. SCREEN_SHAKE = false # Shake screen in battle?
  227. SKIP_PARTY_COMMAND = true # Skips the Fight/Escape menu.
  228. AUTO_FAST = true # Causes message windows to not wait.
  229. ENEMY_ATK_ANI = 36 # Sets default attack animation for enemies.
  230.  
  231. # If this switch is ON, popups will be hidden. If OFF, the popups will be
  232. # shown. If you do not wish to use this switch, set it to 0.
  233. HIDE_POPUP_SWITCH = 0
  234.  
  235. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  236. # - Battle Status Window -
  237. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  238. # This sets the default battle system your game will use. If your game
  239. # doesn't have any other battle systems installed, it will use :dtb.
  240. #
  241. # Battle System Requirement
  242. # :dtb - Default Turn Battle. Default system.
  243. # :ftb - YEA Battle System Add-On: Free Turn Battle
  244. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  245. DEFAULT_BATTLE_SYSTEM = :dtb # Default battle system set.
  246.  
  247. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  248. # - Battle Status Window -
  249. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  250. # Here, you can adjust the settings for the battle status window. The
  251. # battle status window, by default, will show the actor's face, HP, MP, TP
  252. # (if viable), and any inflicted status effects.
  253. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  254. BATTLESTATUS_NAME_FONT_SIZE = 20 # Font size used for name.
  255. BATTLESTATUS_TEXT_FONT_SIZE = 16 # Font size used for HP, MP, TP.
  256. BATTLESTATUS_NO_ACTION_ICON = 185 # No action icon.
  257. BATTLESTATUS_HPGAUGE_Y_PLUS = 11 # Y Location buffer used for HP gauge.
  258. BATTLESTATUS_CENTER_FACES = false # Center faces for the Battle Status.
  259.  
  260. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  261. # - Help Window Text -
  262. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  263. # When selecting a target to attack, this is the text that will be shown
  264. # in place of a target's name for special cases. These special cases are
  265. # for selections that were originally non-targetable battle scopes.
  266. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  267. HELP_TEXT_ALL_FOES = "All Foes"
  268. HELP_TEXT_ONE_RANDOM_FOE = "One Random Foe"
  269. HELP_TEXT_MANY_RANDOM_FOE = "%d Random Foes"
  270. HELP_TEXT_ALL_ALLIES = "All Allies"
  271. HELP_TEXT_ALL_DEAD_ALLIES = "All Dead Allies"
  272. HELP_TEXT_ONE_RANDOM_ALLY = "One Random Ally"
  273. HELP_TEXT_RANDOM_ALLIES = "%d Random Allies"
  274.  
  275. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  276. # - Popup Settings -
  277. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  278. # These settings will adjust the popups that appear in battle. Popups
  279. # deliver information to your player as battlers deal damage, inflict
  280. # status effects, and more.
  281. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  282. ENABLE_POPUPS = true # Set this to false if you wish to disable them.
  283. FLASH_CRITICAL = true # Sets critical hits to flash.
  284.  
  285. # This hash adjusts the popup settings that will govern how popups appear.
  286. # Adjust them accordingly.
  287. POPUP_SETTINGS ={
  288. :offset => -24, # Height offset of a popup.
  289. :fade => 12, # Fade rate for each popup.
  290. :full => 60, # Frames before a popup fades.
  291. :hp_dmg => "-%s ", # SprintF for HP damage.
  292. :hp_heal => "+%s ", # SprintF for HP healing.
  293. :mp_dmg => "-%s MP", # SprintF for MP damage.
  294. :mp_heal => "+%s MP", # SprintF for MP healing.
  295. :tp_dmg => "-%s TP", # SprintF for MP damage.
  296. :tp_heal => "+%s TP", # SprintF for MP healing.
  297. :drained => "DRAIN", # Text display for draining HP/MP.
  298. :critical => "CRITICAL!", # Text display for critical hit.
  299. :missed => "MISS", # Text display for missed attack.
  300. :evaded => "EVADE!", # Text display for evaded attack.
  301. :nulled => "NULL", # Text display for nulled attack.
  302. :failed => "FAILED", # Text display for a failed attack.
  303. :add_state => "+%s", # SprintF for added states.
  304. :rem_state => "-%s", # SprintF for removed states.
  305. :dur_state => "%s", # SprintF for during states.
  306. :ele_rates => true, # This will display elemental affinities.
  307. :ele_wait => 20, # This is how many frames will wait.
  308. :weakpoint => "WEAKPOINT", # Appears if foe is weak to element.
  309. :resistant => "RESIST", # Appears if foe is resistant to element.
  310. :immune => "IMMUNE", # Appears if foe is immune to element.
  311. :absorbed => "ABSORB", # Appears if foe can absorb the element.
  312. :add_buff => "%s{", # Appears when a positive buff is applied.
  313. :add_debuff => "%s|", # Appears when a negative buff is applied.
  314. } # Do not remove this.
  315.  
  316. # This is the default font used for the popups. Adjust them accordingly
  317. # or even add new ones.
  318. DEFAULT = ["VL Gothic", "Verdana", "Arial", "Courier"]
  319.  
  320. # The following are the various rules that govern the individual popup
  321. # types that will appear. Adjust them accordingly. Here is a list of what
  322. # each category does.
  323. # Zoom1 The zoom the popup starts at. Values over 2.0 may cause lag.
  324. # Zoom2 The zoom the popup goes to. Values over 2.0 may cause lag.
  325. # Sz The font size used for the popup text.
  326. # Bold Applying bold for the popup text.
  327. # Italic Applying italic for the popup text.
  328. # Red The red value of the popup text.
  329. # Grn The green value of the popup text.
  330. # Blu The blue value of the popup text.
  331. # Font The font used for the popup text.
  332. POPUP_RULES ={
  333. # Type => [ Zoom1, Zoom2, Sz, Bold, Italic, Red, Grn, Blu, Font]
  334. "DEFAULT" => [ 2.0, 1.0, 24, true, false, 255, 255, 255, DEFAULT],
  335. "CRITICAL" => [ 2.0, 1.0, 24, true, false, 255, 80, 80, DEFAULT],
  336. "HP_DMG" => [ 2.0, 1.0, 36, true, false, 255, 255, 255, DEFAULT],
  337. "HP_HEAL" => [ 2.0, 1.0, 36, true, false, 130, 250, 130, DEFAULT],
  338. "MP_DMG" => [ 2.0, 1.0, 36, true, false, 220, 180, 255, DEFAULT],
  339. "MP_HEAL" => [ 2.0, 1.0, 36, true, false, 160, 230, 255, DEFAULT],
  340. "TP_DMG" => [ 2.0, 1.0, 36, true, false, 242, 108, 78, DEFAULT],
  341. "TP_HEAL" => [ 2.0, 1.0, 36, true, false, 251, 175, 92, DEFAULT],
  342. "ADDSTATE" => [ 2.0, 1.0, 24, true, false, 240, 100, 100, DEFAULT],
  343. "REMSTATE" => [ 2.0, 1.0, 24, true, false, 125, 170, 225, DEFAULT],
  344. "DURSTATE" => [ 2.0, 1.0, 24, true, false, 255, 240, 150, DEFAULT],
  345. "DRAIN" => [ 2.0, 1.0, 36, true, false, 250, 190, 255, DEFAULT],
  346. "POSITIVE" => [ 2.0, 1.0, 24, true, false, 110, 210, 245, DEFAULT],
  347. "NEGATIVE" => [ 2.0, 1.0, 24, true, false, 245, 155, 195, DEFAULT],
  348. "WEAK_ELE" => [ 0.5, 1.0, 24, true, false, 240, 110, 80, DEFAULT],
  349. "IMMU_ELE" => [ 0.5, 1.0, 24, true, false, 185, 235, 255, DEFAULT],
  350. "REST_ELE" => [ 0.5, 1.0, 24, true, false, 145, 230, 180, DEFAULT],
  351. "ABSB_ELE" => [ 0.5, 1.0, 24, true, false, 250, 190, 255, DEFAULT],
  352. "BUFF" => [ 2.0, 1.0, 24, true, false, 255, 240, 100, DEFAULT],
  353. "DEBUFF" => [ 2.0, 1.0, 24, true, false, 160, 130, 200, DEFAULT],
  354. } # Do not remove this.
  355.  
  356. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  357. # - Streamlined Messages -
  358. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  359. # Want to remove some of those annoying messages that appear all the time?
  360. # Now you can! Select which messages you want to enable or disable. Some of
  361. # these messages will be rendered useless due to popups.
  362. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  363. MSG_ENEMY_APPEARS = false # Message when enemy appears start of battle.
  364. MSG_CURRENT_STATE = false # Show which states has affected battler.
  365. MSG_CURRENT_ACTION = true # Show the current action of the battler.
  366. MSG_COUNTERATTACK = true # Show the message for a counterattack.
  367. MSG_REFLECT_MAGIC = true # Show message for reflecting magic attacks.
  368. MSG_SUBSTITUTE_HIT = true # Show message for ally taking another's hit.
  369. MSG_FAILURE_HIT = false # Show effect failed against target.
  370. MSG_CRITICAL_HIT = false # Show attack was a critical hit.
  371. MSG_HIT_MISSED = false # Show attack missed the target.
  372. MSG_EVASION = false # Show attack was evaded by the target.
  373. MSG_HP_DAMAGE = false # Show HP damage to target.
  374. MSG_MP_DAMAGE = false # Show MP damage to target.
  375. MSG_TP_DAMAGE = false # Show TP damage to target.
  376. MSG_ADDED_STATES = false # Show target's added states.
  377. MSG_REMOVED_STATES = false # Show target's removed states.
  378. MSG_CHANGED_BUFFS = false # Show target's changed buffs.
  379.  
  380. end # BATTLE
  381. end # YEA
  382.  
  383.  
  384.  
  385.  
  386. #======================#
  387. # Z-Systems by: Zetu #
  388. #===========================#======================#===========================#
  389. # * * * Z02 AMPX Ace Version v1.05 * * * #
  390. #=#==========================================================================#=#
  391. # You may need slight scripting knowledge of working with arrays (but #
  392. # not a whole lot!). #
  393. #--------------------------------------------------------------------------#
  394. # * * Anything in "< >" means replace with the described contents. * * #
  395. # REQUIRED PARAMETERS (Any resource without it will cause an error) #
  396. # :name, <name of resource> #
  397. # :abbv, <1 or 2 character abbv. of resource> #
  398. # :color, <color 1>, <color 2> #
  399. # * These color attributes are indexes of the window skin #
  400. # OPTIONAL PARAMETERS #
  401. # Resource Regen for each turn: #
  402. # :regen, <type>, <base> #
  403. # type can be :mmp, :atk, :def, :mat, :agi, :set #
  404. # base is number multiplied by type (:set is considered 1) #
  405. # Resource Regen on Damage #
  406. # :regendmg, <type>, <base> #
  407. # type can be :damage, :mmp, :set, :percentdmg #
  408. # base in number multipled by type (:set is considered 1) #
  409. # (:percentdmg is ratio of mmp and damage) #
  410. # :regenelemental, <element_id>, <type>, <base> #
  411. # same as :regendmg, except on elemental damage (of #
  412. # element_ids) (may place more than 1 id) #
  413. # Resource Regen on Inflicting Damage #
  414. # :regenoffdmg, <type>, <base> #
  415. # type can be :damage, :mmp, :set, :percentdmg #
  416. # base in number multipled by type (:set is considered 1) #
  417. # (:percentdmg is ratio of mmp and damage) #
  418. # Resource Change Out of Battle: #
  419. # :depleteoob (Set to 0) #
  420. # :regenoob (Set to Max) #
  421. # Max Value #
  422. # :max, <value> #
  423. # Resource Inversion #
  424. # :invert #=// NOT INCLUDED IN THIS VERSION #
  425. # this allows the resource to Add instead of Subtract for its cost #
  426. # and disallows skill use if cost will exceed the max resource. #
  427. #--------------------------------------------------------------------------#
  428. # NOTE :: Case Sensitivity Applies to Resource Names in these tags #
  429. # * I apologize and will fix this next patch * #
  430. # REGEXP! #
  431. # <Class/Actor Note> #
  432. # <AMPX: X> #=> X = Name of Resource #
  433. # Adds the Resource to Actor. If no resources exisit, will give #
  434. # actor DEF_RES as only resource. #
  435. # <Skill Note> #
  436. # <AMPX DAMAGE: X> #=> X = Name of Resource #
  437. # When skill does MP damage, it will damage all resources with this #
  438. # tag. Will damage DEF_RES if tag does not exist. Also allowed in #
  439. # Items. (This tag also is used for healing) #
  440. # <AMPX COST: X *Y> #=> X = Name of Resource; *Y = Amount (Optional) #
  441. # Add cost to skill. If not used, will cost default amount to first #
  442. # resource defined. If *Y is not defined, will default in the #
  443. # default skill cost. #
  444. # <State Note> #
  445. # <AMPX REGEN: X> #=> X = Name of Resource #
  446. # Effect: MP Regeneration Rate will affect defined resource. If not #
  447. # defined, will result in DEF_RES #
  448. # <AMPX COST: X> #=> X = Name of Resource #
  449. # Effect: MP Cost Rate will affect defined resource. If not #
  450. # defined, will result in DEF_RES #
  451. #--------------------------------------------------------------------------#
  452. # Getting Values of Resources (ADVANCED) #
  453. # <Battler>.resource(NAME) #=> <Game_Resource> #
  454. # <Battler>.resources #=> <Game_Resource[]> Array #
  455. #
  456. #==========================================================================#
  457. module Z02
  458.  
  459. RESOURCES = [[
  460. :regen, :mmp, 2.5,
  461. :name, "Mana",
  462. :abbv, "M",
  463. :color, 23, 22
  464. ],[
  465. :deplete,
  466. :regendmg, :percent, 120,
  467. :regen, :set, -5,
  468. :max, 100,
  469. :name, "Rage",
  470. :abbv, "R",
  471. :color, 10, 2
  472. ],[
  473. :replenish,
  474. :regen, :set, 20,
  475. :max, 100,
  476. :name, "Energy",
  477. :abbv, "E",
  478. :color, 6, 14
  479. ],[
  480. :replenish,
  481. :regen, :set, 30,
  482. :regendmg, :percent, -150,
  483. :max, 100,
  484. :name, "Focus",
  485. :abbv, "F",
  486. :color, 3, 11
  487. ],[
  488. :invert,
  489. :deplete,
  490. :regenelemental, 3, :percent, 80,
  491. :regenelemental, 4, :percent, -120,
  492. :regenelemental, 6, :percent, -120,
  493. :regen, :set, -30,
  494. :max, 150,
  495. :name, "Heat",
  496. :abbv, "H",
  497. :color, 2, 10
  498. ]
  499. ]
  500.  
  501. DEF_RES = "Mana"
  502.  
  503. #========#======================#====#================================#========#
  504. #--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------#
  505. #--------# End of Customization #----# Editing will cause death by #--------#
  506. #--------# #----# brain asplosions. #--------#
  507. #========#======================#====#================================#========#
  508. module REGEXP
  509. USED_RESOURCES = /<AMPX[:]*\s*(\w+)>/i
  510. SCOST_WOVALUE = /<AMPX\s*COST[:]*\s*(\w+)>/i
  511. SCOST_WVALUE = /<AMPX\s*COST[:]*\s*(\w+)\s*(\d+)>/i
  512. DAMAGE_TARGET = /<AMPX\s*DAMAGE[:]*\s*(\w+)>/i
  513.  
  514. EFFECT_REGEN = /<AMPX\s*REGEN[:]*\s*(\w+)>/i
  515. EFFECT_COSTRATE = /<AMPX\s*COST[:]*\s*(\w+)>/i
  516. end
  517. end
  518.  
  519. ($imported||={})[:z02]=true
  520.  
  521. class Data_Resource
  522. attr_reader :params, :regenelemental
  523.  
  524. def initialize(index)
  525. array=Z02::RESOURCES[index]
  526. @params = {}
  527. @params[:regenelemental] = {}
  528. i=0
  529. while (i < array.size)
  530. case (symbol = array[i])
  531. when :regenelemental
  532. @params[symbol][array[i+=1]] = [array[i+=1], array[i+=1]]
  533. when :invert, :deplete, :replenish
  534. @params[symbol] = true
  535. when :abbv, :name, :max
  536. @params[symbol] = [array[i+=1]]
  537. when :regendmg, :regen, :color, :regenoffdmg
  538. @params[symbol] = [array[i+=1], array[i+=1]]
  539. else
  540. puts "Unusable symbol! ##{symbol}"
  541. end
  542. i+=1
  543. end
  544. $def_res_i = index if params[:name][0].upcase == Z02::DEF_RES
  545. end
  546.  
  547. end
  548.  
  549. $data_resources = (0...Z02::RESOURCES.size).map{|i| Data_Resource.new(i)}
  550. $def_res_i = 0
  551.  
  552. class Game_Resources
  553. attr_reader :battler
  554.  
  555. class Resource #==============================================================
  556. attr_reader :value, :index, :name
  557.  
  558. def initialize(name, list)
  559. $data_resources.each_with_index do |data_resource,i|
  560. if data_resource.params[:name][0].upcase == name.upcase
  561. @name = data_resource.params[:name][0]
  562. @index = i
  563. break
  564. end
  565. end
  566. @list = list
  567. @value = max
  568. replenish
  569. end
  570.  
  571. def battler
  572. @list.battler
  573. end
  574.  
  575. def value=(new_value)
  576. @value = [[new_value, 0].max, max].min
  577. end
  578.  
  579. def max
  580. begin
  581. return params[:max][0]
  582. rescue
  583. return battler.mmp
  584. end
  585. end
  586.  
  587. def replenish
  588. if params[:replenish]
  589. self.value = max
  590. elsif params[:deplete]
  591. self.value = 0
  592. end
  593. end
  594.  
  595. def params
  596. return $data_resources[@index].params
  597. end
  598.  
  599. def rate
  600. value.to_f / max
  601. end
  602.  
  603. def include?(symbol)
  604. !params[symbol].nil?
  605. end
  606.  
  607. end #==//==END class Resource=================================================
  608.  
  609. def initialize(battler)
  610. @battler = battler
  611. @resources = []
  612. all_notes.scan(Z02::REGEXP::USED_RESOURCES) do |name|
  613. @resources << Resource.new(name[0], self)
  614. end
  615. @resources << Resource.new(Z02::DEF_RES, self) if @resources.empty?
  616. end
  617.  
  618. def [](value)
  619. return @resources[value] if value.is_a? Integer
  620. return resource_of(value) if value.is_a? String
  621. end
  622.  
  623. def size
  624. @resources.size
  625. end
  626.  
  627. def resource_of(value)
  628. if value.is_a? String
  629. @resources.each.each do |resource|
  630. return resource if resource.name.upcase == value.upcase
  631. end
  632. elsif value.is_a? Integer
  633. @resources.each.each do |resource|
  634. return resource if resource.index == value
  635. end
  636. end
  637. return nil
  638. end
  639.  
  640. def all_notes
  641. if @battler.actor?
  642. return @battler.class.note + "\n" + @battler.actor.note
  643. else
  644. return @battler.enemy.note
  645. end
  646. end
  647.  
  648. def first_index
  649. @resources[0].index
  650. end
  651.  
  652. def each
  653. @resources
  654. end
  655.  
  656. end
  657.  
  658. class Window_Base < Window
  659. #--------------------------------------------------------------------------
  660. # * New method: draw_actor_ampx
  661. #--------------------------------------------------------------------------
  662. def draw_actor_ampx(resource, x, y, width)
  663. color1, color2 = resource.params[:color]
  664. draw_gauge(x, y, width, resource.rate,
  665. text_color(color1), text_color(color2))
  666. change_color(text_color(color2))
  667. draw_text(x, y, 30, line_height, resource.params[:abbv][0])
  668. draw_current_and_max_values(x, y, width, resource.value, resource.max,
  669. mp_color(resource.battler), normal_color)
  670. end
  671. #--------------------------------------------------------------------------
  672. # * Overwrite method: draw_actor_mp
  673. #--------------------------------------------------------------------------
  674. def draw_actor_tp(actor, x, y, width=124)
  675. if actor.resources.nil?
  676. actor.setup(actor.id)
  677. end
  678. width /= actor.resources.size
  679. offset = width
  680. if actor.resources.size != 1
  681. offset += 1
  682. width -= 1
  683. end
  684. for i in 0...actor.resources.size
  685. draw_actor_ampx(actor.resources[i], x+offset*i, y, width)
  686. end
  687. end
  688.  
  689. end
  690.  
  691. class Window_SkillList < Window_Selectable
  692. #--------------------------------------------------------------------------
  693. # * Alias method: draw_skill_cost
  694. #--------------------------------------------------------------------------
  695. alias :z02dsc :draw_skill_cost
  696. def draw_skill_cost(rect, skill)
  697. if @actor.skill_tp_cost(skill) > 0
  698. z02dsc(rect, skill)
  699. elsif @actor.skill_mp_cost(skill) > 0
  700. skill.skill_cost(@actor).each do |index, value|
  701. next if (resource = @actor.resources.resource_of(index)).nil?
  702. next if value <= 0
  703. change_color(text_color(resource.params[:color][0]),
  704. @actor.skill_cost_payable?(skill))
  705. draw_text(rect, value, 2)
  706. rect.width -= 32
  707. end
  708. end
  709. end
  710.  
  711. end
  712.  
  713. class Game_BattlerBase
  714.  
  715. def skill_cost_payable?(skill)
  716. tp >= skill_tp_cost(skill) && ampx_skill_cost_payable?(skill)
  717. end
  718.  
  719. def pay_skill_cost(skill)
  720. ampx_pay_skill_cost(skill)
  721. self.tp -= skill_tp_cost(skill)
  722. end
  723.  
  724. def ampx_skill_cost_payable?(skill)
  725. skill.skill_cost(self).each do |index, value|
  726. return false if (resource = @resources.resource_of(index)).nil?
  727. return false if resource.value < value
  728. end
  729. return true
  730. end
  731.  
  732. def ampx_pay_skill_cost(skill)
  733. skill.skill_cost(self).each do |index, value|
  734. next if (resource = @resources.resource_of(index)).nil?
  735. resource.value -= value
  736. end
  737. end
  738.  
  739. def resource_obj(item)
  740. item.note.scan(Z02::REGEXP::DAMAGE_TARGET) do |name|
  741. unless (resource = @resources.resource_of(name[0])).nil?
  742. return resource
  743. end
  744. return nil
  745. end
  746. @resources[0]
  747. end
  748.  
  749. def ampx_regenrate(xparam_id) #=//=
  750. rates = []
  751. rates.default = 0
  752. states.each do |state|
  753. state.features do |feature|
  754. next unless feature.code == FEATURE_XPARAM
  755. next unless feature.data_id == 8
  756. resource = resource_of(state.regen_resource)
  757. next if resource.nil?
  758.  
  759. end
  760. end
  761. end
  762.  
  763. end
  764.  
  765. class Game_Battler < Game_BattlerBase
  766.  
  767. alias :z02ote :on_turn_end
  768. def on_turn_end #=//=
  769. z02ote
  770. apply_regen
  771. end
  772.  
  773. alias :z02ia :item_apply
  774. def item_apply(user, item) #=//=
  775. z02ia(user, item)
  776. if @result.hit?
  777. unless item.damage.none?
  778. ampx_ondamage(user, item.damage.element_id)
  779. resource = resource_obj(item)
  780. unless resource.nil?
  781. resource.value -= @result.mp_damage
  782. ####user.mp += @result.mp_drain#### NEED TO ADD DRAIN
  783. end
  784. end
  785. end
  786. end
  787.  
  788. def ampx_ondamage(user, element_id)
  789. return if @result.hp_damage==0
  790. apply_damage_regen(@result.hp_damage, element_id)
  791. user.apply_offdamage_regen(@result.hp_damage)
  792. end
  793.  
  794. def apply_regen
  795. return if dead?
  796. @resources.each.each do |resource|
  797. next unless resource.include? :regen
  798. type, base = resource.params[:regen]
  799. base = base.to_f/100
  800. case type
  801. when :mmp; base *= resource.max
  802. when :atk; base *= self.atk
  803. when :def; base *= self.def
  804. when :spi; base *= self.spi
  805. when :agi; base *= self.agi
  806. end
  807. resource.value += base.to_i
  808. end
  809. end
  810.  
  811. def apply_damage_regen(damage, element_id=0)
  812. return if dead?
  813. @resources.each.each do |resource|
  814. next unless resource.include? :regendmg
  815. type, base = resource.params[:regendmg]
  816. puts damage
  817. puts base
  818. case type
  819. when :mmp; base *= max
  820. when :damage; base *= damage
  821. when :percent; base *= damage.to_f/mhp
  822. end
  823. resource.value += base.to_i
  824. next if (array=resource.params[:regenelemental][element_id]).nil?
  825. type, base = array
  826. case type
  827. when :mmp; base *= max
  828. when :damage; base *= damage
  829. when :percent; base *= damage.to_f/mhp
  830. end
  831. resource.value += base.to_i
  832. end
  833. end
  834.  
  835. def apply_offdamage_regen(damage)
  836. return if dead?
  837. @resources.each.each do |resource|
  838. next unless resource.include? :regenoffdmg
  839. type, base = resource.params[:regenoffdmg]
  840. case type
  841. when :mmp; base *= max
  842. when :damage; base *= damage
  843. when :percent; base *= damage.to_f/mhp
  844. end
  845. resource.value += base
  846. end
  847. end
  848.  
  849. end
  850.  
  851. class Game_Actor < Game_Battler
  852. attr_reader :resources
  853.  
  854. alias :z02s :setup
  855. def setup(actor_id)
  856. z02s actor_id
  857. @resources = Game_Resources.new(self)
  858. end
  859.  
  860. end
  861.  
  862. class Game_Enemy
  863. attr_reader :resources
  864.  
  865. alias :z02i :initialize
  866. def initialize(index, enemy_id)
  867. z02i index, enemy_id
  868. @resources = Game_Resources.new(self)
  869. end
  870.  
  871. end
  872.  
  873. class RPG::Skill < RPG::UsableItem
  874.  
  875. def skill_cost(actor = nil)
  876. r = {}
  877. self.note.scan(Z02::REGEXP::SCOST_WOVALUE) do |name|
  878. $data_resources.each_with_index do |data_resource,i|
  879. next unless data_resource.params[:name][0].upcase == name[0].upcase
  880. r[i] = mp_cost
  881. break
  882. end
  883. end
  884. self.note.scan(Z02::REGEXP::SCOST_WVALUE) do |name, value|
  885. $data_resources.each_with_index do |data_resource,i|
  886. next unless data_resource.params[:name][0].upcase == name.upcase
  887. r[i] = value.to_i
  888. break
  889. end
  890. end
  891. if actor.nil?
  892. r[$def_res_i] = mp_cost if r.empty?
  893. else
  894. r[actor.resources.first_index] = mp_cost if r.empty?
  895. end
  896. return r
  897. end
  898.  
  899. end
  900. #####
  901.  
  902.  
  903. module SceneManager
  904. #--------------------------------------------------------------------------
  905. # * Alias method: call
  906. #--------------------------------------------------------------------------
  907. class <<self; alias_method :z02call, :call; end
  908. def self.call(scene_class)
  909. self.z02call(scene_class)
  910. for actor in $game_party.members
  911. next if actor.resources.nil?
  912. actor.resources.each do |resource|
  913. resource.replenish
  914. end
  915. end
  916. end
  917.  
  918. end# regexp
  919.  
  920.  
  921.  
  922. #==============================================================================
  923. # Y Editting anything past this point may potentially result in causing
  924. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  925. # halitosis so edit at your own risk.
  926. #==============================================================================
  927.  
  928. module YEA
  929. module REGEXP
  930. module ENEMY
  931.  
  932. ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  933. ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  934.  
  935. end # ENEMY
  936. module USABLEITEM
  937.  
  938. ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
  939.  
  940. end # USABLEITEM
  941. module STATE
  942.  
  943. POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
  944. POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
  945. POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
  946.  
  947. HIDE_ADD = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
  948. HIDE_REM = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
  949. HIDE_DUR = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
  950.  
  951. end # STATE
  952. end # REGEXP
  953. end # YEA
  954.  
  955. #==============================================================================
  956. # ! Switch
  957. #==============================================================================
  958.  
  959. module Switch
  960.  
  961. #--------------------------------------------------------------------------
  962. # self.hide_popups
  963. #--------------------------------------------------------------------------
  964. def self.hide_popups
  965. return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
  966. return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
  967. end
  968.  
  969. end # Switch
  970.  
  971. #==============================================================================
  972. # ! Colour
  973. #==============================================================================
  974.  
  975. module Colour
  976.  
  977. #--------------------------------------------------------------------------
  978. # self.text_colour
  979. #--------------------------------------------------------------------------
  980. def self.text_colour(index)
  981. windowskin = Cache.system("Window")
  982. x = 64 + (index % 8) * 8
  983. y = 96 + (index / 8) * 8
  984. return windowskin.get_pixel(x, y)
  985. end
  986.  
  987. end # Colour
  988.  
  989. #==============================================================================
  990. # ! Icon
  991. #==============================================================================
  992.  
  993. module Icon
  994.  
  995. #--------------------------------------------------------------------------
  996. # self.no_action
  997. #--------------------------------------------------------------------------
  998. def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  999.  
  1000. end # Icon
  1001.  
  1002. #==============================================================================
  1003. # ! Numeric
  1004. #==============================================================================
  1005.  
  1006. class Numeric
  1007.  
  1008. #--------------------------------------------------------------------------
  1009. # new method: group_digits
  1010. #--------------------------------------------------------------------------
  1011. unless $imported["YEA-CoreEngine"]
  1012. def group; return self.to_s; end
  1013. end # $imported["YEA-CoreEngine"]
  1014.  
  1015. end # Numeric
  1016.  
  1017. #==============================================================================
  1018. # ! DataManager
  1019. #==============================================================================
  1020.  
  1021. module DataManager
  1022.  
  1023. #--------------------------------------------------------------------------
  1024. # alias method: load_database
  1025. #--------------------------------------------------------------------------
  1026. class <<self; alias load_database_abe load_database; end
  1027. def self.load_database
  1028. load_database_abe
  1029. load_notetags_abe
  1030. end
  1031.  
  1032. #--------------------------------------------------------------------------
  1033. # new method: load_notetags_abe
  1034. #--------------------------------------------------------------------------
  1035. def self.load_notetags_abe
  1036. groups = [$data_enemies, $data_states, $data_skills, $data_items]
  1037. for group in groups
  1038. for obj in group
  1039. next if obj.nil?
  1040. obj.load_notetags_abe
  1041. end
  1042. end
  1043. end
  1044.  
  1045. end # DataManager
  1046.  
  1047. #==============================================================================
  1048. # ! RPG::UsableItem
  1049. #==============================================================================
  1050.  
  1051. class RPG::UsableItem < RPG::BaseItem
  1052.  
  1053. #--------------------------------------------------------------------------
  1054. # public instance variables
  1055. #--------------------------------------------------------------------------
  1056. attr_accessor :one_animation
  1057.  
  1058. #--------------------------------------------------------------------------
  1059. # common cache: load_notetags_abe
  1060. #--------------------------------------------------------------------------
  1061. def load_notetags_abe
  1062. @one_animation = false
  1063. #---
  1064. self.note.split(/[\r\n]+/).each { |line|
  1065. case line
  1066. #---
  1067. when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
  1068. @one_animation = true
  1069. end
  1070. } # self.note.split
  1071. #---
  1072. end
  1073.  
  1074. end # RPG::UsableItem
  1075.  
  1076. #==============================================================================
  1077. # ! RPG::Enemy
  1078. #==============================================================================
  1079.  
  1080. class RPG::Enemy < RPG::BaseItem
  1081.  
  1082. #--------------------------------------------------------------------------
  1083. # public instance variables
  1084. #--------------------------------------------------------------------------
  1085. attr_accessor :atk_animation_id1
  1086. attr_accessor :atk_animation_id2
  1087.  
  1088. #--------------------------------------------------------------------------
  1089. # common cache: load_notetags_abe
  1090. #--------------------------------------------------------------------------
  1091. def load_notetags_abe
  1092. @atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
  1093. @atk_animation_id2 = 0
  1094. #---
  1095. self.note.split(/[\r\n]+/).each { |line|
  1096. case line
  1097. #---
  1098. when YEA::REGEXP::ENEMY::ATK_ANI1
  1099. @atk_animation_id1 = $1.to_i
  1100. when YEA::REGEXP::ENEMY::ATK_ANI2
  1101. @atk_animation_id2 = $1.to_i
  1102. end
  1103. } # self.note.split
  1104. #---
  1105. end
  1106.  
  1107. end # RPG::Enemy
  1108.  
  1109. #==============================================================================
  1110. # ! RPG::Enemy
  1111. #==============================================================================
  1112.  
  1113. class RPG::State < RPG::BaseItem
  1114.  
  1115. #--------------------------------------------------------------------------
  1116. # public instance variables
  1117. #--------------------------------------------------------------------------
  1118. attr_accessor :popup_rules
  1119.  
  1120. #--------------------------------------------------------------------------
  1121. # common cache: load_notetags_abe
  1122. #--------------------------------------------------------------------------
  1123. def load_notetags_abe
  1124. @popup_rules = {
  1125. :add_state => "ADDSTATE",
  1126. :rem_state => "REMSTATE",
  1127. :dur_state => nil
  1128. } # Do not remove this.
  1129. #---
  1130. self.note.split(/[\r\n]+/).each { |line|
  1131. case line
  1132. #---
  1133. when YEA::REGEXP::STATE::POPUP_ADD
  1134. @popup_rules[:add_state] = $1.upcase.to_s
  1135. when YEA::REGEXP::STATE::POPUP_REM
  1136. @popup_rules[:rem_state] = $1.upcase.to_s
  1137. when YEA::REGEXP::STATE::POPUP_DUR
  1138. @popup_rules[:dur_state] = $1.upcase.to_s
  1139. when YEA::REGEXP::STATE::HIDE_ADD
  1140. @popup_rules[:add_state] = nil
  1141. when YEA::REGEXP::STATE::HIDE_REM
  1142. @popup_rules[:rem_state] = nil
  1143. when YEA::REGEXP::STATE::HIDE_DUR
  1144. @popup_rules[:dur_state] = nil
  1145. end
  1146. } # self.note.split
  1147. #---
  1148. end
  1149.  
  1150. end # RPG::State
  1151.  
  1152. #==============================================================================
  1153. # ! BattleManager
  1154. #==============================================================================
  1155.  
  1156. module BattleManager
  1157.  
  1158. #--------------------------------------------------------------------------
  1159. # overwrite method: self.battle_start
  1160. #--------------------------------------------------------------------------
  1161. def self.battle_start
  1162. $game_system.battle_count += 1
  1163. $game_party.on_battle_start
  1164. $game_troop.on_battle_start
  1165. return unless YEA::BATTLE::MSG_ENEMY_APPEARS
  1166. $game_troop.enemy_names.each do |name|
  1167. $game_message.add(sprintf(Vocab::Emerge, name))
  1168. end
  1169. if @preemptive
  1170. $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
  1171. elsif @surprise
  1172. $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
  1173. end
  1174. wait_for_message
  1175. end
  1176.  
  1177. #--------------------------------------------------------------------------
  1178. # overwrite method: make_action_orders
  1179. #--------------------------------------------------------------------------
  1180. def self.make_action_orders
  1181. make_dtb_action_orders if btype?(:dtb)
  1182. end
  1183.  
  1184. #--------------------------------------------------------------------------
  1185. # new method: make_dtb_action_orders
  1186. #--------------------------------------------------------------------------
  1187. def self.make_dtb_action_orders
  1188. @action_battlers = []
  1189. @action_battlers += $game_party.members unless @surprise
  1190. @action_battlers += $game_troop.members unless @preemptive
  1191. @action_battlers.each {|battler| battler.make_speed }
  1192. @action_battlers.sort! {|a,b| b.speed - a.speed }
  1193. end
  1194.  
  1195. #--------------------------------------------------------------------------
  1196. # overwrite method: turn_start
  1197. #--------------------------------------------------------------------------
  1198. def self.turn_start
  1199. @phase = :turn
  1200. clear_actor
  1201. $game_troop.increase_turn
  1202. @performed_battlers = []
  1203. make_action_orders
  1204. end
  1205.  
  1206. #--------------------------------------------------------------------------
  1207. # overwrite method: next_subject
  1208. #--------------------------------------------------------------------------
  1209. def self.next_subject
  1210. @performed_battlers = [] if @performed_battlers.nil?
  1211. loop do
  1212. @action_battlers -= @performed_battlers
  1213. battler = @action_battlers.shift
  1214. return nil unless battler
  1215. next unless battler.index && battler.alive?
  1216. @performed_battlers.push(battler)
  1217. return battler
  1218. end
  1219. end
  1220.  
  1221. #--------------------------------------------------------------------------
  1222. # overwrite method: force_action
  1223. #--------------------------------------------------------------------------
  1224. def self.force_action(battler)
  1225. @action_forced = [] if @action_forced == nil
  1226. @action_forced.push(battler)
  1227. return unless Switch.forced_action_remove
  1228. @action_battlers.delete(battler)
  1229. end
  1230.  
  1231. #--------------------------------------------------------------------------
  1232. # overwrite method: action_forced?
  1233. #--------------------------------------------------------------------------
  1234. def self.action_forced?
  1235. @action_forced != nil
  1236. end
  1237.  
  1238. #--------------------------------------------------------------------------
  1239. # overwrite method: action_forced_battler
  1240. #--------------------------------------------------------------------------
  1241. def self.action_forced_battler
  1242. @action_forced.shift
  1243. end
  1244.  
  1245. #--------------------------------------------------------------------------
  1246. # overwrite method: clear_action_force
  1247. #--------------------------------------------------------------------------
  1248. def self.clear_action_force
  1249. return if @action_forced.nil?
  1250. @action_forced = nil if @action_forced.empty?
  1251. end
  1252.  
  1253. #--------------------------------------------------------------------------
  1254. # new method: self.init_battle_type
  1255. #--------------------------------------------------------------------------
  1256. def self.init_battle_type
  1257. set_btype($game_system.battle_system)
  1258. end
  1259.  
  1260. #--------------------------------------------------------------------------
  1261. # new method: self.set_btype
  1262. #--------------------------------------------------------------------------
  1263. def self.set_btype(btype = :dtb)
  1264. @battle_type = btype
  1265. end
  1266.  
  1267. #--------------------------------------------------------------------------
  1268. # new method: self.btype?
  1269. #--------------------------------------------------------------------------
  1270. def self.btype?(btype)
  1271. return @battle_type == btype
  1272. end
  1273.  
  1274. end # BattleManager
  1275.  
  1276. #==============================================================================
  1277. # ! Game_System
  1278. #==============================================================================
  1279.  
  1280. class Game_System
  1281.  
  1282. #--------------------------------------------------------------------------
  1283. # new method: battle_system
  1284. #--------------------------------------------------------------------------
  1285. def battle_system
  1286. if @battle_system.nil?
  1287. return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
  1288. else
  1289. return battle_system_corrected(@battle_system)
  1290. end
  1291. end
  1292.  
  1293. #--------------------------------------------------------------------------
  1294. # new method: set_battle_system
  1295. #--------------------------------------------------------------------------
  1296. def set_battle_system(type)
  1297. case type
  1298. when :dtb; @battle_system = :dtb
  1299. when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  1300. else; @battle_system = :dtb
  1301. end
  1302. end
  1303.  
  1304. #--------------------------------------------------------------------------
  1305. # new method: battle_system_corrected
  1306. #--------------------------------------------------------------------------
  1307. def battle_system_corrected(type)
  1308. case type
  1309. when :dtb; return :dtb
  1310. when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
  1311. else; return :dtb
  1312. end
  1313. end
  1314.  
  1315. end # Game_System
  1316.  
  1317. #==============================================================================
  1318. # ! Sprite_Base
  1319. #==============================================================================
  1320.  
  1321. class Sprite_Base < Sprite
  1322.  
  1323. #--------------------------------------------------------------------------
  1324. # new method: start_pseudo_animation
  1325. #--------------------------------------------------------------------------
  1326. unless $imported["YEA-CoreEngine"]
  1327. def start_pseudo_animation(animation, mirror = false)
  1328. dispose_animation
  1329. @animation = animation
  1330. return if @animation.nil?
  1331. @ani_mirror = mirror
  1332. set_animation_rate
  1333. @ani_duration = @animation.frame_max * @ani_rate + 1
  1334. @ani_sprites = []
  1335. end
  1336. end # $imported["YEA-CoreEngine"]
  1337.  
  1338. end # Sprite_Base
  1339.  
  1340. #==============================================================================
  1341. # ! Sprite_Battler
  1342. #==============================================================================
  1343.  
  1344. class Sprite_Battler < Sprite_Base
  1345.  
  1346. #--------------------------------------------------------------------------
  1347. # public instance variables
  1348. #--------------------------------------------------------------------------
  1349. attr_accessor :effect_type
  1350. attr_accessor :battler_visible
  1351. attr_accessor :popups
  1352.  
  1353. #--------------------------------------------------------------------------
  1354. # alias method: initialize
  1355. #--------------------------------------------------------------------------
  1356. alias sprite_battler_initialize_abe initialize
  1357. def initialize(viewport, battler = nil)
  1358. sprite_battler_initialize_abe(viewport, battler)
  1359. @popups = []
  1360. @popup_flags = []
  1361. end
  1362.  
  1363. #--------------------------------------------------------------------------
  1364. # alias method: update_bitmap
  1365. #--------------------------------------------------------------------------
  1366. alias sprite_battler_update_bitmap_abe update_bitmap
  1367. def update_bitmap
  1368. return if @battler.actor? && @battler.battler_name == ""
  1369. sprite_battler_update_bitmap_abe
  1370. end
  1371.  
  1372. #--------------------------------------------------------------------------
  1373. # alias method: setup_new_animation
  1374. #--------------------------------------------------------------------------
  1375. unless $imported["YEA-CoreEngine"]
  1376. alias sprite_battler_setup_new_animation_abe setup_new_animation
  1377. def setup_new_animation
  1378. sprite_battler_setup_new_animation_abe
  1379. return if @battler.pseudo_ani_id <= 0
  1380. animation = $data_animations[@battler.pseudo_ani_id]
  1381. mirror = @battler.animation_mirror
  1382. start_pseudo_animation(animation, mirror)
  1383. @battler.pseudo_ani_id = 0
  1384. end
  1385. end # $imported["YEA-CoreEngine"]
  1386.  
  1387. #--------------------------------------------------------------------------
  1388. # alias method: setup_new_effect
  1389. #--------------------------------------------------------------------------
  1390. alias sprite_battler_setup_new_effect_abe setup_new_effect
  1391. def setup_new_effect
  1392. sprite_battler_setup_new_effect_abe
  1393. setup_popups
  1394. end
  1395.  
  1396. #--------------------------------------------------------------------------
  1397. # new method: setup_popups
  1398. #--------------------------------------------------------------------------
  1399. def setup_popups
  1400. return unless @battler.use_sprite?
  1401. @battler.popups = [] if @battler.popups.nil?
  1402. return if @battler.popups == []
  1403. array = @battler.popups.shift
  1404. create_new_popup(array[0], array[1], array[2])
  1405. end
  1406.  
  1407. #--------------------------------------------------------------------------
  1408. # new method: create_new_popup
  1409. #--------------------------------------------------------------------------
  1410. def create_new_popup(value, rules, flags)
  1411. return if @battler == nil
  1412. return if flags & @popup_flags != []
  1413. array = YEA::BATTLE::POPUP_RULES[rules]
  1414. for popup in @popups
  1415. popup.y -= 24
  1416. end
  1417. return unless SceneManager.scene.is_a?(Scene_Battle)
  1418. return if SceneManager.scene.spriteset.nil?
  1419. view = SceneManager.scene.spriteset.viewportPopups
  1420. new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
  1421. @popups.push(new_popup)
  1422. @popup_flags.push("weakness") if flags.include?("weakness")
  1423. @popup_flags.push("resistant") if flags.include?("resistant")
  1424. @popup_flags.push("immune") if flags.include?("immune")
  1425. @popup_flags.push("absorbed") if flags.include?("absorbed")
  1426. end
  1427.  
  1428. #--------------------------------------------------------------------------
  1429. # alias method: update_effect
  1430. #--------------------------------------------------------------------------
  1431. alias sprite_battler_update_effect_abe update_effect
  1432. def update_effect
  1433. sprite_battler_update_effect_abe
  1434. update_popups
  1435. end
  1436.  
  1437. #--------------------------------------------------------------------------
  1438. # new method: update_popups
  1439. #--------------------------------------------------------------------------
  1440. def update_popups
  1441. for popup in @popups
  1442. popup.update
  1443. next unless popup.opacity <= 0
  1444. popup.bitmap.dispose
  1445. popup.dispose
  1446. @popups.delete(popup)
  1447. popup = nil
  1448. end
  1449. @popup_flags = [] if @popups == [] && @popup_flags != []
  1450. return unless SceneManager.scene_is?(Scene_Battle)
  1451. if @current_active_battler != SceneManager.scene.subject
  1452. @current_active_battler = SceneManager.scene.subject
  1453. @popup_flags = []
  1454. end
  1455. end
  1456.  
  1457. end # Sprite_Battler
  1458.  
  1459. #==============================================================================
  1460. # ! Sprite_Popup
  1461. #==============================================================================
  1462.  
  1463. class Sprite_Popup < Sprite_Base
  1464.  
  1465. #--------------------------------------------------------------------------
  1466. # public instance variables
  1467. #--------------------------------------------------------------------------
  1468. attr_accessor :flags
  1469.  
  1470. #--------------------------------------------------------------------------
  1471. # initialize
  1472. #--------------------------------------------------------------------------
  1473. def initialize(viewport, battler, value, rules, flags)
  1474. super(viewport)
  1475. @value = value
  1476. @rules = rules
  1477. @rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
  1478. @fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
  1479. @full = YEA::BATTLE::POPUP_SETTINGS[:full]
  1480. @flags = flags
  1481. @battler = battler
  1482. create_popup_bitmap
  1483. end
  1484.  
  1485. #--------------------------------------------------------------------------
  1486. # create_popup_bitmap
  1487. #--------------------------------------------------------------------------
  1488. def create_popup_bitmap
  1489. rules_array = YEA::BATTLE::POPUP_RULES[@rules]
  1490. bw = Graphics.width
  1491. bw += 48 if @flags.include?("state")
  1492. bh = Font.default_size * 3
  1493. bitmap = Bitmap.new(bw, bh)
  1494. bitmap.font.name = rules_array[8]
  1495. size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
  1496. bitmap.font.size = size
  1497. bitmap.font.bold = rules_array[3]
  1498. bitmap.font.italic = rules_array[4]
  1499. if flags.include?("critical")
  1500. crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
  1501. bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
  1502. else
  1503. bitmap.font.out_color.set(0, 0, 0, 255)
  1504. end
  1505. dx = 0; dy = 0; dw = 0
  1506. dx += 24 if @flags.include?("state")
  1507. dw += 24 if @flags.include?("state")
  1508. if @flags.include?("state") || @flags.include?("buff")
  1509. c_width = bitmap.text_size(@value).width
  1510. icon_bitmap = $game_temp.iconset
  1511. icon_index = flag_state_icon
  1512. rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1513. bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
  1514. end
  1515. bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
  1516. bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
  1517. self.bitmap = bitmap
  1518. self.x = @battler.screen_x
  1519. self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
  1520. self.x -= SceneManager.scene.spriteset.viewport1.ox
  1521. self.y = @battler.screen_y - @battler.sprite.oy/2
  1522. self.y -= @battler.sprite.oy/2 if @battler.actor?
  1523. self.y -= SceneManager.scene.spriteset.viewport1.oy
  1524. self.ox = bw/2; self.oy = bh/2
  1525. self.zoom_x = self.zoom_y = rules_array[0]
  1526. if @flags.include?("no zoom")
  1527. self.zoom_x = self.zoom_y = rules_array[1]
  1528. end
  1529. @target_zoom = rules_array[1]
  1530. @zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
  1531. self.z = 500
  1532. end
  1533.  
  1534. #--------------------------------------------------------------------------
  1535. # update
  1536. #--------------------------------------------------------------------------
  1537. def update
  1538. super
  1539. #---
  1540. if @flags.include?("critical") && YEA::BATTLE::FLASH_CRITICAL
  1541. @hue_duration = 2 if @hue_duration == nil || @hue_duration == 0
  1542. @hue_duration -= 1
  1543. self.bitmap.hue_change(15) if @hue_duration <= 0
  1544. end
  1545. #---
  1546. if @zoom_direction == "up"
  1547. self.zoom_x = [self.zoom_x + 0.075, @target_zoom].min
  1548. self.zoom_y = [self.zoom_y + 0.075, @target_zoom].min
  1549. else
  1550. self.zoom_x = [self.zoom_x - 0.075, @target_zoom].max
  1551. self.zoom_y = [self.zoom_y - 0.075, @target_zoom].max
  1552. end
  1553. #---
  1554. @full -= 1
  1555. return if @full > 0
  1556. self.y -= 1
  1557. self.opacity -= @fade
  1558. end
  1559.  
  1560. #--------------------------------------------------------------------------
  1561. # flag_state_icon
  1562. #--------------------------------------------------------------------------
  1563. def flag_state_icon
  1564. for item in @flags; return item if item.is_a?(Integer); end
  1565. return 0
  1566. end
  1567.  
  1568. end # Sprite_Popup
  1569.  
  1570. #==============================================================================
  1571. # ! Spriteset_Battle
  1572. #==============================================================================
  1573.  
  1574. class Spriteset_Battle
  1575.  
  1576. #--------------------------------------------------------------------------
  1577. # public instance variables
  1578. #--------------------------------------------------------------------------
  1579. attr_accessor :actor_sprites
  1580. attr_accessor :enemy_sprites
  1581. attr_accessor :viewport1
  1582. attr_accessor :viewportPopups
  1583.  
  1584. #--------------------------------------------------------------------------
  1585. # alias method: create_viewports
  1586. #--------------------------------------------------------------------------
  1587. alias spriteset_battle_create_viewports_abe create_viewports
  1588. def create_viewports
  1589. spriteset_battle_create_viewports_abe
  1590. @viewportPopups = Viewport.new
  1591. @viewportPopups.z = 200
  1592. end
  1593.  
  1594. #--------------------------------------------------------------------------
  1595. # alias method: dispose_viewports
  1596. #--------------------------------------------------------------------------
  1597. alias spriteset_battle_dispose_viewports_abe dispose_viewports
  1598. def dispose_viewports
  1599. spriteset_battle_dispose_viewports_abe
  1600. @viewportPopups.dispose
  1601. end
  1602.  
  1603. #--------------------------------------------------------------------------
  1604. # alias method: update_viewports
  1605. #--------------------------------------------------------------------------
  1606. alias spriteset_battle_update_viewports_abe update_viewports
  1607. def update_viewports
  1608. spriteset_battle_update_viewports_abe
  1609. @viewportPopups.update
  1610. end
  1611.  
  1612. end # Spriteset_Battle
  1613.  
  1614. #==============================================================================
  1615. # ! Game_Temp
  1616. #==============================================================================
  1617.  
  1618. class Game_Temp
  1619.  
  1620. #--------------------------------------------------------------------------
  1621. # public instance variables
  1622. #--------------------------------------------------------------------------
  1623. attr_accessor :battle_aid
  1624. attr_accessor :evaluating
  1625. attr_accessor :iconset
  1626.  
  1627. #--------------------------------------------------------------------------
  1628. # alias method: initialize
  1629. #--------------------------------------------------------------------------
  1630. alias game_temp_initialize_abe initialize
  1631. def initialize
  1632. game_temp_initialize_abe
  1633. @iconset = Cache.system("Iconset")
  1634. end
  1635.  
  1636. end # Game_Temp
  1637.  
  1638. #==============================================================================
  1639. # ! Game_Action
  1640. #==============================================================================
  1641.  
  1642. class Game_Action
  1643.  
  1644. #--------------------------------------------------------------------------
  1645. # overwrite method: speed
  1646. #--------------------------------------------------------------------------
  1647. def speed
  1648. speed = subject.agi
  1649. speed += item.speed if item
  1650. speed += subject.atk_speed if attack?
  1651. return speed
  1652. end
  1653.  
  1654. #--------------------------------------------------------------------------
  1655. # alias method: evaluate_item_with_target
  1656. #--------------------------------------------------------------------------
  1657. alias evaluate_item_with_target_abe evaluate_item_with_target
  1658. def evaluate_item_with_target(target)
  1659. $game_temp.evaluating = true
  1660. result = evaluate_item_with_target_abe(target)
  1661. $game_temp.evaluating = false
  1662. return result
  1663. end
  1664.  
  1665. end # Game_Action
  1666.  
  1667. #==============================================================================
  1668. # ! Game_ActionResult
  1669. #==============================================================================
  1670.  
  1671. class Game_ActionResult
  1672.  
  1673. #--------------------------------------------------------------------------
  1674. # alias method: clear
  1675. #--------------------------------------------------------------------------
  1676. alias game_actionresult_clear_abe clear
  1677. def clear
  1678. game_actionresult_clear_abe
  1679. clear_stored_damage
  1680. end
  1681.  
  1682. #--------------------------------------------------------------------------
  1683. # new method: clear_stored_damage
  1684. #--------------------------------------------------------------------------
  1685. def clear_stored_damage
  1686. @stored_hp_damage = 0
  1687. @stored_mp_damage = 0
  1688. @stored_tp_damage = 0
  1689. @stored_hp_drain = 0
  1690. @stored_mp_drain = 0
  1691. end
  1692.  
  1693. #--------------------------------------------------------------------------
  1694. # new method: store_damage
  1695. #--------------------------------------------------------------------------
  1696. def store_damage
  1697. @stored_hp_damage += @hp_damage
  1698. @stored_mp_damage += @mp_damage
  1699. @stored_tp_damage += @tp_damage
  1700. @stored_hp_drain += @hp_drain
  1701. @stored_mp_drain += @mp_drain
  1702. end
  1703.  
  1704. #--------------------------------------------------------------------------
  1705. # new method: restore_damage
  1706. #--------------------------------------------------------------------------
  1707. def restore_damage
  1708. @hp_damage = @stored_hp_damage
  1709. @mp_damage = @stored_mp_damage
  1710. @tp_damage = @stored_tp_damage
  1711. @hp_drain = @stored_hp_drain
  1712. @mp_drain = @stored_mp_drain
  1713. clear_stored_damage
  1714. end
  1715.  
  1716. end # Game_ActionResult
  1717.  
  1718. #==============================================================================
  1719. # ! Game_BattlerBase
  1720. #==============================================================================
  1721.  
  1722. class Game_BattlerBase
  1723.  
  1724. #--------------------------------------------------------------------------
  1725. # public instance variables
  1726. #--------------------------------------------------------------------------
  1727. attr_accessor :popups
  1728.  
  1729. #--------------------------------------------------------------------------
  1730. # new method: create_popup
  1731. #--------------------------------------------------------------------------
  1732. def create_popup(value, rules = "DEFAULT", flags = [])
  1733. return unless SceneManager.scene_is?(Scene_Battle)
  1734. return unless YEA::BATTLE::ENABLE_POPUPS
  1735. return if Switch.hide_popups
  1736. @popups = [] if @popups.nil?
  1737. @popups.push([value, rules, flags])
  1738. end
  1739.  
  1740. #--------------------------------------------------------------------------
  1741. # new method: make_damage_popups
  1742. #--------------------------------------------------------------------------
  1743. def make_damage_popups(user)
  1744. if @result.hp_drain != 0
  1745. text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1746. rules = "DRAIN"
  1747. user.create_popup(text, rules)
  1748. setting = :hp_dmg if @result.hp_drain < 0
  1749. setting = :hp_heal if @result.hp_drain > 0
  1750. rules = "HP_DMG" if @result.hp_drain < 0
  1751. rules = "HP_HEAL" if @result.hp_drain > 0
  1752. value = @result.hp_drain.abs
  1753. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1754. user.create_popup(text, rules)
  1755. end
  1756. if @result.mp_drain != 0
  1757. text = YEA::BATTLE::POPUP_SETTINGS[:drained]
  1758. rules = "DRAIN"
  1759. user.create_popup(text, rules)
  1760. setting = :mp_dmg if @result.mp_drain < 0
  1761. setting = :mp_heal if @result.mp_drain > 0
  1762. rules = "HP_DMG" if @result.mp_drain < 0
  1763. rules = "HP_HEAL" if @result.mp_drain > 0
  1764. value = @result.mp_drain.abs
  1765. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1766. user.create_popup(text, rules)
  1767. end
  1768. #---
  1769. flags = []
  1770. flags.push("critical") if @result.critical
  1771. if @result.hp_damage != 0
  1772. setting = :hp_dmg if @result.hp_damage > 0
  1773. setting = :hp_heal if @result.hp_damage < 0
  1774. rules = "HP_DMG" if @result.hp_damage > 0
  1775. rules = "HP_HEAL" if @result.hp_damage < 0
  1776. value = @result.hp_damage.abs
  1777. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1778. create_popup(text, rules, flags)
  1779. end
  1780. if @result.mp_damage != 0
  1781. setting = :mp_dmg if @result.mp_damage > 0
  1782. setting = :mp_heal if @result.mp_damage < 0
  1783. rules = "MP_DMG" if @result.mp_damage > 0
  1784. rules = "MP_HEAL" if @result.mp_damage < 0
  1785. value = @result.mp_damage.abs
  1786. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1787. create_popup(text, rules, flags)
  1788. end
  1789. if @result.tp_damage != 0
  1790. setting = :tp_dmg if @result.tp_damage > 0
  1791. setting = :tp_heal if @result.tp_damage < 0
  1792. rules = "TP_DMG" if @result.tp_damage > 0
  1793. rules = "TP_HEAL" if @result.tp_damage < 0
  1794. value = @result.tp_damage.abs
  1795. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
  1796. create_popup(text, rules)
  1797. end
  1798. @result.store_damage
  1799. @result.clear_damage_values
  1800. end
  1801.  
  1802. #--------------------------------------------------------------------------
  1803. # alias method: erase_state
  1804. #--------------------------------------------------------------------------
  1805. alias game_battlerbase_erase_state_abe erase_state
  1806. def erase_state(state_id)
  1807. make_state_popup(state_id, :rem_state) if @states.include?(state_id)
  1808. game_battlerbase_erase_state_abe(state_id)
  1809. end
  1810.  
  1811. #--------------------------------------------------------------------------
  1812. # new method: make_during_state_popup
  1813. #--------------------------------------------------------------------------
  1814. def make_during_state_popup
  1815. state_id = most_important_state_id
  1816. return if state_id == 0
  1817. make_state_popup(state_id, :dur_state)
  1818. end
  1819.  
  1820. #--------------------------------------------------------------------------
  1821. # new method: most_important_state_id
  1822. #--------------------------------------------------------------------------
  1823. def most_important_state_id
  1824. states.each {|state| return state.id unless state.message3.empty? }
  1825. return 0
  1826. end
  1827.  
  1828. #--------------------------------------------------------------------------
  1829. # new method: make_state_popup
  1830. #--------------------------------------------------------------------------
  1831. def make_state_popup(state_id, type)
  1832. state = $data_states[state_id]
  1833. return if state.icon_index == 0
  1834. rules = state.popup_rules[type]
  1835. return if rules.nil?
  1836. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[type], state.name)
  1837. flags = ["state", state.icon_index]
  1838. create_popup(text, rules, flags)
  1839. end
  1840.  
  1841. #--------------------------------------------------------------------------
  1842. # new method: make_miss_popups
  1843. #--------------------------------------------------------------------------
  1844. def make_miss_popups(user, item)
  1845. return if dead?
  1846. if @result.missed
  1847. text = YEA::BATTLE::POPUP_SETTINGS[:missed]
  1848. rules = "DEFAULT"
  1849. create_popup(text, rules)
  1850. end
  1851. if @result.evaded
  1852. text = YEA::BATTLE::POPUP_SETTINGS[:evaded]
  1853. rules = "DEFAULT"
  1854. create_popup(text, rules)
  1855. end
  1856. if @result.hit? && !@result.success
  1857. text = YEA::BATTLE::POPUP_SETTINGS[:failed]
  1858. rules = "DEFAULT"
  1859. create_popup(text, rules)
  1860. end
  1861. if @result.hit? && item.damage.to_hp?
  1862. if @result.hp_damage == 0 && @result.hp_damage == 0
  1863. text = YEA::BATTLE::POPUP_SETTINGS[:nulled]
  1864. rules = "DEFAULT"
  1865. create_popup(text, rules)
  1866. end
  1867. end
  1868. end
  1869.  
  1870. #--------------------------------------------------------------------------
  1871. # new method: make_rate_popup
  1872. #--------------------------------------------------------------------------
  1873. def make_rate_popup(rate)
  1874. return if rate == 1.0
  1875. flags = []
  1876. if rate > 1.0
  1877. text = YEA::BATTLE::POPUP_SETTINGS[:weakpoint]
  1878. rules = "WEAK_ELE"
  1879. flags.push("weakness")
  1880. elsif rate == 0.0
  1881. text = YEA::BATTLE::POPUP_SETTINGS[:immune]
  1882. rules = "IMMU_ELE"
  1883. flags.push("immune")
  1884. elsif rate < 0.0
  1885. text = YEA::BATTLE::POPUP_SETTINGS[:absorbed]
  1886. rules = "ABSB_ELE"
  1887. flags.push("absorbed")
  1888. else
  1889. text = YEA::BATTLE::POPUP_SETTINGS[:resistant]
  1890. rules = "REST_ELE"
  1891. flags.push("resistant")
  1892. end
  1893. create_popup(text, rules, flags)
  1894. end
  1895.  
  1896. #--------------------------------------------------------------------------
  1897. # new method: make_buff_popup
  1898. #--------------------------------------------------------------------------
  1899. def make_buff_popup(param_id, positive = true)
  1900. return unless SceneManager.scene_is?(Scene_Battle)
  1901. return unless alive?
  1902. name = Vocab::param(param_id)
  1903. if positive
  1904. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_buff], name)
  1905. rules = "BUFF"
  1906. buff_level = 1
  1907. else
  1908. text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:add_debuff], name)
  1909. rules = "DEBUFF"
  1910. buff_level = -1
  1911. end
  1912. icon = buff_icon_index(buff_level, param_id)
  1913. flags = ["buff", icon]
  1914. return if @popups.include?([text, rules, flags])
  1915. create_popup(text, rules, flags)
  1916. end
  1917.  
  1918. end # Game_BattlerBase
  1919.  
  1920. #==============================================================================
  1921. # ! Game_Battler
  1922. #==============================================================================
  1923.  
  1924. class Game_Battler < Game_BattlerBase
  1925.  
  1926. #--------------------------------------------------------------------------
  1927. # public instance variables
  1928. #--------------------------------------------------------------------------
  1929. attr_accessor :pseudo_ani_id
  1930.  
  1931. #--------------------------------------------------------------------------
  1932. # alias method: on_battle_end
  1933. #--------------------------------------------------------------------------
  1934. alias game_battler_on_battle_end_abe on_battle_end
  1935. def on_battle_end
  1936. game_battler_on_battle_end_abe
  1937. @popups = []
  1938. end
  1939.  
  1940. #--------------------------------------------------------------------------
  1941. # alias method: clear_sprite_effects
  1942. #--------------------------------------------------------------------------
  1943. alias game_battler_clear_sprite_effects_abe clear_sprite_effects
  1944. def clear_sprite_effects
  1945. game_battler_clear_sprite_effects_abe
  1946. @pseudo_ani_id = 0
  1947. end
  1948.  
  1949. #--------------------------------------------------------------------------
  1950. # alias method: item_apply
  1951. #--------------------------------------------------------------------------
  1952. alias game_battler_item_apply_abe item_apply
  1953. def item_apply(user, item)
  1954. game_battler_item_apply_abe(user, item)
  1955. make_miss_popups(user, item)
  1956. end
  1957.  
  1958. #--------------------------------------------------------------------------
  1959. # alias method: make_damage_value
  1960. #--------------------------------------------------------------------------
  1961. alias game_battler_make_damage_value_abe make_damage_value
  1962. def make_damage_value(user, item)
  1963. game_battler_make_damage_value_abe(user, item)
  1964. rate = item_element_rate(user, item)
  1965. make_rate_popup(rate) unless $game_temp.evaluating
  1966. end
  1967.  
  1968. #--------------------------------------------------------------------------
  1969. # alias method: execute_damage
  1970. #--------------------------------------------------------------------------
  1971. alias game_battler_execute_damage_abe execute_damage
  1972. def execute_damage(user)
  1973. game_battler_execute_damage_abe(user)
  1974. make_damage_popups(user)
  1975. end
  1976.  
  1977. #--------------------------------------------------------------------------
  1978. # alias method: item_effect_recover_hp
  1979. #--------------------------------------------------------------------------
  1980. alias game_battler_item_effect_recover_hp_abe item_effect_recover_hp
  1981. def item_effect_recover_hp(user, item, effect)
  1982. game_battler_item_effect_recover_hp_abe(user, item, effect)
  1983. make_damage_popups(user)
  1984. end
  1985.  
  1986. #--------------------------------------------------------------------------
  1987. # alias method: item_effect_recover_mp
  1988. #--------------------------------------------------------------------------
  1989. alias game_battler_item_effect_recover_mp_abe item_effect_recover_mp
  1990. def item_effect_recover_mp(user, item, effect)
  1991. game_battler_item_effect_recover_mp_abe(user, item, effect)
  1992. make_damage_popups(user)
  1993. end
  1994.  
  1995. #--------------------------------------------------------------------------
  1996. # alias method: item_effect_gain_tp
  1997. #--------------------------------------------------------------------------
  1998. alias game_battler_item_effect_gain_tp_abe item_effect_gain_tp
  1999. def item_effect_gain_tp(user, item, effect)
  2000. game_battler_item_effect_gain_tp_abe(user, item, effect)
  2001. make_damage_popups(user)
  2002. end
  2003.  
  2004. #--------------------------------------------------------------------------
  2005. # alias method: item_user_effect
  2006. #--------------------------------------------------------------------------
  2007. alias game_battler_item_user_effect_abe item_user_effect
  2008. def item_user_effect(user, item)
  2009. game_battler_item_user_effect_abe(user, item)
  2010. @result.restore_damage
  2011. end
  2012.  
  2013. #--------------------------------------------------------------------------
  2014. # alias method: add_new_state
  2015. #--------------------------------------------------------------------------
  2016. alias game_battler_add_new_state_abe add_new_state
  2017. def add_new_state(state_id)
  2018. game_battler_add_new_state_abe(state_id)
  2019. make_state_popup(state_id, :add_state) if @states.include?(state_id)
  2020. end
  2021.  
  2022. #--------------------------------------------------------------------------
  2023. # alias method: add_buff
  2024. #--------------------------------------------------------------------------
  2025. alias game_battler_add_buff_abe add_buff
  2026. def add_buff(param_id, turns)
  2027. make_buff_popup(param_id, true)
  2028. game_battler_add_buff_abe(param_id, turns)
  2029. end
  2030.  
  2031. #--------------------------------------------------------------------------
  2032. # alias method: add_debuff
  2033. #--------------------------------------------------------------------------
  2034. alias game_battler_add_debuff_abe add_debuff
  2035. def add_debuff(param_id, turns)
  2036. make_buff_popup(param_id, false)
  2037. game_battler_add_debuff_abe(param_id, turns)
  2038. end
  2039.  
  2040. #--------------------------------------------------------------------------
  2041. # alias method: regenerate_all
  2042. #--------------------------------------------------------------------------
  2043. alias game_battler_regenerate_all_abe regenerate_all
  2044. def regenerate_all
  2045. game_battler_regenerate_all_abe
  2046. return unless alive?
  2047. make_damage_popups(self)
  2048. end
  2049.  
  2050. #--------------------------------------------------------------------------
  2051. # new method: can_collapse?
  2052. #--------------------------------------------------------------------------
  2053. def can_collapse?
  2054. return false unless dead?
  2055. unless actor?
  2056. return false unless sprite.battler_visible
  2057. array = [:collapse, :boss_collapse, :instant_collapse]
  2058. return false if array.include?(sprite.effect_type)
  2059. end
  2060. return true
  2061. end
  2062.  
  2063. #--------------------------------------------------------------------------
  2064. # new method: draw_mp?
  2065. #--------------------------------------------------------------------------
  2066. #def draw_mp?; return true; end
  2067.  
  2068. #--------------------------------------------------------------------------
  2069. # new method: draw_tp?
  2070. #--------------------------------------------------------------------------
  2071. #def draw_tp?
  2072. #return $data_system.opt_display_mp
  2073. #return $data_system.opt_display_tp
  2074. #end
  2075.  
  2076. end # Game_Battler
  2077.  
  2078. #==============================================================================
  2079. # ! Game_Actor
  2080. #==============================================================================
  2081.  
  2082. class Game_Actor < Game_Battler
  2083.  
  2084. #--------------------------------------------------------------------------
  2085. # overwrite method: perform_damage_effect
  2086. #--------------------------------------------------------------------------
  2087. def perform_damage_effect
  2088. $game_troop.screen.start_shake(5, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
  2089. @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  2090. Sound.play_actor_damage
  2091. end
  2092.  
  2093. #--------------------------------------------------------------------------
  2094. # overwrite method: use_sprite?
  2095. #--------------------------------------------------------------------------
  2096. def use_sprite?; return true; end
  2097.  
  2098. #--------------------------------------------------------------------------
  2099. # new method: screen_x
  2100. #--------------------------------------------------------------------------
  2101. def screen_x
  2102. return 0 unless SceneManager.scene_is?(Scene_Battle)
  2103. status_window = SceneManager.scene.status_window
  2104. return 0 if status_window.nil?
  2105. item_rect_width = (status_window.width-24) / $game_party.max_battle_members
  2106. ext = SceneManager.scene.info_viewport.ox
  2107. rect = SceneManager.scene.status_window.item_rect(self.index)
  2108. constant = 128 + 12
  2109. return constant + rect.x + item_rect_width / 2 - ext
  2110. end
  2111.  
  2112. #--------------------------------------------------------------------------
  2113. # new method: screen_y
  2114. #--------------------------------------------------------------------------
  2115. def screen_y
  2116. return Graphics.height - 120 unless SceneManager.scene_is?(Scene_Battle)
  2117. return Graphics.height - 120 if SceneManager.scene.status_window.nil?
  2118. return Graphics.height - (SceneManager.scene.status_window.height * 7/8)
  2119. end
  2120.  
  2121. #--------------------------------------------------------------------------
  2122. # new method: screen_z
  2123. #--------------------------------------------------------------------------
  2124. def screen_z; return 100; end
  2125.  
  2126. #--------------------------------------------------------------------------
  2127. # new method: sprite
  2128. #--------------------------------------------------------------------------
  2129. def sprite
  2130. index = $game_party.battle_members.index(self)
  2131. return SceneManager.scene.spriteset.actor_sprites[index]
  2132. end
  2133.  
  2134. #--------------------------------------------------------------------------
  2135. # new method: draw_mp?
  2136. #--------------------------------------------------------------------------
  2137. def draw_mp?
  2138. return true unless draw_tp?
  2139. for skill in skills
  2140. next unless added_skill_types.include?(skill.stype_id)
  2141. return true if skill.mp_cost > 0
  2142. end
  2143. return false
  2144. end
  2145.  
  2146. #--------------------------------------------------------------------------
  2147. # new method: draw_tp?
  2148. #--------------------------------------------------------------------------
  2149. #def draw_tp?
  2150. # return false unless $data_system.opt_display_tp
  2151. #for skill in skills
  2152. # next unless added_skill_types.include?(skill.stype_id)
  2153. #return true if skill.tp_cost > 0
  2154. #end
  2155. #return false
  2156. #end
  2157.  
  2158. #--------------------------------------------------------------------------
  2159. # alias method: input
  2160. #--------------------------------------------------------------------------
  2161. alias game_actor_input_abe input
  2162. def input
  2163. if @actions.nil?
  2164. make_actions
  2165. @action_input_index = 0
  2166. end
  2167. if @actions[@action_input_index].nil?
  2168. @actions[@action_input_index] = Game_Action.new(self)
  2169. end
  2170. return game_actor_input_abe
  2171. end
  2172.  
  2173. end # Game_Actor
  2174.  
  2175. #==============================================================================
  2176. # ! Game_Enemy
  2177. #==============================================================================
  2178.  
  2179. class Game_Enemy < Game_Battler
  2180.  
  2181. #--------------------------------------------------------------------------
  2182. # overwrite method: perform_damage_effect
  2183. #--------------------------------------------------------------------------
  2184. def perform_damage_effect
  2185. @sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
  2186. Sound.play_enemy_damage
  2187. end
  2188.  
  2189. #--------------------------------------------------------------------------
  2190. # new methods: attack_animation_id
  2191. #--------------------------------------------------------------------------
  2192. def atk_animation_id1; return enemy.atk_animation_id1; end
  2193. def atk_animation_id2; return enemy.atk_animation_id2; end
  2194.  
  2195. #--------------------------------------------------------------------------
  2196. # new method: sprite
  2197. #--------------------------------------------------------------------------
  2198. def sprite
  2199. return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  2200. end
  2201.  
  2202. end # Game_Enemy
  2203.  
  2204. #==============================================================================
  2205. # ! Game_Unit
  2206. #==============================================================================
  2207.  
  2208. class Game_Unit
  2209.  
  2210. #--------------------------------------------------------------------------
  2211. # alias method: make_actions
  2212. #--------------------------------------------------------------------------
  2213. alias game_unit_make_actions_abe make_actions
  2214. def make_actions
  2215. game_unit_make_actions_abe
  2216. refresh_autobattler_status_window
  2217. end
  2218.  
  2219. #--------------------------------------------------------------------------
  2220. # new method: refresh_autobattler_status_window
  2221. #--------------------------------------------------------------------------
  2222. def refresh_autobattler_status_window
  2223. return unless SceneManager.scene_is?(Scene_Battle)
  2224. return unless self.is_a?(Game_Party)
  2225. SceneManager.scene.refresh_autobattler_status_window
  2226. end
  2227.  
  2228. end # Game_Unit
  2229.  
  2230. #==============================================================================
  2231. # ! Window_PartyCommand
  2232. #==============================================================================
  2233.  
  2234. class Window_PartyCommand < Window_Command
  2235.  
  2236. #--------------------------------------------------------------------------
  2237. # overwrite method: process_handling
  2238. #--------------------------------------------------------------------------
  2239. def process_handling
  2240. return unless open? && active
  2241. return process_dir6 if Input.repeat?(:RIGHT)
  2242. return super
  2243. end
  2244.  
  2245. #--------------------------------------------------------------------------
  2246. # new method: process_dir6
  2247. #--------------------------------------------------------------------------
  2248. def process_dir6
  2249. Sound.play_cursor
  2250. Input.update
  2251. deactivate
  2252. call_handler(:dir6)
  2253. end
  2254.  
  2255. end # Window_PartyCommand
  2256.  
  2257. #==============================================================================
  2258. # ! Window_ActorCommand
  2259. #==============================================================================
  2260.  
  2261. class Window_ActorCommand < Window_Command
  2262.  
  2263. #--------------------------------------------------------------------------
  2264. # overwrite method: process_handling
  2265. #--------------------------------------------------------------------------
  2266. def process_handling
  2267. return unless open? && active
  2268. return process_dir4 if Input.repeat?(:LEFT)
  2269. return process_dir6 if Input.repeat?(:RIGHT)
  2270. return super
  2271. end
  2272.  
  2273. #--------------------------------------------------------------------------
  2274. # new method: process_dir4
  2275. #--------------------------------------------------------------------------
  2276. def process_dir4
  2277. Sound.play_cursor
  2278. Input.update
  2279. deactivate
  2280. call_handler(:cancel)
  2281. end
  2282.  
  2283. #--------------------------------------------------------------------------
  2284. # new method: process_dir6
  2285. #--------------------------------------------------------------------------
  2286. def process_dir6
  2287. Sound.play_cursor
  2288. Input.update
  2289. deactivate
  2290. call_handler(:dir6)
  2291. end
  2292.  
  2293. end # Window_ActorCommand
  2294.  
  2295. #==============================================================================
  2296. # ! Window_BattleStatus
  2297. #==============================================================================
  2298.  
  2299. class Window_BattleStatus < Window_Selectable
  2300.  
  2301. #--------------------------------------------------------------------------
  2302. # overwrite method: initialize
  2303. #--------------------------------------------------------------------------
  2304. def initialize
  2305. super(0, 0, window_width, window_height)
  2306. self.openness = 0
  2307. @party = $game_party.battle_members.clone
  2308. end
  2309.  
  2310. #--------------------------------------------------------------------------
  2311. # overwrite method: col_max
  2312. #--------------------------------------------------------------------------
  2313. def col_max; return $game_party.max_battle_members; end
  2314.  
  2315. #--------------------------------------------------------------------------
  2316. # new method: battle_members
  2317. #--------------------------------------------------------------------------
  2318. def battle_members; return $game_party.battle_members; end
  2319.  
  2320. #--------------------------------------------------------------------------
  2321. # new method: actor
  2322. #--------------------------------------------------------------------------
  2323. def actor; return battle_members[@index]; end
  2324.  
  2325. #--------------------------------------------------------------------------
  2326. # overwrite method: update
  2327. #--------------------------------------------------------------------------
  2328. def update
  2329. super
  2330. return if @party == $game_party.battle_members
  2331. @party = $game_party.battle_members.clone
  2332. refresh
  2333. end
  2334.  
  2335. #--------------------------------------------------------------------------
  2336. # overwrite method: draw_item
  2337. #--------------------------------------------------------------------------
  2338. def draw_item(index)
  2339. return if index.nil?
  2340. clear_item(index)
  2341. actor = battle_members[index]
  2342. rect = item_rect(index)
  2343. return if actor.nil?
  2344. draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  2345. draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  2346. draw_actor_action(actor, rect.x, rect.y)
  2347. draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  2348. gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  2349. contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  2350. draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  2351. dw = rect.width/2-2
  2352. dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  2353. draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  2354. #dw = rect.width - rect.width/2 - 2
  2355. draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  2356.  
  2357. #dw = rect.width/2-2
  2358. #dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  2359. #draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  2360. #draw_actor_mp(actor, rect.x+2, line_height*3, dw)
  2361. #dw = rect.width - rect.width/2 - 2
  2362. #draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  2363.  
  2364.  
  2365. #dw = rect.width/2-2
  2366. #dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  2367. #draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  2368. #dw = rect.width - rect.width/2 - 2
  2369. #draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  2370. end
  2371. end
  2372.  
  2373. #--------------------------------------------------------------------------
  2374. # overwrite method: item_rect
  2375. #--------------------------------------------------------------------------
  2376. def item_rect(index)
  2377. rect = Rect.new
  2378. rect.width = contents.width / $game_party.max_battle_members
  2379. rect.height = contents.height
  2380. rect.x = index * rect.width
  2381. if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  2382. rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  2383. end
  2384. rect.y = 0
  2385. return rect
  2386. end
  2387.  
  2388. #--------------------------------------------------------------------------
  2389. # overwrite method: draw_face
  2390. #--------------------------------------------------------------------------
  2391. def draw_face(face_name, face_index, dx, dy, enabled = true)
  2392. bitmap = Cache.face(face_name)
  2393. fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  2394. fy = face_index / 4 * 96 + 2
  2395. fw = [item_rect(0).width - 4, 92].min
  2396. rect = Rect.new(fx, fy, fw, 92)
  2397. rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  2398. contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  2399. bitmap.dispose
  2400. end
  2401.  
  2402. #--------------------------------------------------------------------------
  2403. # overwrite method: draw_actor_name
  2404. #--------------------------------------------------------------------------
  2405. def draw_actor_name(actor, dx, dy, dw = 112)
  2406. reset_font_settings
  2407. contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  2408. change_color(hp_color(actor))
  2409. draw_text(dx+24, dy, dw-24, line_height, actor.name)
  2410. end
  2411.  
  2412. #--------------------------------------------------------------------------
  2413. # new method: draw_actor_action
  2414. #--------------------------------------------------------------------------
  2415. def draw_actor_action(actor, dx, dy)
  2416. draw_icon(action_icon(actor), dx, dy)
  2417. end
  2418.  
  2419. #--------------------------------------------------------------------------
  2420. # new method: action_icon
  2421. #--------------------------------------------------------------------------
  2422. def action_icon(actor)
  2423. return Icon.no_action if actor.current_action.nil?
  2424. return Icon.no_action if actor.current_action.item.nil?
  2425. return actor.current_action.item.icon_index
  2426. end
  2427.  
  2428. #--------------------------------------------------------------------------
  2429. # new method: draw_tp?
  2430. #--------------------------------------------------------------------------
  2431. def draw_tp?(actor)
  2432. return actor.draw_tp?
  2433. end
  2434.  
  2435. #--------------------------------------------------------------------------
  2436. # new method: draw_mp?
  2437. #--------------------------------------------------------------------------
  2438. def draw_mp?(actor)
  2439. return actor.draw_mp?
  2440. end
  2441.  
  2442. #--------------------------------------------------------------------------
  2443. # overwrite method: draw_current_and_max_values
  2444. #--------------------------------------------------------------------------
  2445. def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  2446. change_color(color1)
  2447. draw_text(dx, dy, dw, line_height, current.group, 2)
  2448. end
  2449.  
  2450. #--------------------------------------------------------------------------
  2451. # overwrite method: draw_actor_hp
  2452. #--------------------------------------------------------------------------
  2453. def draw_actor_hp(actor, dx, dy, width = 124)
  2454. draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  2455. change_color(system_color)
  2456. cy = (Font.default_size - contents.font.size) / 2 + 1
  2457. draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  2458. draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  2459. hp_color(actor), normal_color)
  2460. end
  2461.  
  2462. #--------------------------------------------------------------------------
  2463. # overwrite method: draw_actor_mp
  2464. #--------------------------------------------------------------------------
  2465. #def draw_actor_mp(actor, dx, dy, width = 124)
  2466. #draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  2467. #change_color(system_color)
  2468. #cy = (Font.default_size - contents.font.size) / 2 + 1
  2469. #draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  2470. #draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  2471. #mp_color(actor), normal_color)
  2472. #end
  2473.  
  2474. #def draw_actor_mp(actor, dx, dy, width = 124)
  2475. #draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  2476. #change_color(system_color)
  2477. #cy = (Font.default_size - contents.font.size) / 2 + 1
  2478. #draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  2479. #draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  2480. #mp_color(actor), normal_color)
  2481. #end
  2482. #--------------------------------------------------------------------------
  2483. # overwrite method: draw_actor_tp
  2484. #--------------------------------------------------------------------------
  2485. #def draw_actor_tp(actor, dx, dy, width = 124)
  2486. #draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  2487. #change_color(system_color)
  2488. #cy = (Font.default_size - contents.font.size) / 2 + 1
  2489. #draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  2490. #change_color(tp_color(actor))
  2491. #draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  2492. #end
  2493.  
  2494. #def draw_actor_tp(actor, dx, dy, width = 124)
  2495. #draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  2496. #change_color(system_color)
  2497. #y = (Font.default_size - contents.font.size) / 2 + 1
  2498. #raw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  2499. #change_color(tp_color(actor))
  2500. #draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  2501. #end
  2502.  
  2503. # Window_BattleStatus
  2504.  
  2505. #==============================================================================
  2506. # ! Window_BattleActor
  2507. #==============================================================================
  2508.  
  2509. class Window_BattleActor < Window_BattleStatus
  2510.  
  2511. #--------------------------------------------------------------------------
  2512. # overwrite method: show
  2513. #--------------------------------------------------------------------------
  2514. def show
  2515. create_flags
  2516. super
  2517. end
  2518.  
  2519. #--------------------------------------------------------------------------
  2520. # new method: create_flags
  2521. #--------------------------------------------------------------------------
  2522. def create_flags
  2523. set_select_flag(:any)
  2524. select(0)
  2525. return if $game_temp.battle_aid.nil?
  2526. if $game_temp.battle_aid.need_selection?
  2527. select(0)
  2528. set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  2529. elsif $game_temp.battle_aid.for_user?
  2530. battler = BattleManager.actor
  2531. id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  2532. select(id)
  2533. set_select_flag(:user)
  2534. elsif $game_temp.battle_aid.for_all?
  2535. select(0)
  2536. set_select_flag(:all)
  2537. set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  2538. elsif $game_temp.battle_aid.for_random?
  2539. select(0)
  2540. set_select_flag(:random) if $game_temp.battle_aid.for_random?
  2541. end
  2542. end
  2543.  
  2544. #--------------------------------------------------------------------------
  2545. # new method: set_flag
  2546. #--------------------------------------------------------------------------
  2547. def set_select_flag(flag)
  2548. @select_flag = flag
  2549. case @select_flag
  2550. when :all, :all_dead, :random
  2551. @cursor_all = true
  2552. else
  2553. @cursor_all = false
  2554. end
  2555. end
  2556.  
  2557. #--------------------------------------------------------------------------
  2558. # overwrite method: update_cursor
  2559. #--------------------------------------------------------------------------
  2560. def update_cursor
  2561. if @cursor_all
  2562. cursor_rect.set(0, 0, contents.width, contents.height)
  2563. self.top_row = 0
  2564. elsif @index < 0
  2565. cursor_rect.empty
  2566. else
  2567. ensure_cursor_visible
  2568. cursor_rect.set(item_rect(@index))
  2569. end
  2570. end
  2571.  
  2572. #--------------------------------------------------------------------------
  2573. # overwrite method: cursor_movable?
  2574. #--------------------------------------------------------------------------
  2575. def cursor_movable?
  2576. return false if @select_flag == :user
  2577. return super
  2578. end
  2579.  
  2580. #--------------------------------------------------------------------------
  2581. # overwrite method: current_item_enabled?
  2582. #--------------------------------------------------------------------------
  2583. def current_item_enabled?
  2584. return true if $game_temp.battle_aid.nil?
  2585. if $game_temp.battle_aid.need_selection?
  2586. member = $game_party.battle_members[@index]
  2587. return member.dead? if $game_temp.battle_aid.for_dead_friend?
  2588. elsif $game_temp.battle_aid.for_dead_friend?
  2589. for member in $game_party.battle_members
  2590. return true if member.dead?
  2591. end
  2592. return false
  2593. end
  2594. return true
  2595. end
  2596.  
  2597. end # Window_BattleActor
  2598.  
  2599. #==============================================================================
  2600. # ! Window_BattleStatusAid
  2601. #==============================================================================
  2602.  
  2603. class Window_BattleStatusAid < Window_BattleStatus
  2604.  
  2605. #--------------------------------------------------------------------------
  2606. # public instance variables
  2607. #--------------------------------------------------------------------------
  2608. attr_accessor :status_window
  2609.  
  2610. #--------------------------------------------------------------------------
  2611. # overwrite method: initialize
  2612. #--------------------------------------------------------------------------
  2613. def initialize
  2614. super
  2615. self.visible = false
  2616. self.openness = 255
  2617. end
  2618.  
  2619. #--------------------------------------------------------------------------
  2620. # overwrite method: window_width
  2621. #--------------------------------------------------------------------------
  2622. def window_width; return 128; end
  2623.  
  2624. #--------------------------------------------------------------------------
  2625. # overwrite method: show
  2626. #--------------------------------------------------------------------------
  2627. def show
  2628. super
  2629. refresh
  2630. end
  2631.  
  2632. #--------------------------------------------------------------------------
  2633. # overwrite method: refresh
  2634. #--------------------------------------------------------------------------
  2635. def refresh
  2636. contents.clear
  2637. return if @status_window.nil?
  2638. draw_item(@status_window.index)
  2639. end
  2640.  
  2641. #--------------------------------------------------------------------------
  2642. # overwrite method: item_rect
  2643. #--------------------------------------------------------------------------
  2644. def item_rect(index)
  2645. return Rect.new(0, 0, contents.width, contents.height)
  2646. end
  2647.  
  2648. end # Window_BattleStatusAid
  2649.  
  2650. #==============================================================================
  2651. # ! Window_BattleEnemy
  2652. #==============================================================================
  2653.  
  2654. class Window_BattleEnemy < Window_Selectable
  2655.  
  2656. #--------------------------------------------------------------------------
  2657. # overwrite method: initialize
  2658. #--------------------------------------------------------------------------
  2659. def initialize(info_viewport)
  2660. super(0, Graphics.height, window_width, fitting_height(1))
  2661. refresh
  2662. self.visible = false
  2663. @info_viewport = info_viewport
  2664. end
  2665.  
  2666. #--------------------------------------------------------------------------
  2667. # overwrite method: col_max
  2668. #--------------------------------------------------------------------------
  2669. def col_max; return item_max; end
  2670.  
  2671. #--------------------------------------------------------------------------
  2672. # overwrite method: show
  2673. #--------------------------------------------------------------------------
  2674. def show
  2675. create_flags
  2676. super
  2677. end
  2678.  
  2679. #--------------------------------------------------------------------------
  2680. # new method: create_flags
  2681. #--------------------------------------------------------------------------
  2682. def create_flags
  2683. set_select_flag(:any)
  2684. select(0)
  2685. return if $game_temp.battle_aid.nil?
  2686. if $game_temp.battle_aid.need_selection?
  2687. select(0)
  2688. elsif $game_temp.battle_aid.for_all?
  2689. select(0)
  2690. set_select_flag(:all)
  2691. elsif $game_temp.battle_aid.for_random?
  2692. select(0)
  2693. set_select_flag(:random)
  2694. end
  2695. end
  2696.  
  2697. #--------------------------------------------------------------------------
  2698. # new method: set_flag
  2699. #--------------------------------------------------------------------------
  2700. def set_select_flag(flag)
  2701. @select_flag = flag
  2702. case @select_flag
  2703. when :all, :random
  2704. @cursor_all = true
  2705. else
  2706. @cursor_all = false
  2707. end
  2708. end
  2709.  
  2710. #--------------------------------------------------------------------------
  2711. # new method: select_all?
  2712. #--------------------------------------------------------------------------
  2713. def select_all?
  2714. return true if @select_flag == :all
  2715. return true if @select_flag == :random
  2716. return false
  2717. end
  2718.  
  2719. #--------------------------------------------------------------------------
  2720. # overwrite method: update_cursor
  2721. #--------------------------------------------------------------------------
  2722. def update_cursor
  2723. if @cursor_all
  2724. cursor_rect.set(0, 0, contents.width, contents.height)
  2725. self.top_row = 0
  2726. elsif @index < 0
  2727. cursor_rect.empty
  2728. else
  2729. ensure_cursor_visible
  2730. cursor_rect.set(item_rect(@index))
  2731. end
  2732. end
  2733.  
  2734. #--------------------------------------------------------------------------
  2735. # overwrite method: cursor_movable?
  2736. #--------------------------------------------------------------------------
  2737. def cursor_movable?
  2738. return false if @select_flag == :user
  2739. return super
  2740. end
  2741.  
  2742. #--------------------------------------------------------------------------
  2743. # overwrite method: current_item_enabled?
  2744. #--------------------------------------------------------------------------
  2745. def current_item_enabled?
  2746. return true if $game_temp.battle_aid.nil?
  2747. if $game_temp.battle_aid.need_selection?
  2748. member = $game_party.battle_members[@index]
  2749. return member.dead? if $game_temp.battle_aid.for_dead_friend?
  2750. elsif $game_temp.battle_aid.for_dead_friend?
  2751. for member in $game_party.battle_members
  2752. return true if member.dead?
  2753. end
  2754. return false
  2755. end
  2756. return true
  2757. end
  2758.  
  2759. #--------------------------------------------------------------------------
  2760. # overwrite method: enemy
  2761. #--------------------------------------------------------------------------
  2762. def enemy; @data[index]; end
  2763.  
  2764. #--------------------------------------------------------------------------
  2765. # overwrite method: refresh
  2766. #--------------------------------------------------------------------------
  2767. def refresh
  2768. make_item_list
  2769. create_contents
  2770. draw_all_items
  2771. end
  2772.  
  2773. #--------------------------------------------------------------------------
  2774. # overwrite method: make_item_list
  2775. #--------------------------------------------------------------------------
  2776. def make_item_list
  2777. @data = $game_troop.alive_members
  2778. @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  2779. end
  2780.  
  2781. #--------------------------------------------------------------------------
  2782. # overwrite method: draw_item
  2783. #--------------------------------------------------------------------------
  2784. def draw_item(index); return; end
  2785.  
  2786. #--------------------------------------------------------------------------
  2787. # overwrite method: update
  2788. #--------------------------------------------------------------------------
  2789. def update
  2790. super
  2791. return unless active
  2792. enemy.sprite_effect_type = :whiten
  2793. return unless select_all?
  2794. for enemy in $game_troop.alive_members
  2795. enemy.sprite_effect_type = :whiten
  2796. end
  2797. end
  2798.  
  2799. end # Window_BattleEnemy
  2800.  
  2801. #==============================================================================
  2802. # ! Window_BattleHelp
  2803. #==============================================================================
  2804.  
  2805. class Window_BattleHelp < Window_Help
  2806.  
  2807. #--------------------------------------------------------------------------
  2808. # public instance variables
  2809. #--------------------------------------------------------------------------
  2810. attr_accessor :actor_window
  2811. attr_accessor :enemy_window
  2812.  
  2813. #--------------------------------------------------------------------------
  2814. # update
  2815. #--------------------------------------------------------------------------
  2816. def update
  2817. super
  2818. if !self.visible and @text != ""
  2819. @text = ""
  2820. return refresh
  2821. end
  2822. update_battler_name
  2823. end
  2824.  
  2825. #--------------------------------------------------------------------------
  2826. # update_battler_name
  2827. #--------------------------------------------------------------------------
  2828. def update_battler_name
  2829. return unless @actor_window.active || @enemy_window.active
  2830. if @actor_window.active
  2831. battler = $game_party.battle_members[@actor_window.index]
  2832. elsif @enemy_window.active
  2833. battler = @enemy_window.enemy
  2834. end
  2835. if special_display?
  2836. refresh_special_case(battler)
  2837. else
  2838. refresh_battler_name(battler) if battler_name(battler) != @text
  2839. end
  2840. end
  2841.  
  2842. #--------------------------------------------------------------------------
  2843. # battler_name
  2844. #--------------------------------------------------------------------------
  2845. def battler_name(battler)
  2846. text = battler.name.clone
  2847. return text
  2848. end
  2849.  
  2850. #--------------------------------------------------------------------------
  2851. # refresh_battler_name
  2852. #--------------------------------------------------------------------------
  2853. def refresh_battler_name(battler)
  2854. contents.clear
  2855. reset_font_settings
  2856. change_color(normal_color)
  2857. @text = battler_name(battler)
  2858. icons = battler.state_icons + battler.buff_icons
  2859. dy = icons.size <= 0 ? line_height / 2 : 0
  2860. draw_text(0, dy, contents.width, line_height, @text, 1)
  2861. dx = (contents.width - (icons.size * 24)) / 2
  2862. draw_actor_icons(battler, dx, line_height, contents.width)
  2863. end
  2864.  
  2865. #--------------------------------------------------------------------------
  2866. # special_display?
  2867. #--------------------------------------------------------------------------
  2868. def special_display?
  2869. return false if $game_temp.battle_aid.nil?
  2870. return false if $game_temp.battle_aid.for_user?
  2871. return !$game_temp.battle_aid.need_selection?
  2872. end
  2873.  
  2874. #--------------------------------------------------------------------------
  2875. # refresh_special_case
  2876. #--------------------------------------------------------------------------
  2877. def refresh_special_case(battler)
  2878. if $game_temp.battle_aid.for_opponent?
  2879. if $game_temp.battle_aid.for_all?
  2880. text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  2881. else
  2882. case $game_temp.battle_aid.number_of_targets
  2883. when 1
  2884. text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  2885. else
  2886. number = $game_temp.battle_aid.number_of_targets
  2887. text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  2888. end
  2889. end
  2890. else # $game_temp.battle_aid.for_friend?
  2891. if $game_temp.battle_aid.for_dead_friend?
  2892. text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  2893. elsif $game_temp.battle_aid.for_random?
  2894. case $game_temp.battle_aid.number_of_targets
  2895. when 1
  2896. text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  2897. else
  2898. number = $game_temp.battle_aid.number_of_targets
  2899. text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  2900. end
  2901. else
  2902. text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  2903. end
  2904. end
  2905. return if text == @text
  2906. @text = text
  2907. contents.clear
  2908. reset_font_settings
  2909. draw_text(0, 0, contents.width, line_height*2, @text, 1)
  2910. end
  2911.  
  2912. end # Window_BattleHelp
  2913.  
  2914. #==============================================================================
  2915. # ! Window_BattleLog
  2916. #==============================================================================
  2917.  
  2918. class Window_BattleLog < Window_Selectable
  2919.  
  2920. #--------------------------------------------------------------------------
  2921. # alias method: display_current_state
  2922. #--------------------------------------------------------------------------
  2923. alias window_battlelog_display_current_state_abe display_current_state
  2924. def display_current_state(subject)
  2925. subject.make_during_state_popup
  2926. return unless YEA::BATTLE::MSG_CURRENT_STATE
  2927. window_battlelog_display_current_state_abe(subject)
  2928. end
  2929.  
  2930. #--------------------------------------------------------------------------
  2931. # alias method: display_use_item
  2932. #--------------------------------------------------------------------------
  2933. alias window_battlelog_display_use_item_abe display_use_item
  2934. def display_use_item(subject, item)
  2935. return unless YEA::BATTLE::MSG_CURRENT_ACTION
  2936. window_battlelog_display_use_item_abe(subject, item)
  2937. end
  2938.  
  2939. #--------------------------------------------------------------------------
  2940. # alias method: display_counter
  2941. #--------------------------------------------------------------------------
  2942. alias window_battlelog_display_counter_abe display_counter
  2943. def display_counter(target, item)
  2944. if YEA::BATTLE::MSG_COUNTERATTACK
  2945. window_battlelog_display_counter_abe(target, item)
  2946. else
  2947. Sound.play_evasion
  2948. end
  2949. end
  2950.  
  2951. #--------------------------------------------------------------------------
  2952. # alias method: display_reflection
  2953. #--------------------------------------------------------------------------
  2954. alias window_battlelog_display_reflection_abe display_reflection
  2955. def display_reflection(target, item)
  2956. if YEA::BATTLE::MSG_REFLECT_MAGIC
  2957. window_battlelog_display_reflection_abe(target, item)
  2958. else
  2959. Sound.play_reflection
  2960. end
  2961. end
  2962.  
  2963. #--------------------------------------------------------------------------
  2964. # alias method: display_substitute
  2965. #--------------------------------------------------------------------------
  2966. alias window_battlelog_display_substitute_abe display_substitute
  2967. def display_substitute(substitute, target)
  2968. return unless YEA::BATTLE::MSG_SUBSTITUTE_HIT
  2969. window_battlelog_display_substitute_abe(substitute, target)
  2970. end
  2971.  
  2972. #--------------------------------------------------------------------------
  2973. # alias method: display_failure
  2974. #--------------------------------------------------------------------------
  2975. alias window_battlelog_display_failure_abe display_failure
  2976. def display_failure(target, item)
  2977. return unless YEA::BATTLE::MSG_FAILURE_HIT
  2978. window_battlelog_display_failure_abe(target, item)
  2979. end
  2980.  
  2981. #--------------------------------------------------------------------------
  2982. # alias method: display_critical
  2983. #--------------------------------------------------------------------------
  2984. alias window_battlelog_display_critical_abe display_critical
  2985. def display_critical(target, item)
  2986. return unless YEA::BATTLE::MSG_CRITICAL_HIT
  2987. window_battlelog_display_critical_abe(target, item)
  2988. end
  2989.  
  2990. #--------------------------------------------------------------------------
  2991. # alias method: display_miss
  2992. #--------------------------------------------------------------------------
  2993. alias window_battlelog_display_miss_abe display_miss
  2994. def display_miss(target, item)
  2995. return unless YEA::BATTLE::MSG_HIT_MISSED
  2996. window_battlelog_display_miss_abe(target, item)
  2997. end
  2998.  
  2999. #--------------------------------------------------------------------------
  3000. # alias method: display_evasion
  3001. #--------------------------------------------------------------------------
  3002. alias window_battlelog_display_evasion_abe display_evasion
  3003. def display_evasion(target, item)
  3004. if YEA::BATTLE::MSG_EVASION
  3005. window_battlelog_display_evasion_abe(target, item)
  3006. else
  3007. if !item || item.physical?
  3008. Sound.play_evasion
  3009. else
  3010. Sound.play_magic_evasion
  3011. end
  3012. end
  3013. end
  3014.  
  3015. #--------------------------------------------------------------------------
  3016. # overwrite method: display_hp_damage
  3017. #--------------------------------------------------------------------------
  3018. def display_hp_damage(target, item)
  3019. return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  3020. if target.result.hp_damage > 0 && target.result.hp_drain == 0
  3021. target.perform_damage_effect
  3022. end
  3023. Sound.play_recovery if target.result.hp_damage < 0
  3024. return unless YEA::BATTLE::MSG_HP_DAMAGE
  3025. add_text(target.result.hp_damage_text)
  3026. wait
  3027. end
  3028.  
  3029. #--------------------------------------------------------------------------
  3030. # overwrite method: display_mp_damage
  3031. #--------------------------------------------------------------------------
  3032. def display_mp_damage(target, item)
  3033. return if target.dead? || target.result.mp_damage == 0
  3034. Sound.play_recovery if target.result.mp_damage < 0
  3035. return unless YEA::BATTLE::MSG_MP_DAMAGE
  3036. add_text(target.result.mp_damage_text)
  3037. wait
  3038. end
  3039.  
  3040. #--------------------------------------------------------------------------
  3041. # overwrite method: display_tp_damage
  3042. #--------------------------------------------------------------------------
  3043. def display_tp_damage(target, item)
  3044. return if target.dead? || target.result.tp_damage == 0
  3045. Sound.play_recovery if target.result.tp_damage < 0
  3046. return unless YEA::BATTLE::MSG_TP_DAMAGE
  3047. add_text(target.result.tp_damage_text)
  3048. wait
  3049. end
  3050.  
  3051. #--------------------------------------------------------------------------
  3052. # alias method: display_added_states
  3053. #--------------------------------------------------------------------------
  3054. alias window_battlelog_display_added_states_abe display_added_states
  3055. def display_added_states(target)
  3056. return unless YEA::BATTLE::MSG_ADDED_STATES
  3057. window_battlelog_display_added_states_abe(target)
  3058. end
  3059.  
  3060. #--------------------------------------------------------------------------
  3061. # alias method: display_removed_states
  3062. #--------------------------------------------------------------------------
  3063. alias window_battlelog_display_removed_states_abe display_removed_states
  3064. def display_removed_states(target)
  3065. return unless YEA::BATTLE::MSG_REMOVED_STATES
  3066. window_battlelog_display_removed_states_abe(target)
  3067. end
  3068.  
  3069. #--------------------------------------------------------------------------
  3070. # alias method: display_changed_buffs
  3071. #--------------------------------------------------------------------------
  3072. alias window_battlelog_display_changed_buffs_abe display_changed_buffs
  3073. def display_changed_buffs(target)
  3074. return unless YEA::BATTLE::MSG_CHANGED_BUFFS
  3075. window_battlelog_display_changed_buffs_abe(target)
  3076. end
  3077.  
  3078. end # Window_BattleLog
  3079.  
  3080. #==============================================================================
  3081. # ! Window_SkillList
  3082. #==============================================================================
  3083.  
  3084. class Window_SkillList < Window_Selectable
  3085.  
  3086. #--------------------------------------------------------------------------
  3087. # overwrite method: spacing
  3088. #--------------------------------------------------------------------------
  3089. def spacing
  3090. return 8 if $game_party.in_battle
  3091. return super
  3092. end
  3093.  
  3094. end # Window_SkillList
  3095.  
  3096. #==============================================================================
  3097. # ! Window_ItemList
  3098. #==============================================================================
  3099.  
  3100. class Window_ItemList < Window_Selectable
  3101.  
  3102. #--------------------------------------------------------------------------
  3103. # overwrite method: spacing
  3104. #--------------------------------------------------------------------------
  3105. def spacing
  3106. return 8 if $game_party.in_battle
  3107. return super
  3108. end
  3109.  
  3110. end # Window_ItemList
  3111.  
  3112. #==============================================================================
  3113. # ! Scene_Battle
  3114. #==============================================================================
  3115.  
  3116. class Scene_Battle < Scene_Base
  3117.  
  3118. #--------------------------------------------------------------------------
  3119. # public instance variables
  3120. #--------------------------------------------------------------------------
  3121. attr_accessor :enemy_window
  3122. attr_accessor :info_viewport
  3123. attr_accessor :spriteset
  3124. attr_accessor :status_window
  3125. attr_accessor :status_aid_window
  3126. attr_accessor :subject
  3127.  
  3128. #--------------------------------------------------------------------------
  3129. # alias method: create_spriteset
  3130. #--------------------------------------------------------------------------
  3131. alias scene_battle_create_spriteset_abe create_spriteset
  3132. def create_spriteset
  3133. BattleManager.init_battle_type
  3134. scene_battle_create_spriteset_abe
  3135. end
  3136.  
  3137. #--------------------------------------------------------------------------
  3138. # alias method: update_basic
  3139. #--------------------------------------------------------------------------
  3140. alias scene_battle_update_basic_abe update_basic
  3141. def update_basic
  3142. scene_battle_update_basic_abe
  3143. update_debug
  3144. end
  3145.  
  3146. #--------------------------------------------------------------------------
  3147. # new method: update_debug
  3148. #--------------------------------------------------------------------------
  3149. def update_debug
  3150. return unless $TEST || $BTEST
  3151. debug_heal_party if Input.trigger?(:F5)
  3152. debug_damage_party if Input.trigger?(:F6)
  3153. debug_fill_tp if Input.trigger?(:F7)
  3154. debug_kill_all if Input.trigger?(:F8)
  3155. end
  3156.  
  3157. #--------------------------------------------------------------------------
  3158. # new method: debug_heal_party
  3159. #--------------------------------------------------------------------------
  3160. def debug_heal_party
  3161. Sound.play_recovery
  3162. for member in $game_party.battle_members
  3163. member.recover_all
  3164. end
  3165. @status_window.refresh
  3166. end
  3167.  
  3168. #--------------------------------------------------------------------------
  3169. # new method: debug_damage_party
  3170. #--------------------------------------------------------------------------
  3171. def debug_damage_party
  3172. Sound.play_actor_damage
  3173. for member in $game_party.alive_members
  3174. member.hp = 1
  3175. member.mp = 0
  3176. member.tp = 0
  3177. end
  3178. @status_window.refresh
  3179. end
  3180.  
  3181. #--------------------------------------------------------------------------
  3182. # new method: debug_fill_tp
  3183. #--------------------------------------------------------------------------
  3184. def debug_fill_tp
  3185. Sound.play_recovery
  3186. for member in $game_party.alive_members
  3187. member.tp = member.max_tp
  3188. end
  3189. @status_window.refresh
  3190. end
  3191.  
  3192. #--------------------------------------------------------------------------
  3193. # new method: debug_kill_all
  3194. #--------------------------------------------------------------------------
  3195. def debug_kill_all
  3196. for enemy in $game_troop.alive_members
  3197. enemy.hp = 0
  3198. enemy.perform_collapse_effect
  3199. end
  3200. BattleManager.judge_win_loss
  3201. @log_window.wait
  3202. @log_window.wait_for_effect
  3203. end
  3204.  
  3205. #--------------------------------------------------------------------------
  3206. # alias method: create_all_windows
  3207. #--------------------------------------------------------------------------
  3208. alias scene_battle_create_all_windows_abe create_all_windows
  3209. def create_all_windows
  3210. scene_battle_create_all_windows_abe
  3211. create_battle_status_aid_window
  3212. set_help_window
  3213. end
  3214.  
  3215. #--------------------------------------------------------------------------
  3216. # alias method: create_info_viewport
  3217. #--------------------------------------------------------------------------
  3218. alias scene_battle_create_info_viewport_abe create_info_viewport
  3219. def create_info_viewport
  3220. scene_battle_create_info_viewport_abe
  3221. @status_window.refresh
  3222. end
  3223.  
  3224. #--------------------------------------------------------------------------
  3225. # new method: create_battle_status_aid_window
  3226. #--------------------------------------------------------------------------
  3227. def create_battle_status_aid_window
  3228. @status_aid_window = Window_BattleStatusAid.new
  3229. @status_aid_window.status_window = @status_window
  3230. @status_aid_window.x = Graphics.width - @status_aid_window.width
  3231. @status_aid_window.y = Graphics.height - @status_aid_window.height
  3232. end
  3233.  
  3234. #--------------------------------------------------------------------------
  3235. # overwrite method: create_help_window
  3236. #--------------------------------------------------------------------------
  3237. def create_help_window
  3238. @help_window = Window_BattleHelp.new
  3239. @help_window.hide
  3240. end
  3241.  
  3242. #--------------------------------------------------------------------------
  3243. # new method: set_help_window
  3244. #--------------------------------------------------------------------------
  3245. def set_help_window
  3246. @help_window.actor_window = @actor_window
  3247. @help_window.enemy_window = @enemy_window
  3248. end
  3249.  
  3250. #--------------------------------------------------------------------------
  3251. # alias method: create_party_command_window
  3252. #--------------------------------------------------------------------------
  3253. alias scene_battle_create_party_command_window_abe create_party_command_window
  3254. def create_party_command_window
  3255. scene_battle_create_party_command_window_abe
  3256. @party_command_window.set_handler(:dir6, method(:command_fight))
  3257. end
  3258.  
  3259. #--------------------------------------------------------------------------
  3260. # alias method: create_actor_command_window
  3261. #--------------------------------------------------------------------------
  3262. alias scene_battle_create_actor_command_window_abe create_actor_command_window
  3263. def create_actor_command_window
  3264. scene_battle_create_actor_command_window_abe
  3265. @actor_command_window.set_handler(:dir4, method(:prior_command))
  3266. @actor_command_window.set_handler(:dir6, method(:next_command))
  3267. end
  3268.  
  3269. #--------------------------------------------------------------------------
  3270. # alias method: create_skill_window
  3271. #--------------------------------------------------------------------------
  3272. alias scene_battle_create_skill_window_abe create_skill_window
  3273. def create_skill_window
  3274. scene_battle_create_skill_window_abe
  3275. @skill_window.height = @info_viewport.rect.height
  3276. @skill_window.width = Graphics.width - @actor_command_window.width
  3277. @skill_window.y = Graphics.height - @skill_window.height
  3278. end
  3279.  
  3280. #--------------------------------------------------------------------------
  3281. # alias method: create_item_window
  3282. #--------------------------------------------------------------------------
  3283. alias scene_battle_create_item_window_abe create_item_window
  3284. def create_item_window
  3285. scene_battle_create_item_window_abe
  3286. @item_window.height = @skill_window.height
  3287. @item_window.width = @skill_window.width
  3288. @item_window.y = Graphics.height - @item_window.height
  3289. end
  3290.  
  3291. #--------------------------------------------------------------------------
  3292. # alias method: show_fast?
  3293. #--------------------------------------------------------------------------
  3294. alias scene_battle_show_fast_abe show_fast?
  3295. def show_fast?
  3296. return true if YEA::BATTLE::AUTO_FAST
  3297. return scene_battle_show_fast_abe
  3298. end
  3299.  
  3300. #--------------------------------------------------------------------------
  3301. # alias method: next_command
  3302. #--------------------------------------------------------------------------
  3303. alias scene_battle_next_command_abe next_command
  3304. def next_command
  3305. @status_window.show
  3306. redraw_current_status
  3307. @actor_command_window.show
  3308. @status_aid_window.hide
  3309. scene_battle_next_command_abe
  3310. end
  3311.  
  3312. #--------------------------------------------------------------------------
  3313. # alias method: prior_command
  3314. #--------------------------------------------------------------------------
  3315. alias scene_battle_prior_command_abe prior_command
  3316. def prior_command
  3317. redraw_current_status
  3318. scene_battle_prior_command_abe
  3319. end
  3320.  
  3321. #--------------------------------------------------------------------------
  3322. # new method: redraw_current_status
  3323. #--------------------------------------------------------------------------
  3324. def redraw_current_status
  3325. return if @status_window.index < 0
  3326. @status_window.draw_item(@status_window.index)
  3327. end
  3328.  
  3329. #--------------------------------------------------------------------------
  3330. # alias method: command_attack
  3331. #--------------------------------------------------------------------------
  3332. alias scene_battle_command_attack_abe command_attack
  3333. def command_attack
  3334. $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  3335. scene_battle_command_attack_abe
  3336. end
  3337.  
  3338. #--------------------------------------------------------------------------
  3339. # alias method: command_skill
  3340. #--------------------------------------------------------------------------
  3341. alias scene_battle_command_skill_abe command_skill
  3342. def command_skill
  3343. scene_battle_command_skill_abe
  3344. @status_window.hide
  3345. @actor_command_window.hide
  3346. @status_aid_window.show
  3347. end
  3348.  
  3349. #--------------------------------------------------------------------------
  3350. # alias method: command_item
  3351. #--------------------------------------------------------------------------
  3352. alias scene_battle_command_item_abe command_item
  3353. def command_item
  3354. scene_battle_command_item_abe
  3355. @status_window.hide
  3356. @actor_command_window.hide
  3357. @status_aid_window.show
  3358. end
  3359.  
  3360. #--------------------------------------------------------------------------
  3361. # overwrite method: on_skill_ok
  3362. #--------------------------------------------------------------------------
  3363. def on_skill_ok
  3364. @skill = @skill_window.item
  3365. $game_temp.battle_aid = @skill
  3366. BattleManager.actor.input.set_skill(@skill.id)
  3367. BattleManager.actor.last_skill.object = @skill
  3368. if @skill.for_opponent?
  3369. select_enemy_selection
  3370. elsif @skill.for_friend?
  3371. select_actor_selection
  3372. else
  3373. @skill_window.hide
  3374. next_command
  3375. $game_temp.battle_aid = nil
  3376. end
  3377. end
  3378.  
  3379. #--------------------------------------------------------------------------
  3380. # alias method: on_skill_cancel
  3381. #--------------------------------------------------------------------------
  3382. alias scene_battle_on_skill_cancel_abe on_skill_cancel
  3383. def on_skill_cancel
  3384. scene_battle_on_skill_cancel_abe
  3385. @status_window.show
  3386. @actor_command_window.show
  3387. @status_aid_window.hide
  3388. end
  3389.  
  3390. #--------------------------------------------------------------------------
  3391. # overwrite method: on_item_ok
  3392. #--------------------------------------------------------------------------
  3393. def on_item_ok
  3394. @item = @item_window.item
  3395. $game_temp.battle_aid = @item
  3396. BattleManager.actor.input.set_item(@item.id)
  3397. if @item.for_opponent?
  3398. select_enemy_selection
  3399. elsif @item.for_friend?
  3400. select_actor_selection
  3401. else
  3402. @item_window.hide
  3403. next_command
  3404. $game_temp.battle_aid = nil
  3405. end
  3406. $game_party.last_item.object = @item
  3407. end
  3408.  
  3409. #--------------------------------------------------------------------------
  3410. # alias method: on_item_cancel
  3411. #--------------------------------------------------------------------------
  3412. alias scene_battle_on_item_cancel_abe on_item_cancel
  3413. def on_item_cancel
  3414. scene_battle_on_item_cancel_abe
  3415. @status_window.show
  3416. @actor_command_window.show
  3417. @status_aid_window.hide
  3418. end
  3419.  
  3420. #--------------------------------------------------------------------------
  3421. # alias method: select_actor_selection
  3422. #--------------------------------------------------------------------------
  3423. alias scene_battle_select_actor_selection_abe select_actor_selection
  3424. def select_actor_selection
  3425. @status_aid_window.refresh
  3426. scene_battle_select_actor_selection_abe
  3427. @status_window.hide
  3428. @skill_window.hide
  3429. @item_window.hide
  3430. @help_window.show
  3431. end
  3432.  
  3433. #--------------------------------------------------------------------------
  3434. # alias method: on_actor_ok
  3435. #--------------------------------------------------------------------------
  3436. alias scene_battle_on_actor_ok_abe on_actor_ok
  3437. def on_actor_ok
  3438. $game_temp.battle_aid = nil
  3439. scene_battle_on_actor_ok_abe
  3440. @status_window.show
  3441. if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  3442. @actor_command_window.visible = !@confirm_command_window.visible
  3443. else
  3444. @actor_command_window.show
  3445. end
  3446. @status_aid_window.hide
  3447. end
  3448.  
  3449. #--------------------------------------------------------------------------
  3450. # alias method: on_actor_cancel
  3451. #--------------------------------------------------------------------------
  3452. alias scene_battle_on_actor_cancel_abe on_actor_cancel
  3453. def on_actor_cancel
  3454. BattleManager.actor.input.clear
  3455. @status_aid_window.refresh
  3456. $game_temp.battle_aid = nil
  3457. scene_battle_on_actor_cancel_abe
  3458. case @actor_command_window.current_symbol
  3459. when :skill
  3460. @skill_window.show
  3461. when :item
  3462. @item_window.show
  3463. end
  3464. end
  3465.  
  3466. #--------------------------------------------------------------------------
  3467. # alias method: select_enemy_selection
  3468. #--------------------------------------------------------------------------
  3469. alias scene_battle_select_enemy_selection_abe select_enemy_selection
  3470. def select_enemy_selection
  3471. @status_aid_window.refresh
  3472. scene_battle_select_enemy_selection_abe
  3473. @help_window.show
  3474. end
  3475. #--------------------------------------------------------------------------
  3476. # alias method: on_enemy_ok
  3477. #--------------------------------------------------------------------------
  3478. alias scene_battle_on_enemy_ok_abe on_enemy_ok
  3479. def on_enemy_ok
  3480. $game_temp.battle_aid = nil
  3481. scene_battle_on_enemy_ok_abe
  3482. end
  3483.  
  3484. #--------------------------------------------------------------------------
  3485. # alias method: on_enemy_cancel
  3486. #--------------------------------------------------------------------------
  3487. alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  3488. def on_enemy_cancel
  3489. BattleManager.actor.input.clear
  3490. @status_aid_window.refresh
  3491. $game_temp.battle_aid = nil
  3492. scene_battle_on_enemy_cancel_abe
  3493. if @skill_window.visible || @item_window.visible
  3494. @help_window.show
  3495. else
  3496. @help_window.hide
  3497. end
  3498. end
  3499.  
  3500. #--------------------------------------------------------------------------
  3501. # alias method: battle_start
  3502. #--------------------------------------------------------------------------
  3503. alias scene_battle_battle_start_abe battle_start
  3504. def battle_start
  3505. scene_battle_battle_start_abe
  3506. return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  3507. @party_command_window.deactivate
  3508. if BattleManager.input_start
  3509. command_fight
  3510. else
  3511. turn_start
  3512. end
  3513. end
  3514.  
  3515. #--------------------------------------------------------------------------
  3516. # overwrite method: turn_end
  3517. #--------------------------------------------------------------------------
  3518. def turn_end
  3519. all_battle_members.each do |battler|
  3520. battler.on_turn_end
  3521. status_redraw_target(battler)
  3522. @log_window.display_auto_affected_status(battler)
  3523. @log_window.wait_and_clear
  3524. end
  3525. update_party_cooldowns if $imported["YEA-CommandParty"]
  3526. BattleManager.turn_end
  3527. process_event
  3528. start_party_command_selection
  3529. return if end_battle_conditions?
  3530. return unless YEA::BATTLE::SKIP_PARTY_COMMAND
  3531. if BattleManager.input_start
  3532. @party_command_window.deactivate
  3533. command_fight
  3534. else
  3535. @party_command_window.deactivate
  3536. turn_start
  3537. end
  3538. end
  3539.  
  3540. #--------------------------------------------------------------------------
  3541. # new method: end_battle_conditions?
  3542. #--------------------------------------------------------------------------
  3543. def end_battle_conditions?
  3544. return true if $game_party.members.empty?
  3545. return true if $game_party.all_dead?
  3546. return true if $game_troop.all_dead?
  3547. return true if BattleManager.aborting?
  3548. return false
  3549. end
  3550.  
  3551. #--------------------------------------------------------------------------
  3552. # overwrite method: execute_action
  3553. #--------------------------------------------------------------------------
  3554. def execute_action
  3555. @subject.sprite_effect_type = :whiten if YEA::BATTLE::FLASH_WHITE_EFFECT
  3556. use_item
  3557. @log_window.wait_and_clear
  3558. end
  3559.  
  3560. #--------------------------------------------------------------------------
  3561. # overwrite method: apply_item_effects
  3562. #--------------------------------------------------------------------------
  3563. def apply_item_effects(target, item)
  3564. if $imported["YEA-LunaticObjects"]
  3565. lunatic_object_effect(:prepare, item, @subject, target)
  3566. end
  3567. target.item_apply(@subject, item)
  3568. status_redraw_target(@subject)
  3569. status_redraw_target(target) unless target == @subject
  3570. @log_window.display_action_results(target, item)
  3571. if $imported["YEA-LunaticObjects"]
  3572. lunatic_object_effect(:during, item, @subject, target)
  3573. end
  3574. perform_collapse_check(target)
  3575. end
  3576.  
  3577. #--------------------------------------------------------------------------
  3578. # overwite method: invoke_counter_attack
  3579. #--------------------------------------------------------------------------
  3580. def invoke_counter_attack(target, item)
  3581. @log_window.display_counter(target, item)
  3582. attack_skill = $data_skills[target.attack_skill_id]
  3583. @subject.item_apply(target, attack_skill)
  3584. status_redraw_target(@subject)
  3585. status_redraw_target(target) unless target == @subject
  3586. @log_window.display_action_results(@subject, attack_skill)
  3587. perform_collapse_check(target)
  3588. perform_collapse_check(@subject)
  3589. end
  3590.  
  3591. #--------------------------------------------------------------------------
  3592. # new method: perform_collapse_check
  3593. #--------------------------------------------------------------------------
  3594. def perform_collapse_check(target)
  3595. return if YEA::BATTLE::MSG_ADDED_STATES
  3596. target.perform_collapse_effect if target.can_collapse?
  3597. @log_window.wait
  3598. @log_window.wait_for_effect
  3599. end
  3600.  
  3601. #--------------------------------------------------------------------------
  3602. # overwrite method: show_attack_animation
  3603. #--------------------------------------------------------------------------
  3604. def show_attack_animation(targets)
  3605. show_normal_animation(targets, @subject.atk_animation_id1, false)
  3606. wait_for_animation
  3607. show_normal_animation(targets, @subject.atk_animation_id2, true)
  3608. end
  3609.  
  3610. #--------------------------------------------------------------------------
  3611. # overwrite method: show_normal_animation
  3612. #--------------------------------------------------------------------------
  3613. def show_normal_animation(targets, animation_id, mirror = false)
  3614. animation = $data_animations[animation_id]
  3615. return if animation.nil?
  3616. ani_check = false
  3617. targets.each do |target|
  3618. if ani_check && target.animation_id <= 0
  3619. target.pseudo_ani_id = animation_id
  3620. else
  3621. target.animation_id = animation_id
  3622. end
  3623. target.animation_mirror = mirror
  3624. ani_check = true if animation.to_screen?
  3625. end
  3626. end
  3627.  
  3628. #--------------------------------------------------------------------------
  3629. # overwrite method: process_action_end
  3630. #--------------------------------------------------------------------------
  3631. def process_action_end
  3632. @subject.on_action_end
  3633. status_redraw_target(@subject)
  3634. @log_window.display_auto_affected_status(@subject)
  3635. @log_window.wait_and_clear
  3636. @log_window.display_current_state(@subject)
  3637. @log_window.wait_and_clear
  3638. BattleManager.judge_win_loss
  3639. end
  3640.  
  3641. #--------------------------------------------------------------------------
  3642. # overwrite method: use_item
  3643. #--------------------------------------------------------------------------
  3644. def use_item
  3645. item = @subject.current_action.item
  3646. @log_window.display_use_item(@subject, item)
  3647. @subject.use_item(item)
  3648. status_redraw_target(@subject)
  3649. if $imported["YEA-LunaticObjects"]
  3650. lunatic_object_effect(:before, item, @subject, @subject)
  3651. end
  3652. process_casting_animation if $imported["YEA-CastAnimations"]
  3653. targets = @subject.current_action.make_targets.compact rescue []
  3654. show_animation(targets, item.animation_id) if show_all_animation?(item)
  3655. targets.each {|target|
  3656. if $imported["YEA-TargetManager"]
  3657. target = alive_random_target(target, item) if item.for_random?
  3658. end
  3659. item.repeats.times { invoke_item(target, item) } }
  3660. if $imported["YEA-LunaticObjects"]
  3661. lunatic_object_effect(:after, item, @subject, @subject)
  3662. end
  3663. end
  3664.  
  3665. #--------------------------------------------------------------------------
  3666. # alias method: invoke_item
  3667. #--------------------------------------------------------------------------
  3668. alias scene_battle_invoke_item_abe invoke_item
  3669. def invoke_item(target, item)
  3670. show_animation([target], item.animation_id) if separate_ani?(target, item)
  3671. if target.dead? != item.for_dead_friend?
  3672. @subject.last_target_index = target.index
  3673. return
  3674. end
  3675. scene_battle_invoke_item_abe(target, item)
  3676. end
  3677.  
  3678. #--------------------------------------------------------------------------
  3679. # new method: show_all_animation?
  3680. #--------------------------------------------------------------------------
  3681. def show_all_animation?(item)
  3682. return true if item.one_animation
  3683. return false if $data_animations[item.animation_id].nil?
  3684. return false unless $data_animations[item.animation_id].to_screen?
  3685. return true
  3686. end
  3687.  
  3688. #--------------------------------------------------------------------------
  3689. # new method: separate_ani?
  3690. #--------------------------------------------------------------------------
  3691. def separate_ani?(target, item)
  3692. return false if item.one_animation
  3693. return false if $data_animations[item.animation_id].nil?
  3694. return false if $data_animations[item.animation_id].to_screen?
  3695. return target.dead? == item.for_dead_friend?
  3696. end
  3697.  
  3698. #--------------------------------------------------------------------------
  3699. # new method: status_redraw_target
  3700. #--------------------------------------------------------------------------
  3701. def status_redraw_target(target)
  3702. return unless target.actor?
  3703. @status_window.draw_item($game_party.battle_members.index(target))
  3704. end
  3705.  
  3706. #--------------------------------------------------------------------------
  3707. # alias method: start_party_command_selection
  3708. #--------------------------------------------------------------------------
  3709. alias start_party_command_selection_abe start_party_command_selection
  3710. def start_party_command_selection
  3711. @status_window.refresh unless scene_changing?
  3712. start_party_command_selection_abe
  3713. end
  3714.  
  3715. #--------------------------------------------------------------------------
  3716. # overwrite method: refresh_status
  3717. #--------------------------------------------------------------------------
  3718. def refresh_status; return; end
  3719.  
  3720. #--------------------------------------------------------------------------
  3721. # new method: refresh_autobattler_status_window
  3722. #--------------------------------------------------------------------------
  3723. def refresh_autobattler_status_window
  3724. for member in $game_party.battle_members
  3725. next unless member.auto_battle?
  3726. @status_window.draw_item(member.index)
  3727. end
  3728. end
  3729.  
  3730. #--------------------------------------------------------------------------
  3731. # new method: hide_extra_gauges
  3732. #--------------------------------------------------------------------------
  3733. def hide_extra_gauges
  3734. # Made for compatibility
  3735. end
  3736.  
  3737. #--------------------------------------------------------------------------
  3738. # new method: show_extra_gauges
  3739. #--------------------------------------------------------------------------
  3740. def show_extra_gauges
  3741. # Made for compatibility
  3742. end
  3743.  
  3744. end # Scene_Battle
  3745.  
  3746. #==============================================================================
  3747. #
  3748. # Y End of File
  3749. #
  3750. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement