LiTTleDRAgo

[RGSS] Tons of Addons Part 1 (edited)

Sep 24th, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 145.23 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2. # Tons of Add-ons by Blizzard
  3. # Version: 7.65b
  4. # Type: Add-on Collection Control Script
  5. # Date v1.00b:  14.11.2006
  6. # Date v1.10b:  17.11.2006
  7. # Date v1.60b:   4.12.2006
  8. # Date v1.62b:   6.12.2006
  9. # Date v1.70b:  13.12.2006
  10. # Date v1.87b:  12.01.2007
  11. # Date v2.20b:  16.01.2007
  12. # Date v2.30b:  22.01.2007
  13. # Date v2.31b:  24.01.2007
  14. # Date v2.40b:   1.02.2007
  15. # Date v2.50b:   4.02.2007
  16. # Date v2.70b:   7.02.2007
  17. # Date v2.71b:  12.02.2007
  18. # Date v2.80b:  17.02.2007
  19. # Date v3.70b:  19.02.2007
  20. # Date v3.71b:  23.02.2007
  21. # Date v3.80b:   7.03.2007
  22. # Date v4.00b:   7.03.2007
  23. # Date v4.01b:   9.03.2007
  24. # Date v4.02b:  11.03.2007
  25. # Date v4.30b:  12.03.2007
  26. # Date v4.32b:  18.03.2007
  27. # Date v4.50b:  24.03.2007
  28. # Date v4.70b:  30.04.2007
  29. # Date v4.80b:   4.05.2007
  30. # Date v4.81b:   8.05.2007
  31. # Date v4.85b:   7.07.2007
  32. # Date v4.86b:   8.08.2007
  33. # Date v4.90b:  12.07.2007
  34. # Date v4.91b:  14.07.2007
  35. # Date v4.97b:  31.07.2007
  36. # Date v4.98b:   7.08.2007
  37. # Date v5.40b:  20.10.2007
  38. # Date v5.80b:  22.10.2007
  39. # Date v5.81b:  23.10.2007
  40. # Date v5.83b:  25.10.2007
  41. # Date v5.90b:  28.10.2007
  42. # Date v5.91b:   5.11.2007
  43. # Date v5.98b:  13.11.2007
  44. # Date v5.99b:  19.11.2007
  45. # Date v6.00b:   7.12.2007
  46. # Date v6.02b:  10.12.2007
  47. # Date v6.03b:  28.01.2008
  48. # Date v6.10b:  19.02.2008
  49. # Date v6.11b:  20.02.2008
  50. # Date v6.12b:  22.02.2008
  51. # Date v6.13b:  23.02.2008
  52. # Date v6.20b:  26.03.2008
  53. # Date v6.40b:   3.04.2008
  54. # Date v6.50b:  13.07.2008
  55. # Date v6.51b:  21.07.2008
  56. # Date v6.54b:  23.07.2008
  57. # Date v6.56b:  22.08.2008
  58. # Date v6.58b:   5.09.2008
  59. # Date v6.59b:   5.09.2008
  60. # Date v6.60b:  19.10.2008
  61. # Date v6.61b:  25.10.2008
  62. # Date v6.70b:  29.10.2008
  63. # Date v6.71b:   1.11.2008
  64. # Date v6.73b:  15.11.2008
  65. # Date v6.80b:  24.11.2008
  66. # Date v6.81b:  14.12.2008
  67. # Date v6.83b:  16.04.2009
  68. # Date v6.85b:  18.04.2009
  69. # Date v6.86b:  19.04.2009
  70. # Date v6.88b:  22.04.2009
  71. # Date v6.89b:   4.06.2009
  72. # Date v7.20b:   7.06.2009
  73. # Date v7.22b:  11.06.2009
  74. # Date v7.30b:  18.06.2009
  75. # Date v7.31b:  20.07.2009
  76. # Date v7.32b:  28.07.2009
  77. # Date v7.33b:   1.10.2009
  78. # Date v7.35b:   3.10.2009
  79. # Date v7.37b:   5.10.2009
  80. # Date v7.39b:   6.10.2009
  81. # Date v7.40b:  28.11.2010
  82. # Date v7.41b:  22.01.2011
  83. # Date v7.50b:  12.03.2011
  84. # Date v7.60b:  23.04.2012
  85. # Date v7.61b:  22.06.2012
  86. # Date v7.62b:  28.07.2012
  87. # Date v7.63b:  21.01.2013
  88. # Date v7.64b:  16.03.2013
  89. # Date v7.65b:  11.04.2013
  90. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  91. #
  92. #                                    PART 1
  93. #
  94. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  95. #  
  96. #  This work is protected by the following license:
  97. # #----------------------------------------------------------------------------
  98. # #  
  99. # #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
  100. # #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
  101. # #  
  102. # #  You are free:
  103. # #  
  104. # #  to Share - to copy, distribute and transmit the work
  105. # #  to Remix - to adapt the work
  106. # #  
  107. # #  Under the following conditions:
  108. # #  
  109. # #  Attribution. You must attribute the work in the manner specified by the
  110. # #  author or licensor (but not in any way that suggests that they endorse you
  111. # #  or your use of the work).
  112. # #  
  113. # #  Noncommercial. You may not use this work for commercial purposes.
  114. # #  
  115. # #  Share alike. If you alter, transform, or build upon this work, you may
  116. # #  distribute the resulting work only under the same or similar license to
  117. # #  this one.
  118. # #  
  119. # #  - For any reuse or distribution, you must make clear to others the license
  120. # #    terms of this work. The best way to do this is with a link to this web
  121. # #    page.
  122. # #  
  123. # #  - Any of the above conditions can be waived if you get permission from the
  124. # #    copyright holder.
  125. # #  
  126. # #  - Nothing in this license impairs or restricts the author's moral rights.
  127. # #  
  128. # #----------------------------------------------------------------------------
  129. #
  130. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  131. #
  132. # VERY IMPORTANT NOTES:
  133. #
  134. #   For any new add-on the version will increase by 0.1, for any update of the
  135. #   collection or any update on an add-on the version will increase by 0.01.
  136. #   Also from v3.71b on there is a recognition global variable available which
  137. #   will make the Tons of Add-ons much more compatible with many of my scripts.
  138. #   I noticed serious issues with several of my older scripts.
  139. #  
  140. #   Tons of Add-ons now has to be used as 3-parts script because of a weird
  141. #   behaviour of RMXP during bug detection. Insert the 3 parts in the correct
  142. #   order and the system should work without problems. Do NOT remove any of the
  143. #   parts, the script NEEDS all 3 parts to work with other systems.
  144. #
  145. #
  146. # Compatibility:
  147. #
  148. #   90% compatible with SDK v1.x. 80% compatible with SDK v2.x. Some add-ons
  149. #   will corrupt your old savegames. If you experience the "Stack level too
  150. #   deep" error, you might already use one of these add-ons. All of these
  151. #   add-ons here work with each other with a success rate of 99%. This add-on
  152. #   collection itself WILL corrupt your old savegames. May cause
  153. #   incompatibility issues with following systems:
  154. #  
  155. #   - exotic CBS-ex
  156. #   - exotic CMS-es
  157. #   - skill learning systems
  158. #   - exotic graphic systems on the map
  159. #   - weapon/armor changing systems
  160. #   - enhanced equipment systems
  161. #  
  162. #   This add-on collection is semantically compatible with RTAB v1.16 with all
  163. #   Plugins, though, several add-ons will not work:
  164. #  
  165. #   - Center Battler    - will cause a crash (it's rather useless in Side-View
  166. #                         RTAB anyway)
  167. #   - Multi-Hit         - will not react at all if RTAB is being used due to
  168. #                         the heavy changes in the methods supported by the DBS
  169. #   - Charge Skill      - the countdown will be start at 0 and the skill will
  170. #                         be executed right away
  171. #  
  172. #   It is possible that more add-ons don't work, but it is very unlikely.
  173. #
  174. #
  175. # Featured add-ons so far:
  176. #
  177. #     64 add-ons by Blizzard
  178. #   +  2 add-ons by Fantasist
  179. #   +  1 add-on  by NAMKCOR
  180. #   +  1 add-on  by Zan
  181. #   +  6 add-ons by game_guy
  182. #   +  1 add-on  by TerreAqua
  183. #   +  1 add-on  by Heretic
  184. #   = 76 add-ons altogether
  185. #
  186. # Ideas:
  187. #
  188. #   - Blizzard
  189. #   - GuardianAngelX72
  190. #   - BanisherOfEden
  191. #   - italianstal1ion
  192. #   - indinera
  193. #   - Yami
  194. #   - blazinhandle
  195. #   - Arrow-1
  196. #   - Caro La Rushe
  197. #   - Zan
  198. #   - shahafyz57
  199. #   - Echo
  200. #   - Cid
  201. #   - Fantasist
  202. #   - Ceaon
  203. #   - NAMKCOR
  204. #   - mumerus
  205. #   - chino69
  206. #   - game_guy
  207. #   - TerreAqua
  208. #   - Subsonic_Noise
  209. #   - Heretic
  210. #
  211. #
  212. # Features:
  213. #
  214. #   ----> PART 1
  215. #   ----> Graphic (make your game look nice):
  216. # - Better Tilemap update (will update autotiles faster)
  217. # - Animated Title (have an animated title screen without .gifs)
  218. # - Center Battler (they will be centered instead of lined next to each other)
  219. # - HP/SP/EXP gradient/slant bars (including 7 styles, opacity and least lag)
  220. # - Location Names (shows pictures or names of the location the player visits)
  221. # - Black Fade (shows a black screen when changing the map or before battle)
  222. # - Simple Shaded Text (draws a shadow behind your text)
  223. # - Blizz-Art lagless HUD (Heads Up Display using either HP/SP/EXP or simple)
  224. # - Screen Tremble (makes your screen shake vertically, too)
  225. # - Animation Stack (shows animation of all inflicted status effects)
  226. # - Simple Facesets (shows a face instead of the spriteset in the main menu)
  227. # - Caterpillar (party members follow you on the map)
  228. # - Arrow over Player (shows arrow over player's head if he's "behind")
  229. # - Animated Battle Background (animates battle backgrounds)
  230. # - Map as Battleback (map is the battle backgrounds)
  231. # - Facesets for DSS (shows a face instead of the spriteset in the status menu)
  232. # - Status Effects as Icons (displays status effects as icons)
  233. # - Animated Battlers Non-Action BS (animates battlers in battle systems)
  234. # - Enhanced Battle Cursor (plays animations upon cursors in battle)
  235. # - Death Image (displays an image instead of nothing for dead actors)
  236. # - Terrain Battlebacks (different battlebacks for different terrains)
  237. #
  238. #   ----> PART 2
  239. #   ----> Utility (make your game more unique and better/help you during debug):
  240. # - Custom Game Controls (set up your own game controls)
  241. # - FPS Modulator (increase the fps rate up 3 times like in an emulator)
  242. # - Speed Modulator (change the main character's speed on the map)
  243. # - Fullscreen? (asks the player at game start if he wishes to switch to full)
  244. # - Death Toll (counts killed enemies and actor deaths)
  245. # - Multi-Drop (makes enemies drop more than just one item)
  246. # - Window_BattleResult (displays gained items in a different, but better way)
  247. # - Unique Skill Commands (different name for the Skill command for each class)
  248. # - Ultimate Font Override (will override the font from any RMXP version)
  249. # - Heal at LvlUp (heals characters who level up)
  250. # - Weapon/Armor HP/SP Plus (max HP and max SP can also be increased)
  251. # - EQUAP Skills (equipment skills, equip to learn + AP system like FF9)
  252. # - Picture Movie Scene (easily create picture based cutscenes)
  253. # - Target 'em all! (make skills target all battlers)
  254. # - Quick Passability Test (let's you debug maps faster and more convenient)
  255. # - Blizz-ABS Minimap (never was a minimap so easy to use)
  256. # - Enemy Status in Battle (displays enemies' HP, SP and state)
  257. # - Passive Skills (modify attributes when learned)
  258. # - Different Difficulties (like "Easy", "Normal", "Hard")
  259. # - Skill Separation System (like "White Magic", "Black Magic", "Technic", etc.)
  260. # - Multi-Hit (make weapons/skills/enemies hit more than once)
  261. # - Scene_Item calling Items (make items call special item scenes)
  262. # - Plug-in Save Point (create your own save point system within minutes)
  263. # - Equipment Requirement System (Diablo II style requirements)
  264. # - Item Requirement for Skills (skills require and consume items upon use)
  265. # - HP/SP Crush (weapons consume/heal HP/SP when attacking)
  266. # - Roulette (allows random targets with a nice animation)
  267. # - Chain Status Effects (status effects have other states as precondition)
  268. # - Actor-specific Item Usability (deny item effects on specific actors)
  269. # - Percentage Health States (states added/removed on specific HP percentages)
  270. # - Monster Areas (different encounters at different areas in the same map)
  271. # - Realistic Ladders (turn upwards when using ladders)
  272. # - Event Z-Index Controller (render events flat and change their Z-Index)
  273. #
  274. #   ----> PART 3
  275. #   ----> Status Effect (non-standard status effects):
  276. # - Zombie Status (Healing items will hurt and light attacks are effective)
  277. # - Regen Status (progressive healing aka poison, but the other way)
  278. # - Auto-Revive Status (or Auto-Life, will be automatically revived after dying)
  279. # - Fury Status (if a specific character dies, another one will become Fury)
  280. # - Invincible Status (this status will nullify ANY DAMAGE done by enemies)
  281. # - SP Cost Mod Status (this status will change SP cost)
  282. # - Frozen Status (dies instantly if getting damaged)
  283. # - Blue Magic Status (can learn enemies'/other actors' skills)
  284. # - Doom Status (countdown to death)
  285. #
  286. #   ----> PART 3
  287. #   ----> Skill (non-standard skills):
  288. # - Absorb HP/SP Skill (with considering undead enemies)
  289. # - State Breaker Skill (changes available status effects forcefully)
  290. # - Blue Magic Skill (can learn enemies'/other actors' skills)
  291. # - Demi Skill (deals damage equal to a percentage of the remaining HP)
  292. # - Revenge Skill (does damage equal to MAX_HP - CURRENT_HP)
  293. # - Destructor Skill (kills self to achieve various effects)
  294. # - SP Damage Skill (skills that damage / heal SP instead of HP)
  295. # - Charge Skill (skills that count down before usage)
  296. # - Energy Skill (does damage equal to the current HP of the user)
  297. # - Master Thief Skill (steals weapon, armors, items and gold from enemies)
  298. # - HP Consuming Skill (consumes HP upon usage)
  299. #
  300. #   ----> PART 3
  301. #   ----> Item (non-standard items):
  302. # - Skill Teaching Item (items that teach actors skills)
  303. # - Level Up/Down Item (items that level up/down actors)
  304. #
  305. #
  306. # Version History:
  307. #
  308. # v1.10b:
  309. #   -> added Black Fade by Blizzard
  310. #
  311. # v1.60b:
  312. #   -> added Ultimate Font Override by Blizzard
  313. #   -> added Simple Shaded Text by Blizzard
  314. #   -> added Heal at LvlUp by Blizzard
  315. #   -> added Fury Status by Blizzard
  316. #   -> added Invincible Status by Blizzard
  317. #
  318. # v1.62b:
  319. #   -> upgraded Death Toll by Blizzard to v1.2b
  320. #
  321. # v1.70b:
  322. #   -> added Half SP by Blizzard
  323. #
  324. # v1.87b:
  325. #   -> added Blizz-Art lagless HUD by Blizzard
  326. #   -> upgraded Animated Title by Blizzard to v1.33b
  327. #   -> upgraded Centered Battlers by Blizzard to v2.1b
  328. #   -> upgraded HP/SP/EXP bars by Blizzard to v4.11b
  329. #   -> upgraded Speed Modulator by Blizzard to v1.01b
  330. #   -> upgraded Regen Status Effect by Blizzard to v1.1b
  331. #   -> upgraded Auto-Revive by Blizzard to v1.21b
  332. #   -> updated FPS Modulator by Blizzard
  333. #
  334. # v2.20b:
  335. #   -> added Weapon/Armor HP/SP Plus by Blizzard
  336. #   -> added Full Reflection System by Blizzard
  337. #   -> added EQ Skills by Blizzard
  338. #   -> added Picture Movie Scene by Blizzard
  339. #
  340. # v2.30b:
  341. #   -> added Screen Tremble by Blizzard
  342. #
  343. # v2.31b:
  344. #   -> updated Screen Tremble by Blizzard
  345. #   -> updated Better Tilemap update by Blizzard
  346. #
  347. # v2.40b:
  348. #   -> added Animation Stack by Blizzard
  349. #   -> upgraded Picture Movie Scene by Blizzard to v2.02b
  350. #   -> upgraded Screen Tremble by Blizzard to v1.1b
  351. #
  352. # v2.50b:
  353. #   -> added Target 'em all! by Blizzard
  354. #   -> upgraded Unique Skill Commands by Blizzard to v1.11b
  355. #
  356. # v2.70b:
  357. #   -> added Quick Passability Test by Blizzard
  358. #   -> added Dynamic Passability Minimap by Blizzard
  359. #   -> upgraded Picture Movie Scene by Blizzard to v2.03b
  360. #
  361. # v2.71b:
  362. #   -> upgraded Dynamic Passability Minimap by Blizzard to v1.01b
  363. #
  364. # v2.80b:
  365. #   -> added Enemy Status in Battle by Blizzard
  366. #
  367. # v3.70b:
  368. #   -> added Simple Facesets by Blizzard
  369. #   -> changed EQ Skills by Blizzard to EQUAP Skills and upgraded to v3.0b
  370. #   -> upgraded Unique Skill Commands by Blizzard to v1.2b
  371. #   -> updated Center Battler by Blizzard
  372. #   -> updated Weapon/Armor HP/SP Plus by Blizzard
  373. #   -> added constant for recognition by other scripts to improve compatibility
  374. #   -> Why suddenly v3.7b? 37 add-ons are featured so far!
  375. #
  376. # v3.71b:
  377. #   -> upgraded Simple Facesets by Blizzard to v1.01b
  378. #   -> fixed a problem with the compatibility recognition
  379. #
  380. # v3.80b:
  381. #   -> added Caterpillar by Blizzard
  382. #
  383. # v4.00b:
  384. #   -> added Arrow over Player by Blizzard
  385. #   -> added EMP Skill by Blizzard
  386. #   -> upgraded Caterpillar by Blizzard to v1.01b
  387. #   -> upgraded EQUAP Skills by Blizzard to v3.02b
  388. #
  389. # v4.01b:
  390. #   -> upgraded Black Fade by Blizzard to v1.1b
  391. #
  392. # v4.02b:
  393. #   -> upgraded Window_BattleResult by Blizzard to v1.1b
  394. #
  395. # v4.30b:
  396. #   -> added Animated Battle Background by Blizzard
  397. #   -> added Map as Battleback by Blizzard
  398. #   -> added 1 SP by Blizzard
  399. #   -> upgraded HP/SP/EXP gradient/slant bars by Blizzard to v4.2b
  400. #   -> upgraded Blizz-Art lagless HUD by Blizzard to v1.2b
  401. #   -> upgraded Weapon/Armor HP/SP Plus by Blizzard to v1.01b
  402. #   -> upgraded Full Reflection System by Blizzard to v2.0b
  403. #   -> upgraded EMP Skill by Blizzard to v1.01b
  404. #
  405. # v4.32b:
  406. #   -> upgraded Zombie Status Effect by Blizzard to v1.1b
  407. #   -> updated Arrow over Player by Blizzard
  408. #
  409. # v4.50b:
  410. #   -> added Different Difficulties by Blizzard
  411. #   -> added Skill Separation System by Blizzard
  412. #   -> upgraded Half SP by Blizzard to v1.4b
  413. #   -> upgraded 1 SP by Blizzard to v1.1b
  414. #   -> updated Center Battler by Blizzard
  415. #   -> updated Blizz-Art lagless HUD by Blizzard
  416. #   -> updated Death Roulette by Blizzard
  417. #   -> updated EMP Skill by Blizzard
  418. #
  419. # v4.70b:
  420. #   -> added Facesets for DSS by Zan
  421. #   -> added Status Effects as Icons for DSS by Blizzard
  422. #   -> now compatible with Blizz-ABS 1.01 and higher
  423. #
  424. # v4.80b:
  425. #   -> added Animated Battlers for DBS by Blizzard
  426. #   -> fixed the HUD lag problem with Blizz-ABS 1.01 and higher
  427. #
  428. # v4.81b:
  429. #   -> updated Skill Separation System by Blizzard
  430. #
  431. # v4.85b:
  432. #   -> upgraded Weapon/Armor HP/SP Plus by Blizzard to v2.0
  433. #   -> upgraded Location Names by Blizzard to v2.1b
  434. #   -> upgraded Blizz-Art lagless HUD by Blizzard to v1.3b
  435. #   -> improved overall coding of Tons of Add-ons and fixed incompatibility bugs
  436. #
  437. # v4.86b:
  438. #   -> upgraded Fullscreen? by Blizzard to v1.22b
  439. #
  440. # v4.9b:
  441. #   -> added Demi Skill by Blizzard
  442. #
  443. # v4.91b:
  444. #   -> upgraded HP/SP/EXP gradient/slant bars by Blizzard to v4.4b
  445. #
  446. # v4.97b:
  447. #   -> due to a bug Ultimate Font Override can't be turned on/off ingame now
  448. #   -> upgraded Location Names by Blizzard to v2.11b
  449. #   -> upgraded Arrow over Player by Blizzard to v1.01b
  450. #   -> upgraded Weapon/Armor HP/SP Plus by Blizzard to v2.0b
  451. #   -> upgraded Death Toll by Blizzard to v1.3b
  452. #   -> updated ABSEAL by Blizzard
  453. #
  454. # v4.98b:
  455. #   -> upgraded Caterpillar by Blizzard to v2.0
  456. #
  457. # v5.40b:
  458. #   -> added Multi-Hit by Blizzard
  459. #   -> added Scene_Item calling Items by Blizzard
  460. #   -> added Custom Game Controls by Blizzard
  461. #   -> added Plug-in Save Point by Blizzard
  462. #   -> added Frozen Status Effect by Blizzard
  463. #   -> added Doom Skill by Blizzard
  464. #   -> upgraded Caterpillar by Blizzard to v2.0b
  465. #   -> upgraded Animated Battle Background by Blizzard to v1.1b
  466. #   -> upgraded Map as Battleback by Blizzard to v1.5b
  467. #   -> upgraded Unique Skill Commands by Blizzard to 1.3b
  468. #   -> upgraded 1 SP by Blizzard to v1.11b
  469. #   -> upgraded Absorb HP/SP by Blizzard to v1.72b
  470. #   -> upgraded Animated Battlers for Non-Action BS by Blizzard to v1.3b
  471. #   -> removed Blizz-ASBEAL for convenience, now available separately
  472. #   -> rewritten conditions using classic syntax to avoid RGSS conditioning bug
  473. #   -> now compatible with RTAB v1.16 + Plug-ins
  474. #
  475. # v5.80b:
  476. #   -> added Revenge Skill by Blizzard
  477. #   -> added Destructor Skill by Blizzard
  478. #   -> added SP Damage Skill by Blizzard
  479. #   -> added Enhanced Battle Cursor by Fantasist
  480. #   -> upgraded Regen Status by Blizzard to v2.0
  481. #
  482. # v5.81b:
  483. #   -> upgraded HP/SP/EXP gradient/slant bars by Blizzard to v4.41b
  484. #
  485. # v5.83b:
  486. #   -> upgraded HP/SP/EXP gradient/slant bars by Blizzard to v4.5b
  487. #   -> upgraded Location Names by Blizzard to v2.12b
  488. #   -> commented code down to Blizz-Art lagless HUD
  489. #
  490. # v5.90b:
  491. #   -> added Equipment Requirement System by NAMKCOR
  492. #   -> upgraded Doom Skill by Blizzard to v1.0b
  493. #   -> upgraded Destructor Skill by Blizzard to v1.0b
  494. #   -> upgraded Enhanced Battle Cursor by Fantasist to v2.1 beta
  495. #
  496. # v5.91b:
  497. #   -> upgraded Location Names by Blizzard to v2.13b
  498. #
  499. # v5.98b:
  500. #   -> added SP Cost Mod Status Effect by Blizzard
  501. #   -> added Multi-Drop by Blizzard
  502. #   -> upgraded Window_BattleResult by Blizzard to 1.2b
  503. #   -> upgraded Status Effects as Icons by Blizzard to 1.0b
  504. #   -> upgraded Zombie Status by Blizzard to 1.2b
  505. #   -> upgraded Regen Status by Blizzard to 2.0b
  506. #   -> upgraded Auto-Revive Status by Blizzard to 1.22b
  507. #   -> upgraded Invincible Status by Blizzard to 2.0b
  508. #   -> upgraded Frozen Status by Blizzard to 1.0b
  509. #   -> removed Half SP by Blizzard
  510. #   -> removed 1 SP by Blizzard
  511. #   -> removed Full Reflection System by Blizzard
  512. #   -> updated all skill add-ons to work without Reflect
  513. #   -> THIS VERSION HAS ONLY 58 ADD-ONS!
  514. #
  515. # v5.99b:
  516. #   -> upgraded Auto-Revive Status by Blizzard to 1.23b
  517. #   -> updated Frozen Status by Blizzard
  518. #   -> THIS VERSION HAS ONLY 58 ADD-ONS!
  519. #
  520. # v6.00b:
  521. #   -> added Item Requirement for Skills by Blizzard
  522. #   -> added Charge Skill by Blizzard
  523. #   -> upgraded Skill Separation System by Blizzard to 1.1b
  524. #   -> updated SP Cost Mod Status Effect by Blizzard
  525. #   -> updated Revenge Skill by Blizzard
  526. #
  527. # v6.02b:
  528. #   -> upgraded Target 'em all! by Blizzard to 1.1b
  529. #   -> upgraded Auto-Revive by Blizzard to 1.24b
  530. #   -> updated Charge Skill by Blizzard
  531. #
  532. # v6.03b:
  533. #   -> upgraded HP/SP/EXP gradient/slant bars by Blizzard to v4.51b
  534. #
  535. # v6.10b:
  536. #   -> added Blue Magic Status Effect by Blizzard
  537. #   -> upgraded Location Names by Blizzard to v2.2b
  538. #   -> upgraded Blizz-Art lagless HUD by Blizzard to v1.4b
  539. #   -> upgraded Arrow over Player by Blizzard to v1.1b
  540. #   -> upgraded Caterpillar by Blizzard to v2.1b
  541. #   -> upgraded Picture Movie Scene by Blizzard to v2.1b
  542. #   -> upgraded Blue Magic Skill by Blizzard to v1.5b
  543. #   -> updated Window_BattleResult add-on by Blizzard
  544. #   -> Enhanced Battle Cursors now cannot be turned on/off in-game
  545. #   -> Tons of Add-ons now has to be used as 3-parts script, because of a
  546. #      weird behaviour of RMXP during bug detection, insert the 3 parts in the
  547. #      correct order and the system should work without problems, do NOT remove
  548. #      any of the parts, the script NEEDS all 3 parts to work with other
  549. #      systems
  550. #
  551. # v6.11b:
  552. #   -> upgraded Save Point by Blizzard to v2.0b
  553. #
  554. # v6.12b:
  555. #   -> upgraded Caterpillar by Blizzard to v2.11b
  556. #
  557. # v6.13b:
  558. #   -> upgraded Multi-Hit by Blizzard to v1.3b
  559. #
  560. # v6.20b:
  561. #   -> added Death Image by Blizzard
  562. #   -> upgraded Absorb HP/SP Skill by Blizzard to v1.8b
  563. #   -> upgraded Destructor Skill by Blizzard to v1.2b
  564. #   -> upgraded Fury Status Effect by Blizzard to v2.0b
  565. #   -> upgraded Skill Separation System by Blizzard to v1.2b
  566. #   -> updated SP Cost Mod Status Effect by Blizzard
  567. #   -> Doom Skill by Blizzard is now named Doom Status Effect
  568. #
  569. # v6.40b:
  570. #   -> added HP/SP Crush by Blizzard
  571. #   -> added Energy Skill by Blizzard
  572. #   -> upgraded Blizz-Art lagless HUD by Blizzard to v1.41b
  573. #   -> upgraded Location Names with Pictures or Text by Blizzard to v2.21b
  574. #   -> upgraded Map as Battleback by Blizzard to v1.51b
  575. #   -> upgraded Custom Game Controls by Blizzard to v2.0b
  576. #   -> upgraded Plug-in Save Point by Blizzard to v2.1b
  577. #   -> upgraded Different Difficulties by Blizzard to v1.1b
  578. #   -> updated Multi-Drop by Blizzard
  579. #
  580. # v6.50b:
  581. #   -> added Passive Skills by Blizzard
  582. #   -> upgraded Status Effects as Icons by Blizzard to v1.1b
  583. #   -> upgraded Picture Movie Scene by Blizzard to v2.2b
  584. #   -> upgraded Multi-Drop by Blizzard to v1.1b
  585. #   -> upgraded EQUAP Skills by Blizzard to v4.0b
  586. #   -> upgraded Fury Status by Blizzard to v1.1b
  587. #   -> upgraded Absorb HP/SP by Blizzard to v2.0b
  588. #
  589. # v6.51b:
  590. #   -> updated Passive Skills by Blizzard
  591. #
  592. # v6.54b:
  593. #   -> upgraded Skill Separation System by Blizzard to 3.0b
  594. #   -> upgraded Multi-Hit by Blizzard to 1.4b
  595. #   -> upgraded SP Cost Mod by Blizzard to 3.0b
  596. #
  597. # v6.56b:
  598. #   -> upgraded Death Image by Blizzard to 1.2b
  599. #   -> upgraded Blizz-Art lagless HUD by Blizzard to 1.42b
  600. #
  601. # v6.58b:
  602. #   -> upgraded Demi Skill by Blizzard to 1.01b
  603. #   -> updated SP Damage Skill by Blizzard
  604. #
  605. # v6.59b:
  606. #   -> updated the entire collection to prevent unexpected behavior
  607. #
  608. # v6.60b:
  609. #   -> upgraded Status Effects as Icons by Blizzard to 1.2b
  610. #   -> upgraded EQUAP by Blizzard to 4.1b
  611. #   -> upgraded Passive Skills by Blizzard to 1.1b
  612. #   -> upgraded Multi-Hit by Blizzard to 1.5b
  613. #   -> upgraded Zombie Status by Blizzard to 1.3b
  614. #   -> upgraded Auto-Revive by Blizzard to 1.25b
  615. #   -> upgraded Demi Skill by Blizzard to 1.02b
  616. #   -> created State Breaker Skill and Roulette from Death Roulette by Blizzard
  617. #   -> removed EMP Skill by Blizzard (State Breaker State can emulate it)
  618. #   -> added Master Thief Skill by Blizzard
  619. #
  620. # v6.61b:
  621. #   -> upgraded Custom Game Controls by Blizzard to 2.1b
  622. #
  623. # v6.70b:
  624. #   -> added Chain Status Effects by Blizzard
  625. #
  626. # v6.71b:
  627. #   -> upgraded Caterpillar by Blizzard to 2.2b
  628. #
  629. # v6.73b:
  630. #   -> upgraded Picture Movie Scene by Blizzard to 2.3b
  631. #   -> upgraded Ultimate Font Override by Blizzard to 1.02b
  632. #
  633. # v6.80b:
  634. #   -> added Actor-specific Item Usability by Fantasist
  635. #   -> upgraded Blizz-Art lagless HUD by Blizzard to 1.43b
  636. #
  637. # v6.81b:
  638. #   -> upgraded Animated Title by Blizzard to 1.34b
  639. #
  640. # v6.83b:
  641. #   -> renamed Dynamic Passability Minimap to Blizz-ABS Minimap
  642. #   -> upgraded Blizz-ABS Minimap by Blizzard to 2.0
  643. #   -> upgraded Quick Passability Test by Blizzard to 2.0
  644. #
  645. # v6.85b:
  646. #   -> upgraded Passive Skills by Blizzard to 1.2b
  647. #   -> upgraded Different Difficulties by Blizzard to 1.2b
  648. #
  649. # v6.86b:
  650. #   -> upgraded Quick Passability Test by Blizzard to 2.1b
  651. #
  652. # v6.88b:
  653. #   -> upgraded EQUAP Skills by Blizzard to v4.2b
  654. #   -> upgraded Different Difficulties by Blizzard to 1.3b
  655. #
  656. # v6.89b:
  657. #   -> upgraded EQUAP Skills by Blizzard to v4.3b
  658. #
  659. # v7.20b:
  660. #   -> added Terrain Battlebacks by game_guy
  661. #   -> added HP Consuming Skills by game_guy
  662. #   -> added Skill Teaching Item by game_guy
  663. #   -> added Level Up/Down Item by game_guy
  664. #
  665. # v7.22b:
  666. #   -> upgraded Custom Game Controls by Blizzard to v2.2b
  667. #   -> upgraded Weapon/Armor HP/SP Plus by Blizzard to v2.1b
  668. #
  669. # v7.30b:
  670. #   -> added Percentage Health States by TerreAqua
  671. #
  672. # v7.31b:
  673. #   -> upgraded Custom Game Controls by Blizzard to v3.0
  674. #
  675. # v7.32b:
  676. #   -> upgraded Skill Separation System by Blizzard to v1.31b
  677. #
  678. # v7.33b:
  679. #   -> upgraded Revenge Skill by Blizzard to v1.1b
  680. #
  681. # v7.35b:
  682. #   -> upgraded Skill Separation System by Blizzard to v1.32b
  683. #   -> upgraded HP Consuming Skills by game_guy to v1.1
  684. #
  685. # v7.37b:
  686. #   -> upgraded Skill Separation System by Blizzard to v1.33b
  687. #   -> updated Chain Status Effects by Blizzard
  688. #
  689. # v7.39b:
  690. #   -> upgraded Multi-Hit by Blizzard to v1.51b
  691. #   -> upgraded Master Thief Skill by Blizzard to v1.0b
  692. #
  693. # v7.40b:
  694. #   -> upgraded Caterpillar by Blizzard to v2.21b
  695. #
  696. # v7.41b:
  697. #   -> upgraded Terrain Battlebacks by game_guy to v1.1
  698. #
  699. # v7.50b:
  700. #   -> added Monster Areas by game_guy
  701. #   -> added Realistic Ladders by game_guy
  702. #   -> now Picture Movie Scene can also be turned off
  703. #
  704. # v7.60b:
  705. #   -> added Event Z-Index Controller by Heretic
  706. #   -> upgraded Arrow over Player by Blizzard to v1.2b
  707. #
  708. # v7.61b:
  709. #   -> upgraded Custom Controls by Blizzard to v4.0
  710. #
  711. # v7.62b:
  712. #   -> upgraded Custom Controls by Blizzard to v4.1
  713. #
  714. # v7.63b:
  715. #   -> upgraded Skill Teaching Item by game_guy to v1.01
  716. #   -> upgraded Actor-specific Item Usability by Fantasist to v1.01
  717. #   -> upgraded Level Up/Down Item game_guy to v1.01
  718. #
  719. # v7.64b:
  720. #   -> upgraded Minimap by Blizzard to v2.01
  721. #
  722. # v7.65b:
  723. #   -> upgraded Skill Separation System by Blizzard to v1.4
  724. #
  725. #
  726. # Instructions:
  727. #
  728. # - Explanation:
  729. #
  730. #   Every Add-on has its own instructions. Please read and follow them.
  731. #
  732. # - Configuration:
  733. #
  734. #   Configure the part just below to define which add-ons you want to use and
  735. #   which not. The configuration is split into two part for reason, don't
  736. #   change this. It will work fine if you leave it as it is.
  737. #
  738. # - For scripters:
  739. #
  740. #   If you have any ideas how to improve this collection, just say so. I will
  741. #   add you into the credits of this add-on collection if you have an own
  742. #   add-on. I will not add any add-ons made by somebody else than yourself, you
  743. #   can't ask me for somebody else to add an add-on. The creator has to ask me
  744. #   himself.
  745. #
  746. #
  747. # Side note:
  748. #
  749. #   These add-ons were mostly tested in a different environment or not at all.
  750. #
  751. #
  752. # Useless facts:
  753. #
  754. #   - Tons of Add-ons already exceeds many CMS-es and even most CBS-es in
  755. #     number of lines of code.
  756. #   - The version history of Tons of Add-ons has more lines than several
  757. #     add-ons themselves in Tons of Add-ons and even medium-sized scripts.
  758. #   - Chaos Project uses only about 50% of the Tons of Add-ons.
  759. #   - Russian Reversal on Croatian Blizzards:
  760. #     "In Russia Blizzard makes his scripts SDK compatible with YOU!"
  761. #
  762. #
  763. # If you find any bugs, please report them here:
  764. # http://forum.chaos-project.com
  765. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  766.  
  767. $tons_version = 7.65
  768.  
  769. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  770. #                                                                             #
  771. #   ###   ###  #   # #####  #   #### #   # ####   ###  #####  #   ###  #   #  #
  772. #  #   # #   # ##  # #      #  #     #   # #   # #   #   #    #  #   # ##  #  #
  773. #  #     #   # # # # ####   #  #  ## #   # ####  #   #   #    #  #   # # # #  #
  774. #  #   # #   # #  ## #      #  #   # #   # #   # #####   #    #  #   # #  ##  #
  775. #   ###   ###  #   # #      #   ####  ###  #   # #   #   #    #   ###  #   #  #
  776. #                                                                             #
  777. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  778.  
  779. $DUMMY_ELEMENTS = [] # add any dummy element IDs other scripts might use
  780. $DUMMY_STATES = [] # add any dummy state IDs other scripts might use
  781.  
  782. module TONS_OF_ADDONS
  783.  
  784. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  785. # START Configuration 1-1, GRAPHIC add-ons
  786. #
  787. #   You can enable/disable any add-on here if you wish. Set the value to false
  788. #   to disable it. These features CANNOT be turned on/off during the game.
  789. #
  790. #     NAME_OF_THE_ADDON = true
  791. #     NAME_OF_THE_ADDON = false
  792. #
  793. #   where NAME_OF_THE_ADDON is the same variable as the one used below.
  794. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  795.   ANIMATED_TITLE = false
  796.   BATTLE_CURSORS = false
  797. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  798. # END Configuration 1-1
  799. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  800.  
  801. end
  802.  
  803. #==============================================================================
  804. # Game_System
  805. #==============================================================================
  806.  
  807. class Game_System
  808.  
  809.   def initialize_tons_of_addons
  810.     @tons_of_addons = true
  811. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  812. # START Configuration 1-2, GRAPHIC add-ons
  813. #
  814. #   You can enable/disable any add-on here if you wish. Set the value to false
  815. #   to disable it initially. To turn it on/off ingame, just use the Call script
  816. #   command with one of these syntaxes:
  817. #
  818. #     $game_system.NAME_OF_THE_ADDON = true
  819. #     $game_system.NAME_OF_THE_ADDON = false
  820. #
  821. #   where NAME_OF_THE_ADDON is the same variable as the one used below.
  822. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  823.     @BETTER_TILEMAP_UPDATE      = false
  824.     @CENTER_BATTLER             = false
  825.     @BARS                       = false
  826.     @LOCATION_NAMES             = false
  827.     @BLACKFADE                  = false
  828.     @SHADED_TEXT                = false
  829.     @HUD                        = false
  830.     @TREMBLE                    = false
  831.     @ANIMATION_STACK            = false
  832.     @FACESETS                   = false
  833.     @CATERPILLAR                = false
  834.     @ARROW_OVER_PLAYER          = false
  835.     @ANIMATED_BATTLE_BACKGROUND = false
  836.     @MAP_AS_BATTLEBACK          = false
  837.     @FACESETS_DSS               = false
  838.     @STATUS_ICONS               = false
  839.     @ANIBATTLERS_NON_ACTION_BS  = false
  840.     @DEATH_IMAGE                = false
  841.     @TERRAIN_BATTLEBACKS        = false
  842. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  843. # END Configuration 1-2
  844. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  845.   end
  846.  
  847. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  848. # It is recommended that you don't edit anything below this line except for
  849. # the configurations for the add-ons.
  850. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  851.  
  852.   attr_accessor :BETTER_TILEMAP_UPDATE
  853.   attr_accessor :CENTER_BATTLER
  854.   attr_accessor :BARS
  855.   attr_accessor :LOCATION_NAMES
  856.   attr_accessor :BLACKFADE
  857.   attr_accessor :SHADED_TEXT
  858.   attr_accessor :HUD
  859.   attr_accessor :TREMBLE
  860.   attr_accessor :ANIMATION_STACK
  861.   attr_accessor :FACESETS
  862.   attr_accessor :CATERPILLAR
  863.   attr_accessor :ARROW_OVER_PLAYER
  864.   attr_accessor :ANIMATED_BATTLE_BACKGROUND
  865.   attr_accessor :MAP_AS_BATTLEBACK
  866.   attr_accessor :FACESETS_DSS
  867.   attr_accessor :STATUS_ICONS
  868.   attr_accessor :ANIBATTLERS_NON_ACTION_BS
  869.   attr_accessor :DEATH_IMAGE
  870.   attr_accessor :TERRAIN_BATTLEBACKS
  871.  
  872. end
  873.  
  874. #==============================================================================
  875. # Game_Battler
  876. #==============================================================================
  877.  
  878. class Game_Battler
  879.  
  880.   def elements_correct(elements)
  881.     multiplier = size = 0
  882.     elements.each {|i|
  883.         unless $DUMMY_ELEMENTS.include?(i)
  884.           multiplier += self.element_rate(i)
  885.           size += 1
  886.         end}
  887.     return (size == 0 ? 100 : multiplier/size)
  888.   end
  889.  
  890. end
  891.  
  892. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  893. #                                                                             #
  894. #                #### ####   ###  ####  #   #  #  ###  #####                  #
  895. #               #     #   # #   # #   # #   #  # #   # #                      #
  896. #               #  ## ####  #   # ####  #####  # #     #####                  #
  897. #               #   # #   # ##### #     #   #  # #   #     #                  #
  898. #                #### #   # #   # #     #   #  #  ###  #####                  #
  899. #                                                                             #
  900. #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#
  901.  
  902. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  903. # Better Tilemap update by Blizzard
  904. # Type: Map Graphic Improvement
  905. # Version: 1.0b
  906. # Date: 13.8.2006
  907. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  908. #
  909. # new in v1.0b:
  910. #   - changed method of updating
  911. #
  912. #   This will add a little faster update of autotile frames to allow a more
  913. #   natural feeling.
  914. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  915.  
  916. #==============================================================================
  917. # Tilemap
  918. #==============================================================================
  919.  
  920. class Tilemap
  921.  
  922.   #----------------------------------------------------------------------------
  923.   # update
  924.   #  Added another update each 8th frame.
  925.   #----------------------------------------------------------------------------
  926.   alias upd_fps_later update
  927.   def update
  928.     # if active
  929.     if $game_system.BETTER_TILEMAP_UPDATE
  930.       # update again each 8th frame
  931.       upd_fps_later if Graphics.frame_count % 8 == 0
  932.     end
  933.     upd_fps_later
  934.   end
  935.  
  936. end
  937.  
  938. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  939. # Animated Title by Blizzard
  940. # Version: 1.34b
  941. # Type: Game Graphic Design Improvement
  942. # Date: 17.3.2006
  943. # Date v1.3: 26.5.2006
  944. # Date v1.32b: 14.11.2006
  945. # Date v1.33b: 12.1.2007
  946. # Date v1.34b: 14.12.2008
  947. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  948. #
  949. # v1.3 features:
  950. #   - completely overworked and 99% SDK compatible
  951. #
  952. # v1.32b features:
  953. #   - slightly improved code
  954. #
  955. # v1.33b features:
  956. #   - slightly improved code
  957. #
  958. # v1.34b features:
  959. #   - fixed a possible compatiblity problem
  960. #
  961. #
  962. # Instructions:
  963. #
  964. #   - if you want to change the delay between the frames change "DELAY"
  965. #   - name the frames of your title pictures "title0", "title1" and so on.
  966. #   - to change the number of frames, change the value of "PICS"
  967. #   - be sure to set "title0" as your title screen in the database
  968. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  969.  
  970. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  971. # START Configuration
  972. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  973.  
  974. DELAY = 20 # change the delay
  975. PICS = 1 # number of pictures/frames
  976.  
  977. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  978. # END Configuration
  979. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  980.  
  981. #==============================================================================
  982. # Scene_Title
  983. #==============================================================================
  984.  
  985. class Scene_Title
  986.  
  987.   #----------------------------------------------------------------------------
  988.   # update
  989.   #  Added changing of title each nth frame.
  990.   #----------------------------------------------------------------------------
  991.   alias update_animated_title_later update
  992.   def update
  993.     # if active and more than 1 pictures
  994.     if TONS_OF_ADDONS::ANIMATED_TITLE && PICS > 1
  995.       @counter = (@counter ||= 0) + 1
  996.       # if delay counter expired
  997.       if @counter == DELAY
  998.         @counter = 0
  999.         # increase frame circularry
  1000.         @frame = ((@frame ||= 0) + 1) % PICS
  1001.         # cache bitmap
  1002.         @sprite.bitmap = RPG::Cache.title("title#{@frame}")
  1003.         Graphics.transition
  1004.       end
  1005.     end
  1006.     update_animated_title_later
  1007.   end
  1008.  
  1009. end
  1010.  
  1011. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1012. # Centered Battlers by Blizzard
  1013. # Version: 2.1b
  1014. # Type: Battle Graphic Improvement
  1015. # Date: 14.11.2006
  1016. # Date v2.1b: 12.1.2007
  1017. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1018. #
  1019. # new in v2.0b:
  1020. #   - new code is much more compatible and not merged into the Regen add-on
  1021. #
  1022. # new in v2.1b:
  1023. #   - compatible with "Easy LvlUp Notifier"
  1024. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1025.  
  1026. #==============================================================================
  1027. # Sprite_Battler
  1028. #==============================================================================
  1029.  
  1030. class Sprite_Battler
  1031.    
  1032.   #----------------------------------------------------------------------------
  1033.   # update
  1034.   #  Added x coordinate change.
  1035.   #----------------------------------------------------------------------------
  1036.   alias upd_center_battler_later update
  1037.   def update
  1038.     upd_center_battler_later
  1039.     # if active and battler exists
  1040.     if $game_system.CENTER_BATTLER && @battler != nil
  1041.       if @battler.is_a?(Game_Actor)
  1042.         # set x coordinate depending on number of party members
  1043.         self.x = case $game_party.actors.size
  1044.         when 1 then @battler.screen_x + 240
  1045.         when 2 then @battler.screen_x + 80 + @battler.index * 160
  1046.         when 3 then @battler.screen_x + 80
  1047.         when 4 then @battler.screen_x
  1048.         end
  1049.       elsif @battler.is_a?(Game_Enemy)
  1050.         self.x = @battler.screen_x
  1051.       end
  1052.       self.y, self.z = @battler.screen_y, @battler.screen_z
  1053.     end
  1054.   end
  1055.  
  1056. end
  1057.  
  1058. #==============================================================================
  1059. # Scene_Battle
  1060. #==============================================================================
  1061.  
  1062. class Scene_Battle
  1063.  
  1064.   #----------------------------------------------------------------------------
  1065.   # update
  1066.   #  Added x coordinate change.
  1067.   #----------------------------------------------------------------------------
  1068.   alias upd_center_battler_later update
  1069.   def update
  1070.     # if active and Easy LvlUp Notifier windows exist
  1071.     if $game_system.CENTER_BATTLER && @lvlup_windows != nil
  1072.       @lvlup_windows.each_index {|i|
  1073.          # set x coordinate depending on number of party members
  1074.           @lvlup_windows[i].x = case $game_party.actors.size
  1075.           when 1 then 240
  1076.           when 2 then 80 + i * 320
  1077.           when 3 then 80 + i * 160
  1078.           when 4 then i * 160
  1079.           end}
  1080.     end
  1081.     upd_center_battler_later
  1082.   end
  1083.   #----------------------------------------------------------------------------
  1084.   # update
  1085.   #  Added x coordinate change.
  1086.   #----------------------------------------------------------------------------
  1087.   alias phase3_setup_command_window_center_battler_later phase3_setup_command_window
  1088.   def phase3_setup_command_window
  1089.     phase3_setup_command_window_center_battler_later
  1090.     # if active
  1091.     if $game_system.CENTER_BATTLER
  1092.       # set x coordinate depending on number of party members
  1093.       @actor_command_window.x = case $game_party.actors.size
  1094.       when 1 then 240
  1095.       when 2 then 80 + @actor_index * 320
  1096.       when 3 then 80 + @actor_index * 160
  1097.       when 4 then @actor_index * 160
  1098.       end
  1099.       @actor_command_window.index = 0
  1100.     end
  1101.   end
  1102.  
  1103. end
  1104.  
  1105. #==============================================================================
  1106. # Arrow_Actor
  1107. #==============================================================================
  1108.  
  1109. class Arrow_Actor
  1110.  
  1111.   #----------------------------------------------------------------------------
  1112.   # update
  1113.   #  Added x coordinate change.
  1114.   #----------------------------------------------------------------------------
  1115.   alias upd_center_battler_later update
  1116.   def update
  1117.     upd_center_battler_later
  1118.     # if active and actor exists
  1119.     if $game_system.CENTER_BATTLER && self.actor != nil
  1120.       # set x coordinate depending on number of party members
  1121.       self.x = case $game_party.actors.size
  1122.       when 1 then 240 + self.actor.screen_x
  1123.       when 2 then 2 * self.actor.screen_x
  1124.       when 3 then 80 + self.actor.screen_x
  1125.       when 4 then self.actor.screen_x
  1126.       end
  1127.       self.y = self.actor.screen_y
  1128.     end
  1129.   end
  1130.  
  1131. end
  1132.  
  1133. #==============================================================================
  1134. # Window_BattleStatus
  1135. #==============================================================================
  1136.  
  1137. class Window_BattleStatus
  1138.  
  1139.   #----------------------------------------------------------------------------
  1140.   # update
  1141.   #  number - RTAB compatiblity fix
  1142.   #  Added x coordinate change of the drawings.
  1143.   #----------------------------------------------------------------------------
  1144.   alias refresh_center_battler_later refresh
  1145.   def refresh(number = nil)
  1146.     # if not active
  1147.     unless $game_system.CENTER_BATTLER
  1148.       # RTAB compatibility fix
  1149.       if number == nil
  1150.         refresh_center_battler_later
  1151.       else
  1152.         refresh_center_battler_later(number)
  1153.       end
  1154.       return
  1155.     end
  1156.     self.contents.clear
  1157.     @item_max = $game_party.actors.size
  1158.     # iterate through all indices
  1159.     $game_party.actors.each_index {|i|
  1160.         actor = $game_party.actors[i]
  1161.         # set x coordinate depending on number of party members
  1162.         actor_x = case $game_party.actors.size
  1163.         when 1 then 4 + 240
  1164.         when 2 then 4 + 80 + i * 320
  1165.         when 3 then 4 + 80 + i * 160
  1166.         when 4 then 4 + i * 160
  1167.         end
  1168.         # draw everything else
  1169.         draw_actor_name(actor, actor_x, 0)
  1170.         draw_actor_hp(actor, actor_x, 32, 120)
  1171.         draw_actor_sp(actor, actor_x, 64, 120)
  1172.         if @level_up_flags[i]
  1173.           self.contents.font.color = normal_color
  1174.           self.contents.draw_text(actor_x, 96, 120, 32, 'LEVEL UP!')
  1175.         else
  1176.           draw_actor_state(actor, actor_x, 96)
  1177.         end}
  1178.   end
  1179.  
  1180. end
  1181.  
  1182. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1183. # Blizz-Art Gradient Styler with HP/SP/EXP bars by Blizzard
  1184. # Version: 4.51b
  1185. # Type: Game Playability Improvement
  1186. # Date v4.0: 13.11.2006
  1187. # Date v4.11: 12.1.2007
  1188. # Date v4.2b: 12.3.2007
  1189. # Date v4.4b: 14.7.2007
  1190. # Date v4.41b: 23.10.2007
  1191. # Date v4.5b: 25.10.2007
  1192. # Date v4.51b: 28.1.2008
  1193. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1194. #
  1195. # new in v2.x:
  1196. #   - 2 styles, better code
  1197. #
  1198. # new in v3.x:
  1199. #   - 6 styles, far better code
  1200. #
  1201. # new in v4.0:
  1202. #   - 6 styles, overworked and extremely delagged, enjoy the most lagless
  1203. #     gradient/slant bar code ever
  1204. #
  1205. # new in v4.11:
  1206. #   - added instructions and a recognition constant for plugins
  1207. #
  1208. # new in v4.2b:
  1209. #   - improved code
  1210. #
  1211. # new in v4.4b:
  1212. #   - improved code, now 7 styles
  1213. #
  1214. # new in v4.41b:
  1215. #   - resolved issue
  1216. #
  1217. # new in v4.5b:
  1218. #   - improved coding
  1219. #   - removed drawing glitch that was caused by using a variable name shorter
  1220. #     than 4 letters
  1221. #
  1222. # new in v4.51b:
  1223. #   - fixed glitch with Stormtronics CMS
  1224. #
  1225. #
  1226. # Instructions:
  1227. #
  1228. #   You can change style and opacity by using the "Call script" event command.
  1229. #   Use one of of these syntaxes:
  1230. #
  1231. #     $game_system.bar_style = X
  1232. #     $game_system.bar_opacity = Y
  1233. #
  1234. #   X - number from 0 to 6 and is the ID number of the style
  1235. #   Y - number from 0 to 255 and indicates the opacity
  1236. #  
  1237. #   Values out of range will be corrected.
  1238. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1239.  
  1240. $Blizz_Art = true
  1241.  
  1242. #==============================================================================
  1243. # Game_System
  1244. #==============================================================================
  1245.  
  1246. class Game_System
  1247.  
  1248.   attr_accessor :bar_style
  1249.   attr_reader   :bar_opacity
  1250.   #----------------------------------------------------------------------------
  1251.   # initialize
  1252.   #  Added bar style variables.
  1253.   #----------------------------------------------------------------------------
  1254.   alias init_blizzart_later initialize_tons_of_addons
  1255.   def initialize_tons_of_addons
  1256.     init_blizzart_later
  1257. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1258. # START Configuration
  1259. #
  1260. #   Configure this part manually if you have no "Options" controller for the
  1261. #   styles and the opacity. (style: 0~6, opacity: 0~255)
  1262. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1263.     @bar_style = 5
  1264.     self.bar_opacity = 255
  1265. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1266. # END Configuration
  1267. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1268.   end
  1269.   #----------------------------------------------------------------------------
  1270.   # bar_opacity=
  1271.   #  alpha - opacity
  1272.   #  Encapsulation and range limitation of opacity.
  1273.   #----------------------------------------------------------------------------
  1274.   def bar_opacity=(alpha)
  1275.     @bar_opacity = [[alpha, 0].max, 255].min
  1276.   end
  1277.  
  1278. end
  1279.  
  1280. #==============================================================================
  1281. # Game_Actor
  1282. #==============================================================================
  1283.  
  1284. class Game_Actor
  1285.  
  1286.   #----------------------------------------------------------------------------
  1287.   # now_exp
  1288.   #  Returns the EXP collected in this level.
  1289.   #----------------------------------------------------------------------------
  1290.   def now_exp
  1291.     return @exp - @exp_list[@level]
  1292.   end
  1293.   #----------------------------------------------------------------------------
  1294.   # next_exp
  1295.   #  Returns the EXP needed to level up as number.
  1296.   #----------------------------------------------------------------------------
  1297.   def next_exp
  1298.     return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  1299.   end
  1300.  
  1301. end
  1302.  
  1303. #==============================================================================
  1304. # Bitmap
  1305. #==============================================================================
  1306.  
  1307. class Bitmap
  1308.  
  1309.   #----------------------------------------------------------------------------
  1310.   # gradient_bar
  1311.   #  x      - x coordinate
  1312.   #  y      - y coordinate
  1313.   #  w      - width of the bar to be drawn
  1314.   #  color1 - primary color
  1315.   #  color2 - secondary color
  1316.   #  color3 - back color
  1317.   #  rate   - fill rate
  1318.   #  This special method is able to draw one out of 7 styles.
  1319.   #----------------------------------------------------------------------------
  1320.   def gradient_bar(x, y, w, color1, color2, color3, rate, flag = false)
  1321.     # stop if not active or out of range
  1322.     return unless $game_system.BARS || flag
  1323.     return if $game_system.bar_style < 0 || $game_system.bar_style > 6
  1324.     # styles with "vertical" black borders
  1325.     styles = [1, 3, 4, 5, 6]
  1326.     # setup of coordinates and offsets depending on style
  1327.     offs = 5
  1328.     x += offs
  1329.     y += 26
  1330.     if styles.include?($game_system.bar_style)
  1331.       offs += 2
  1332.       y -= 1
  1333.       [5, 6].include?($game_system.bar_style) ? y -= 2 :  x += 1
  1334.       # quantizes the width so it looks better (remove it and see what happens)
  1335.       w = w / 8 * 8
  1336.     end
  1337.     # temporary variable
  1338.     a = $game_system.bar_opacity
  1339.     if $game_system.bar_style < 5
  1340.       # draw black slanted back
  1341.       (0...(offs+3)).each {|i| fill_rect(x-i, y+i-2, w+3, 1, Color.new(0, 0, 0))}
  1342.       # draw white slanted back onto black, but let black borders stay
  1343.       (0...(offs+1)).each {|i| fill_rect(x-i, y+i-1, w+1, 1, Color.new(255, 255, 255))}
  1344.       if $game_system.bar_style < 2
  1345.         # iterate through each vertical bar
  1346.         (0...w+offs).each {|i|
  1347.             # calculate color
  1348.             r = color3.red * i / (w+offs)
  1349.             g = color3.green * i / (w+offs)
  1350.             b = color3.blue * i / (w+offs)
  1351.             # special offset calculation
  1352.             oy = i < offs ? offs-i : 0
  1353.             off = i < offs ? i : i > w ? w+offs-i : offs
  1354.             # draw this part of the bar
  1355.             fill_rect(x+i-offs+1, y+oy-1, 1, off, Color.new(r, g, b, a))}
  1356.         # if slanted bar is out of critical area
  1357.         if (w*rate).to_i >= offs
  1358.           # draw the little triangular part on the left
  1359.           (0...((w*rate).to_i+offs)).each {|i|
  1360.               r = color1.red + (color2.red-color1.red)*i / ((w+offs)*rate)
  1361.               g = color1.green + (color2.green-color1.green)*i / ((w+offs)*rate)
  1362.               b = color1.blue + (color2.blue-color1.blue)*i / ((w+offs)*rate)
  1363.               oy = i < offs ? offs-i : 0
  1364.               off = i < offs ? i : i > w*rate ? (w*rate).to_i+offs-i : offs
  1365.               fill_rect(x+i-offs+1, y+oy-1, 1, off, Color.new(r, g, b, a))}
  1366.         else
  1367.           # draw the little triangular part on the left using special method
  1368.           (0...(w * rate).to_i).each {|i| (0...offs).each {|j|
  1369.               r = color1.red + (color2.red-color1.red)*i / (w*rate)
  1370.               g = color1.green + (color2.green-color1.green)*i / (w*rate)
  1371.               b = color1.blue + (color2.blue-color1.blue)*i / (w*rate)
  1372.               set_pixel(x+i-j+1, y+j-1, Color.new(r, g, b, a))}}
  1373.         end
  1374.       else
  1375.         # iterate through all horizontal lines
  1376.         (0...offs).each {|i|
  1377.             # calculate colors
  1378.             r = color3.red * i / offs
  1379.             g = color3.green * i / offs
  1380.             b = color3.blue * i / offs
  1381.             # draw background line
  1382.             fill_rect(x-i+1, y+i-1, w, 1, Color.new(r, g, b, a))}
  1383.         if $game_system.bar_style == 4
  1384.           # iterate through half of all horizontal lines
  1385.           (0...offs/2+1).each {|i|
  1386.               # calculate colors
  1387.               r = color2.red * (i+1) / (offs/2)
  1388.               g = color2.green * (i+1) / (offs/2)
  1389.               b = color2.blue * (i+1) / (offs/2)
  1390.               # draw bar line
  1391.               fill_rect(x-i+1, y+i-1, w*rate, 1, Color.new(r, g, b, a))
  1392.               # draw bar line mirrored vertically
  1393.               fill_rect(x-offs+i+2, y+offs-i-2, w*rate, 1, Color.new(r, g, b, a))}
  1394.         else
  1395.           # iterate through all horizontal lines
  1396.           (0...offs).each {|i|
  1397.               # calculate colors
  1398.               r = color1.red + (color2.red-color1.red)*i / offs
  1399.               g = color1.green + (color2.green-color1.green)*i / offs
  1400.               b = color1.blue + (color2.blue-color1.blue)*i / offs
  1401.               # draw bar line
  1402.               fill_rect(x-i+1, y+i-1, w*rate, 1, Color.new(r, g, b, a))}
  1403.         end
  1404.       end
  1405.       # if style with black vertical slanted intersections
  1406.       if styles.include?($game_system.bar_style)
  1407.         # add black bars on 1st and 8th column every 8 pixels
  1408.         (0...w).each {|i| (0...offs).each {|j|
  1409.             if styles.include?($game_system.bar_style) && i % 8 < 2
  1410.               set_pixel(x+i-j+1, y+j-1, Color.new(0, 0, 0, a))
  1411.             end}}
  1412.       end
  1413.     else
  1414.       # fill white background
  1415.       fill_rect(x+1, y-3, w+2, 12, Color.new(255, 255, 255, a))
  1416.       # iterate through each of 6 lines
  1417.       (1...6).each {|i|
  1418.           # calculate background color
  1419.           color = Color.new(color3.red*i/5, color3.green*i/5, color3.blue*i/5, a)
  1420.           # draw background
  1421.           fill_rect(x+2, y+i-3, w, 12-i*2, color)
  1422.           # calculate bar color
  1423.           color = Color.new(color2.red*i/5, color2.green*i/5, color2.blue*i/5, a)
  1424.           # draw bar
  1425.           fill_rect(x+2, y+i-3, w*rate, 12-i*2, color)}
  1426.       # if style 5 (with vertical borders)
  1427.       if $game_system.bar_style == 5
  1428.         # add black bars on 1st and 8th column every 8 pixels
  1429.         (0...w/8).each {|i|
  1430.             fill_rect(x+2+i*8, y-2, 1, 10, Color.new(0, 0, 0, a))
  1431.             fill_rect(x+2+(i+1)*8-1, y-2, 1, 10, Color.new(0, 0, 0, a))}
  1432.       end
  1433.     end
  1434.   end
  1435.  
  1436. end
  1437.  
  1438. #==============================================================================
  1439. # Window_Base
  1440. #==============================================================================
  1441.  
  1442. class Window_Base
  1443.  
  1444.   #----------------------------------------------------------------------------
  1445.   # draw_actor_hp
  1446.   #  actor - the actor
  1447.   #  x      - x coordinate
  1448.   #  y      - y coordinate
  1449.   #  w      - reserved max width
  1450.   #  Added fill rate calculation and bar drawing.
  1451.   #----------------------------------------------------------------------------
  1452.   alias draw_actor_hp_blizzart_later draw_actor_hp
  1453.   def draw_actor_hp(actor, x, y, w = 148)
  1454.     if $game_system.BARS
  1455.       # RTAB compatibility fix
  1456.       if !(defined? Window_DetailsStatus) || !self.is_a?(Window_DetailsStatus)
  1457.         w -= 12
  1458.       end
  1459.       # calculate bar fill rate
  1460.       rate = (actor.maxhp > 0 ? actor.hp.to_f / actor.maxhp : 0)
  1461.       # create colors depending on rate
  1462.       if rate > 0.6
  1463.         color1 = Color.new(80 - 150 * (rate-0.6), 80, 50 * (rate-0.6), 192)
  1464.         color2 = Color.new(240 - 450 * (rate-0.6), 240, 150 * (rate-0.6), 192)
  1465.       elsif rate > 0.2 && rate <= 0.6
  1466.         color1 = Color.new(80, 200 * (rate-0.2), 0, 192)
  1467.         color2 = Color.new(240, 600 * (rate-0.2), 0, 192)
  1468.       elsif rate <= 0.2
  1469.         color1 = Color.new(400 * rate, 0, 0, 192)
  1470.         color2 = Color.new(240, 0, 0, 192)
  1471.       end
  1472.       # background color
  1473.       color3 = Color.new(0, 80, 0, 192)
  1474.       # draw bar with coordinates and colors
  1475.       self.contents.gradient_bar(x, y, w, color1, color2, color3, rate)
  1476.       if $scene.is_a?(Scene_Battle)
  1477.         draw_actor_hp_blizzart_later(actor, x, y, w)
  1478.       else
  1479.         draw_actor_hp_blizzart_later(actor, x, y)
  1480.       end
  1481.     else
  1482.       draw_actor_hp_blizzart_later(actor, x, y, w)
  1483.     end
  1484.   end
  1485.   #----------------------------------------------------------------------------
  1486.   # draw_actor_sp
  1487.   #  actor - the actor
  1488.   #  x      - x coordinate
  1489.   #  y      - y coordinate
  1490.   #  w      - reserved max width
  1491.   #  Added fill rate calculation and bar drawing.
  1492.   #----------------------------------------------------------------------------
  1493.   alias draw_actor_sp_blizzart_later draw_actor_sp
  1494.   def draw_actor_sp(actor, x, y, w = 148)
  1495.     if $game_system.BARS
  1496.       # RTAB compatibility fix
  1497.       if !(defined? Window_DetailsStatus) || !self.is_a?(Window_DetailsStatus)
  1498.         w -= 12
  1499.       end
  1500.       # calculate bar fill rate
  1501.       rate = (actor.maxsp > 0 ? actor.sp.to_f / actor.maxsp : 0)
  1502.       # create colors depending on rate
  1503.       if rate > 0.4
  1504.         color1 = Color.new(60 - 66 * (rate-0.4), 20, 80, 192)
  1505.         color2 = Color.new(180 - 200 * (rate-0.4), 60, 240, 192)
  1506.       elsif rate <= 0.4
  1507.         color1 = Color.new(20 + 100 * rate, 50 * rate, 26 + 166 * rate, 192)
  1508.         color2 = Color.new(60 + 300 * rate, 150 * rate, 80 + 400 * rate, 192)
  1509.       end
  1510.       # background color
  1511.       color3 = Color.new(0, 0, 80, 192)
  1512.       # draw bar with coordinates and colors
  1513.       self.contents.gradient_bar(x, y, w, color1, color2, color3, rate)
  1514.       if $scene.is_a?(Scene_Battle)
  1515.         draw_actor_sp_blizzart_later(actor, x, y, w)
  1516.       else
  1517.         draw_actor_sp_blizzart_later(actor, x, y)
  1518.       end
  1519.     else
  1520.       draw_actor_sp_blizzart_later(actor, x, y, w)
  1521.     end
  1522.   end
  1523.   #----------------------------------------------------------------------------
  1524.   # draw_actor_exp
  1525.   #  actor - the actor
  1526.   #  x      - x coordinate
  1527.   #  y      - y coordinate
  1528.   #  w      - reserved max width
  1529.   #  Added fill rate calculation and bar drawing.
  1530.   #----------------------------------------------------------------------------
  1531.   alias draw_actor_exp_blizzart_later draw_actor_exp
  1532.   def draw_actor_exp(actor, x, y, w = 148)
  1533.     if $game_system.BARS
  1534.       w += 12
  1535.       # calculate bar fill rate
  1536.       rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
  1537.       # create colors depending on rate
  1538.       if rate < 0.5
  1539.         color1 = Color.new(20 * rate, 60, 80, 192)
  1540.         color2 = Color.new(60 * rate, 180, 240, 192)
  1541.       elsif rate >= 0.5
  1542.         color1 = Color.new(20 + 120 * (rate-0.5), 60 + 40 * (rate-0.5), 80, 192)
  1543.         color2 = Color.new(60 + 360 * (rate-0.5), 180 + 120 * (rate-0.5), 240, 192)
  1544.       end
  1545.       # background color
  1546.       color3 = Color.new(80, 80, 80, 192)
  1547.       # draw bar with coordinates and colors
  1548.       self.contents.gradient_bar(x, y, w, color1, color2, color3, rate)
  1549.     end
  1550.     draw_actor_exp_blizzart_later(actor, x, y)
  1551.   end
  1552.  
  1553. end
  1554.  
  1555. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1556. # Location Names with Pictures or Text by Blizzard
  1557. # Version: 2.21b
  1558. # Type: Game Playability Improvement
  1559. # Date: 14.11.2006
  1560. # Date v2.1b: 7.7.2007
  1561. # Date v2.11b: 30.7.2007
  1562. # Date v2.12b: 25.10.2007
  1563. # Date v2.13b: 5.11.2007
  1564. # Date v2.2b: 17.2.2008
  1565. # Date v2.21b: 17.2.2008
  1566. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1567. #
  1568. # NOTE: This script WILL corrupt old savegames!
  1569. #
  1570. # Instructions:
  1571. #  
  1572. #   Connect map IDs with picture names. All pictures MUST be in the the Names
  1573. #   folder in your picture folder. If you don't have a picture, the map name
  1574. #   will be written out using the default text engine from RMXP. Please set up
  1575. #   the font you wish the text to be displayed in this case.
  1576. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1577.  
  1578. LOCATION_FONT = 'Arial'
  1579. LOCATION_SIZE = 32
  1580. LOCATION_BOLD = true
  1581. LOCATION_ITALIC = false
  1582. LOCATION_COLOR = Color.new(255, 255, 255, 255) # Color.new(R, G, B, A)
  1583. LOCATION_DISPLAY_TIME = 2 # in seconds
  1584.  
  1585. #==============================================================================
  1586. # module BlizzCFG
  1587. #==============================================================================
  1588.  
  1589. module BlizzCFG
  1590.  
  1591.   def self.get_locimage
  1592.     case $game_map.map_id
  1593. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1594. # START Location Database
  1595. #
  1596. #   Use this template to configure this add-on:
  1597. #
  1598. #     when ID then name = 'FILE_NAME'
  1599. #  
  1600. #   ID        - map ID where the picture should be displayed
  1601. #   FILE_NAME - the file name of the picture file in the Pictures/Names folder
  1602. #
  1603. #   If you don't have a picture and want the name displayed anyway, please use:
  1604. #
  1605. #     when ID then name = nil
  1606. #
  1607. #   Instead of an image normal text will be displayed in the chosen font.
  1608. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1609.     when 1 then name = nil
  1610.     when 2 then name = 'MAP002_pic'
  1611. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1612. # END Location Database
  1613. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1614.     else
  1615.       return nil
  1616.     end
  1617.     # if text should be used
  1618.     if name == nil
  1619.       # create bitmap
  1620.       bitmap = Bitmap.new(320, LOCATION_SIZE + 16)
  1621.       # set up font style
  1622.       bitmap.font.name = LOCATION_FONT
  1623.       bitmap.font.size = LOCATION_SIZE
  1624.       bitmap.font.bold = LOCATION_BOLD
  1625.       bitmap.font.italic = LOCATION_ITALIC
  1626.       bitmap.font.color = LOCATION_COLOR
  1627.       # draw map name
  1628.       bitmap.draw_text(0, 8, bitmap.width-16, LOCATION_SIZE+8,
  1629.           $map_names[$game_map.map_id], 2)
  1630.     else
  1631.       # cache image file
  1632.       bitmap = RPG::Cache.picture("Names/#{name}")
  1633.     end
  1634.     return bitmap
  1635.   end
  1636.  
  1637. end  
  1638.  
  1639. #==============================================================================
  1640. # Game_System
  1641. #==============================================================================
  1642.  
  1643. class Game_System
  1644.  
  1645.   # setting all accessible variables
  1646.   attr_accessor :map_name_id
  1647.   attr_accessor :name_timer
  1648.   #----------------------------------------------------------------------------
  1649.   # initialize
  1650.   #  Added helping variables for convenience.
  1651.   #----------------------------------------------------------------------------
  1652.   alias init_names_later initialize_tons_of_addons
  1653.   def initialize_tons_of_addons
  1654.     init_names_later
  1655.     @map_name_id = @name_timer = 0
  1656.   end
  1657.  
  1658. end
  1659.  
  1660. #==============================================================================
  1661. # Name_Sprite
  1662. #==============================================================================
  1663.  
  1664. class Name_Sprite < Sprite
  1665.  
  1666.   # setting all accessible variables
  1667.   attr_accessor :timer
  1668.   #----------------------------------------------------------------------------
  1669.   # initialize
  1670.   #----------------------------------------------------------------------------
  1671.   def initialize(viewport = nil)
  1672.     super
  1673.     # set timer depending on if same map as when the last time
  1674.     if $game_system.map_name_id == $game_map.map_id
  1675.       @timer = $game_system.name_timer
  1676.     else
  1677.       @timer = 0
  1678.     end
  1679.     # if appearing
  1680.     if @timer < 16
  1681.       self.opacity = @timer * 15
  1682.     # if disappearing
  1683.     elsif @timer > 16 + 40 * LOCATION_DISPLAY_TIME
  1684.       self.opacity = 255 - (@timer - 16 - 40 * LOCATION_DISPLAY_TIME)* 15
  1685.     end
  1686.     # store this map as old map
  1687.     $game_system.map_name_id = $game_map.map_id
  1688.     self.z = 6000
  1689.     # get text image or image
  1690.     self.bitmap = BlizzCFG.get_locimage
  1691.     # set x coordinate or delete depending on whether bitmap exists
  1692.     self.bitmap == nil ? self.dispose : self.x = 640 - self.bitmap.width
  1693.   end
  1694.   #----------------------------------------------------------------------------
  1695.   # dispose
  1696.   #  Added storing of timer value before removing.
  1697.   #----------------------------------------------------------------------------
  1698.   def dispose
  1699.     $game_system.name_timer = @timer
  1700.     super
  1701.   end
  1702.  
  1703. end
  1704.  
  1705. #==============================================================================
  1706. # Spriteset_Map
  1707. #==============================================================================
  1708.  
  1709. class Spriteset_Map
  1710.  
  1711.   attr_accessor :name
  1712.   #----------------------------------------------------------------------------
  1713.   # initialize
  1714.   #  Added the name sprite.
  1715.   #----------------------------------------------------------------------------
  1716.   alias init_name_later initialize
  1717.   def initialize
  1718.     init_name_later
  1719.     @name = Name_Sprite.new(@viewport1) if $game_system.LOCATION_NAMES
  1720.   end
  1721.   #----------------------------------------------------------------------------
  1722.   # update
  1723.   #  Added name sprite appearing/disappearing animation control.
  1724.   #----------------------------------------------------------------------------
  1725.   alias upd_name_later update
  1726.   def update
  1727.     # if sprite exists
  1728.     if @name != nil
  1729.       # if sprite not disposed
  1730.       unless @name.disposed?
  1731.         @name.timer += 1
  1732.         # if appearing
  1733.         if @name.timer < 16
  1734.           @name.opacity += 15
  1735.         # if disappearing
  1736.         elsif @name.timer > 16 + 40 * LOCATION_DISPLAY_TIME
  1737.           @name.opacity -= 15
  1738.         end
  1739.         # if gone
  1740.         if @name.opacity == 0
  1741.           # remove completely
  1742.           @name.dispose
  1743.           @name = nil
  1744.         end
  1745.       else
  1746.         # set to nil
  1747.         @name = nil
  1748.       end
  1749.     end
  1750.     upd_name_later
  1751.   end
  1752.   #----------------------------------------------------------------------------
  1753.   # dispose
  1754.   #  Added name sprite removal.
  1755.   #----------------------------------------------------------------------------
  1756.   alias dispose_name_later dispose
  1757.   def dispose
  1758.     dispose_name_later
  1759.     unless @name == nil
  1760.       $game_system.name_timer = @name.timer
  1761.       @name.dispose
  1762.     end
  1763.     @name = nil
  1764.   end
  1765.  
  1766. end
  1767.  
  1768. #==============================================================================
  1769. # Scene_Title
  1770. #==============================================================================
  1771.  
  1772. class Scene_Title
  1773.  
  1774.   #----------------------------------------------------------------------------
  1775.   # main
  1776.   #  Added setup of names hash.
  1777.   #----------------------------------------------------------------------------
  1778.   alias main_location_later main
  1779.   def main
  1780.     $map_names = load_data('Data/MapInfos.rxdata')
  1781.     $map_names.each_key {|key| $map_names[key] = $map_names[key].name}
  1782.     main_location_later
  1783.   end
  1784.  
  1785. end
  1786.  
  1787. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1788. # Black Fade by Blizzard
  1789. # Version: 1.1b
  1790. # Type: Graphical Improvement
  1791. # Date: 28.4.2006
  1792. # Date v1.1b: 9.3.2006
  1793. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1794. #
  1795. # new in v1.1b:
  1796. #   - optional setting for black fade before battle
  1797. #
  1798. #
  1799. # Explanation:
  1800. #
  1801. #   Replaces the standard fading between maps with a black screen. Note that
  1802. #   this add-on is much less compatible than other add-ons and therefore it
  1803. #   might cause problems.
  1804. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1805.  
  1806. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1807. # START Configuration
  1808. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1809.  
  1810. MAP_FADE = true # execute black fade when changing maps
  1811. MAP_TRANSIT = 8 # how long does the transition take
  1812. MAP_BLACKTIME = 12 # how long does black screen stay
  1813. BATTLE_FADE = true # execute black fade when changing maps
  1814. BATTLE_TRANSIT = 20 # how long does the transition take
  1815. BATTLE_BLACKTIME = 12 # how long does black screen stay
  1816.  
  1817. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1818. # END Configuration
  1819. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1820.  
  1821. #==============================================================================
  1822. # Scene_Map
  1823. #==============================================================================
  1824.  
  1825. class Scene_Map
  1826.  
  1827.   #----------------------------------------------------------------------------
  1828.   # main
  1829.   #  Added additional commands for black fading.
  1830.   #----------------------------------------------------------------------------
  1831.   alias main_player_black_fade_later main
  1832.   def main
  1833.     main_player_black_fade_later
  1834.     if $game_system.BLACKFADE && BATTLE_FADE && $scene.is_a?(Scene_Battle)
  1835.       if $data_system.battle_transition == ''
  1836.         Graphics.transition(BATTLE_TRANSIT)
  1837.       else
  1838.         Graphics.transition(BATTLE_TRANSIT, 'Graphics/Transitions/' +
  1839.           $data_system.battle_transition)
  1840.       end
  1841.       Graphics.freeze
  1842.       Graphics.transition(BATTLE_BLACKTIME)
  1843.       Graphics.freeze
  1844.     end
  1845.   end
  1846.   #----------------------------------------------------------------------------
  1847.   # transfer_player
  1848.   #  Added additional commands for black fading.
  1849.   #----------------------------------------------------------------------------
  1850.   alias transfer_player_black_fade_later transfer_player
  1851.   def transfer_player
  1852.     unless $game_system.BLACKFADE && MAP_FADE
  1853.       transfer_player_black_fade_later
  1854.       return
  1855.     end
  1856.     # set transferring flag
  1857.     $game_temp.player_transferring = false
  1858.     # if new map is not the same map
  1859.     if $game_map.map_id != $game_temp.player_new_map_id
  1860.       $game_map.setup($game_temp.player_new_map_id)
  1861.     end
  1862.     $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
  1863.     case $game_temp.player_new_direction
  1864.     when 2 then $game_player.turn_down
  1865.     when 4 then $game_player.turn_left
  1866.     when 6 then $game_player.turn_right
  1867.     when 8 then $game_player.turn_up
  1868.     end
  1869.     $game_player.straighten
  1870.     $game_map.update
  1871.     Graphics.freeze if $game_temp.transition_processing # added
  1872.     @spriteset.dispose
  1873.     # added from here
  1874.     if $game_temp.transition_processing
  1875.       Graphics.transition(MAP_TRANSIT)
  1876.       Graphics.freeze
  1877.       Graphics.transition(MAP_BLACKTIME)
  1878.       Graphics.freeze
  1879.     end
  1880.     # to here
  1881.     @spriteset = Spriteset_Map.new
  1882.     if $game_temp.transition_processing
  1883.       $game_temp.transition_processing = false
  1884.       Graphics.transition(MAP_TRANSIT) # instead of 20 now MAP_TRANSIT
  1885.     end
  1886.     # play map BGM and BGS
  1887.     $game_map.autoplay
  1888.     Graphics.frame_reset
  1889.     Input.update
  1890.   end
  1891.  
  1892. end
  1893.  
  1894. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1895. # Simple Shaded Text by Blizzard
  1896. # Version: 2.0b
  1897. # Type: Text Readability Improvement
  1898. # Date: 2.7.2006
  1899. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1900.  
  1901. #==============================================================================
  1902. # Bitmap
  1903. #==============================================================================
  1904.  
  1905. class Bitmap
  1906.  
  1907.   #----------------------------------------------------------------------------
  1908.   # draw_text
  1909.   #  x2    - x coordinate or rectangle
  1910.   #  y2    - y coordinate or text
  1911.   #  w2    - width or align
  1912.   #  h2    - height
  1913.   #  text2 - the text to be drawn
  1914.   #  a2    - align
  1915.   #  Added additional drawing to make the text look like shaded.
  1916.   #----------------------------------------------------------------------------
  1917.   alias draw_text_shaded_later draw_text
  1918.   def draw_text(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
  1919.     # set coordinates whether x2 is rectangle
  1920.     if x2.is_a?(Rect)
  1921.       x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
  1922.     else
  1923.       x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
  1924.     end
  1925.     # if active
  1926.     if $game_system != nil && $game_system.SHADED_TEXT
  1927.       # store font color
  1928.       save_color = self.font.color.clone
  1929.       # set font color to black
  1930.       self.font.color = Color.new(0, 0, 0)
  1931.       # draw shade
  1932.       draw_text_shaded_later(x+1, y+1, w, h, text, a)
  1933.       # restore font color
  1934.       self.font.color = save_color
  1935.     end
  1936.     # draw normal text
  1937.     draw_text_shaded_later(x, y, w, h, text, a)
  1938.   end
  1939.   #----------------------------------------------------------------------------
  1940.   # draw_text_full
  1941.   #  x2    - x coordinate or rectangle
  1942.   #  y2    - y coordinate or text
  1943.   #  w2    - width or align
  1944.   #  h2    - height
  1945.   #  text2 - the text to be drawn
  1946.   #  a2    - align
  1947.   #  Draws outlines text.
  1948.   #----------------------------------------------------------------------------
  1949.   def draw_text_full(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
  1950.     # set coordinates whether x2 is rectangle
  1951.     if x2.is_a?(Rect)
  1952.       x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
  1953.     else
  1954.       x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
  1955.     end
  1956.     # store font color
  1957.     save_color = self.font.color.clone
  1958.     # set font color to black
  1959.     self.font.color = Color.new(0, 0, 0)
  1960.     # draw outline
  1961.     draw_text_shaded_later(x+1, y+1, w, h, text, a)
  1962.     draw_text_shaded_later(x-1, y+1, w, h, text, a)
  1963.     draw_text_shaded_later(x-1, y-1, w, h, text, a)
  1964.     draw_text_shaded_later(x+1, y-1, w, h, text, a)
  1965.     # restore font color
  1966.     self.font.color = save_color
  1967.     # draw normal text
  1968.     draw_text_shaded_later(x, y, w, h, text, a)
  1969.   end
  1970.  
  1971. end
  1972.  
  1973. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1974. # Blizz-Art lagless HUD by Blizzard
  1975. # Version: 1.43b
  1976. # Type: Game Playability Improvement
  1977. # Date: 16.12.2006
  1978. # Date v1.1b: 12.1.2007
  1979. # Date v1.2b: 11.3.2007
  1980. # Date v1.3b: 7.7.2007
  1981. # Date v1.4b: 17.2.2008
  1982. # Date v1.41b: 3.4.2008
  1983. # Date v1.42b: 22.8.2008
  1984. # Date v1.43b: 24.11.2008
  1985. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  1986. #
  1987. # IMPORTANT:
  1988. #
  1989. #   The "not simple" method of using this add-on REQUIRES Blizz-Art Gradient
  1990. #   styler for HP/SP/EXP bars. Blizz-ABS disables this add-on automatically and
  1991. #   uses the Blizz-ABS HUD system.
  1992. #
  1993. #
  1994. # Instructions:
  1995. #
  1996. #   This add-on will add a HUD into your game. Configure the part below. The
  1997. #   meanings of the variables are:
  1998. #
  1999. #     SIMPLE       - set this to false to use Blizz-Art Gradient styler instead
  2000. #                    of the normal bars
  2001. #     FULL_DISPLAY - set to true to show the stats of all party members in the
  2002. #                    display (otherwise hold D and press Q/W to cycle through
  2003. #                    the actors)
  2004. #     TOP          - set this value to false and the HUD will appear on the
  2005. #                    bottom
  2006. #  
  2007. #
  2008. # Side-Note:
  2009. #
  2010. #   This add-on comes BELOW the Gradient Styler. This HUD was made for an
  2011. #   infinite number of party members, but if using FULL_DISPLAY, only the first
  2012. #   4 members will be displayed.
  2013. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2014.  
  2015. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2016. # Start HUD Configuration
  2017. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2018.  
  2019. SIMPLE = true
  2020. FULL_DISPLAY = false
  2021. TOP = true
  2022.  
  2023. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2024. # End HUD Configuration
  2025. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2026.  
  2027. #==============================================================================
  2028. # Game_System
  2029. #==============================================================================
  2030.  
  2031. class Game_System
  2032.  
  2033.   attr_accessor :index
  2034.   attr_accessor :bar_style unless FULL_DISPLAY
  2035.   attr_reader   :bar_opacity
  2036.   #----------------------------------------------------------------------------
  2037.   # initialize
  2038.   #  Added variables for bar styles if Blizz-Art bars are being used.
  2039.   #----------------------------------------------------------------------------
  2040.   alias init_blizzart_hud_later initialize_tons_of_addons
  2041.   def initialize_tons_of_addons
  2042.     init_blizzart_hud_later
  2043.     @index = 0 unless FULL_DISPLAY
  2044.     unless $Blizz_Art
  2045. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2046. # START Configuration
  2047. #
  2048. #   Configure this part manually if you have no "Options" controller for the
  2049. #   styles and the opacity. (style: 0~5, opacity: 0~255)
  2050. #   Note that this WILL be overriden if you use Blizz-Art Gradient Styler.
  2051. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2052.       @bar_style = 5
  2053.       self.bar_opacity = 255
  2054. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2055. # END Configuration
  2056. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2057.     end
  2058.   end
  2059.  
  2060.   def bar_opacity=(alpha)
  2061.     @bar_opacity = [[alpha, 0].max, 255].min
  2062.   end
  2063.  
  2064. end
  2065.  
  2066. #==============================================================================
  2067. # Bitmap
  2068. #==============================================================================
  2069.  
  2070. class Bitmap
  2071.  
  2072.   #----------------------------------------------------------------------------
  2073.   # gradient_bar_simple
  2074.   #  x      - x coordinate
  2075.   #  y      - y coordinate
  2076.   #  w      - width of the bar to be drawn
  2077.   #  color1 - bar color
  2078.   #  color2 - back color
  2079.   #  rate   - fill rate
  2080.   #  Very fast method to draw the 7th style from Blizz-Art.
  2081.   #----------------------------------------------------------------------------
  2082.   def gradient_bar_simple(x, y, w, color1, color2, rate)
  2083.     # quantizes the width so it looks better (remove it and see what happens)
  2084.     w = w / 8 * 8
  2085.     alpha = $game_system.bar_opacity || 255
  2086.     # iterate through each of 6 lines
  2087.     (1..6).each {|i|
  2088.         # calculate background color
  2089.         color = Color.new(color2.red*i/6, color2.green*i/6, color2.blue*i/6, alpha)
  2090.         # draw background
  2091.         fill_rect(x + 2, y + i, w, 14 - i * 2, color)
  2092.         # calculate bar color
  2093.         color = Color.new(color1.red*i/6, color1.green*i/6, color1.blue*i/6, alpha)
  2094.         # draw bar
  2095.         fill_rect(x + 2, y + i, w * rate, 14 - i * 2, color)}
  2096.   end
  2097.   # if not defined already
  2098.   unless $Blizz_Art
  2099.   #----------------------------------------------------------------------------
  2100.   # draw_text
  2101.   #  x2    - x coordinate or rectangle
  2102.   #  y2    - y coordinate or text
  2103.   #  w2    - width or align
  2104.   #  h2    - height
  2105.   #  text2 - the text to be drawn
  2106.   #  a2    - align
  2107.   #  Added additional drawing to make the text look like shaded.
  2108.   #----------------------------------------------------------------------------
  2109.   alias draw_text_shaded_later draw_text
  2110.   def draw_text(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
  2111.     # set coordinates whether x2 is rectangle
  2112.     if x2.is_a?(Rect)
  2113.       x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
  2114.     else
  2115.       x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
  2116.     end
  2117.     # if active
  2118.     if $game_system != nil && $game_system.SHADED_TEXT
  2119.       # store font color
  2120.       save_color = self.font.color.clone
  2121.       # set font color to black
  2122.       self.font.color = Color.new(0, 0, 0)
  2123.       # draw shade
  2124.       draw_text_shaded_later(x+1, y+1, w, h, text, a)
  2125.       # restore font color
  2126.       self.font.color = save_color
  2127.     end
  2128.     # draw normal text
  2129.     draw_text_shaded_later(x, y, w, h, text, a)
  2130.   end
  2131.   #----------------------------------------------------------------------------
  2132.   # draw_text_full
  2133.   #  x2    - x coordinate or rectangle
  2134.   #  y2    - y coordinate or text
  2135.   #  w2    - width or align
  2136.   #  h2    - height
  2137.   #  text2 - the text to be drawn
  2138.   #  a2    - align
  2139.   #  Draws outlines text.
  2140.   #----------------------------------------------------------------------------
  2141.   def draw_text_full(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
  2142.     # set coordinates whether x2 is rectangle
  2143.     if x2.is_a?(Rect)
  2144.       x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
  2145.     else
  2146.       x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
  2147.     end
  2148.     # store font color
  2149.     save_color = self.font.color.clone
  2150.     # set font color to black
  2151.     self.font.color = Color.new(0, 0, 0)
  2152.     # draw outline
  2153.     draw_text_shaded_later(x+1, y+1, w, h, text, a)
  2154.     draw_text_shaded_later(x-1, y+1, w, h, text, a)
  2155.     draw_text_shaded_later(x-1, y-1, w, h, text, a)
  2156.     draw_text_shaded_later(x+1, y-1, w, h, text, a)
  2157.     # restore font color
  2158.     self.font.color = save_color
  2159.     # draw normal text
  2160.     draw_text_shaded_later(x, y, w, h, text, a)
  2161.   end
  2162.   end
  2163.  
  2164. end
  2165.  
  2166. #==============================================================================
  2167. # Window_Base
  2168. #==============================================================================
  2169.  
  2170. class Window_Base
  2171.  
  2172.   #----------------------------------------------------------------------------
  2173.   # draw_actor_exp_alt
  2174.   #  actor - actor
  2175.   #  x     - x coordinate or rectangle
  2176.   #  y     - y coordinate or text
  2177.   #  Draw the "EXP needed for next level" text.
  2178.   #----------------------------------------------------------------------------
  2179.   def draw_actor_exp_alt(actor, x, y)
  2180.     # set color and draw "next"
  2181.     self.contents.font.color = system_color
  2182.     self.contents.draw_text(x, y, 64, 32, 'next')
  2183.     # set color and draw value
  2184.     self.contents.font.color = normal_color
  2185.     self.contents.draw_text(x + 56, y, 84, 32, actor.next_rest_exp_s, 2)
  2186.   end
  2187.   #----------------------------------------------------------------------------
  2188.   # draw_actor_exp_alt
  2189.   #  actor - actor
  2190.   #  x     - x coordinate or rectangle
  2191.   #  y     - y coordinate or text
  2192.   #  w     - width of the bar
  2193.   #  Added fill rate calculation and bar drawing.
  2194.   #----------------------------------------------------------------------------
  2195.   alias draw_actor_exp_alt_blizzart_hud_later draw_actor_exp_alt
  2196.   def draw_actor_exp_alt(actor, x, y, w = 148)
  2197.     w -= 12
  2198.     # calculate fill rate
  2199.     rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
  2200.     # create color depending on fill rate
  2201.     if rate < 0.5
  2202.       color1 = Color.new(20 * rate, 60, 80, 192)
  2203.       color2 = Color.new(60 * rate, 180, 240, 192)
  2204.     elsif rate >= 0.5
  2205.       color1 = Color.new(20 + 120 * (rate-0.5), 60 + 40 * (rate-0.5), 80, 192)
  2206.       color2 = Color.new(60 + 360 * (rate-0.5), 180 + 120 * (rate-0.5), 240, 192)
  2207.     end
  2208.     # background color
  2209.     color3 = Color.new(80, 80, 80, 192)
  2210.     # draw bar
  2211.     self.contents.gradient_bar(x, y, w, color1, color2, color3, rate)
  2212.     draw_actor_exp_alt_blizzart_hud_later(actor, x, y)
  2213.   end
  2214.   #----------------------------------------------------------------------------
  2215.   # draw_actor_hp_hud
  2216.   #  actor - actor
  2217.   #  x     - x coordinate or rectangle
  2218.   #  y     - y coordinate or text
  2219.   #  w     - width of the bar
  2220.   #  This method calculates the fill rate and draws the bar in the HUD for HP.
  2221.   #----------------------------------------------------------------------------
  2222.   def draw_actor_hp_hud(actor, x, y, w = 148)
  2223.     # calculate fill rate
  2224.     rate = (actor.maxhp > 0 ? actor.hp.to_f / actor.maxhp : 0)
  2225.     # create color depending on fill rate
  2226.     if rate > 0.6
  2227.       color1 = Color.new(240 - 450 * (rate-0.6), 240, 150 * (rate-0.6), 192)
  2228.     elsif rate > 0.2 && rate <= 0.6
  2229.       color1 = Color.new(240, 600 * (rate-0.2), 0, 192)
  2230.     elsif rate <= 0.2
  2231.       color1 = Color.new(240, 0, 0, 192)
  2232.     end
  2233.     # background color
  2234.     color2 = Color.new(0, 80, 0, 192)
  2235.     # draw bar
  2236.     self.contents.gradient_bar_simple(x + 32, y, w - 48, color1, color2, rate)
  2237.     # fix y coordinate
  2238.     y -= 9
  2239.     self.contents.font.color = system_color
  2240.     # draw HP word
  2241.     self.contents.draw_text_full(x, y, 32, 32, $data_system.words.hp)
  2242.     # set offset
  2243.     hp_x = x + w - 122
  2244.     # set colors and draw values
  2245.     self.contents.font.color = actor.hp == 0 ? knockout_color :
  2246.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  2247.     self.contents.draw_text_full(hp_x, y, 48, 32, actor.hp.to_s, 2)
  2248.     self.contents.font.color = normal_color
  2249.     self.contents.draw_text_full(hp_x + 48, y, 12, 32, '/', 1)
  2250.     self.contents.draw_text_full(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
  2251.     self.contents.font.color.alpha = 255
  2252.   end
  2253.   #----------------------------------------------------------------------------
  2254.   # draw_actor_sp_hud
  2255.   #  actor - actor
  2256.   #  x     - x coordinate or rectangle
  2257.   #  y     - y coordinate or text
  2258.   #  w     - width of the bar
  2259.   #  This method calculates the fill rate and draws the bar in the HUD for SP.
  2260.   #----------------------------------------------------------------------------
  2261.   def draw_actor_sp_hud(actor, x, y, w = 148)
  2262.     # calculate fill rate
  2263.     rate = (actor.maxsp > 0 ? actor.sp.to_f / actor.maxsp : 0)
  2264.     # create color depending on fill rate
  2265.     if rate > 0.4
  2266.       color1 = Color.new(180 - 200 * (rate-0.4), 60, 240, 192)
  2267.     elsif rate <= 0.4
  2268.       color1 = Color.new(60 + 300 * rate, 150 * rate, 80 + 400 * rate, 192)
  2269.     end
  2270.     # background color
  2271.     color2 = Color.new(0, 0, 80, 192)
  2272.     # draw bar
  2273.     self.contents.gradient_bar_simple(x + 32, y, w - 48, color1, color2, rate)
  2274.     # fix y coordinate
  2275.     y -= 9
  2276.     self.contents.font.color = system_color
  2277.     # draw SP word
  2278.     self.contents.draw_text_full(x, y, 32, 32, $data_system.words.sp)
  2279.     # set offset
  2280.     sp_x = x + w - 122
  2281.     # set colors and draw values
  2282.     self.contents.font.color = actor.sp == 0 ? knockout_color :
  2283.       actor.sp <= actor.maxhp / 4 ? crisis_color : normal_color
  2284.     self.contents.draw_text_full(sp_x, y, 48, 32, actor.sp.to_s, 2)
  2285.     self.contents.font.color = normal_color
  2286.     self.contents.draw_text_full(sp_x + 48, y, 12, 32, '/', 1)
  2287.     self.contents.draw_text_full(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
  2288.   end
  2289.   #----------------------------------------------------------------------------
  2290.   # draw_actor_exp_hud
  2291.   #  actor - actor
  2292.   #  x     - x coordinate or rectangle
  2293.   #  y     - y coordinate or text
  2294.   #  w     - width of the bar
  2295.   #  This method calculates the fill rate and draws the bar in the HUD for EXP.
  2296.   #----------------------------------------------------------------------------
  2297.   def draw_actor_exp_hud(actor, x, y, w = 148)
  2298.     # calculate fill rate
  2299.     rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
  2300.     # create color depending on fill rate
  2301.     if rate < 0.5
  2302.       color1 = Color.new(60 * rate, 180, 240, 192)
  2303.     elsif rate >= 0.5
  2304.       color1 = Color.new(60 + 360 * (rate-0.5), 180 + 120 * (rate-0.5), 240, 192)
  2305.     end
  2306.     # background color
  2307.     color2 = Color.new(80, 80, 80, 192)
  2308.     # draw bar
  2309.     self.contents.gradient_bar_simple(x + 32, y, w - 48, color1, color2, rate)
  2310.     # fix y coordinate
  2311.     y -= 9
  2312.     self.contents.font.color = system_color
  2313.     # draw "next"
  2314.     self.contents.draw_text_full(x, y, 80, 32, 'next')
  2315.     self.contents.font.color = normal_color
  2316.     # draw value
  2317.     self.contents.draw_text_full(x + 56, y, 84, 32, actor.next_rest_exp_s, 2)
  2318.     self.contents.font.color.alpha = 255
  2319.   end
  2320.  
  2321. end
  2322.  
  2323. #==============================================================================
  2324. # Game_Actor
  2325. #==============================================================================
  2326.  
  2327. class Game_Actor
  2328.  
  2329.   #----------------------------------------------------------------------------
  2330.   # now_exp
  2331.   #  Returns the EXP collected in this level.
  2332.   #----------------------------------------------------------------------------
  2333.   def now_exp
  2334.     return @exp - @exp_list[@level]
  2335.   end
  2336.   #----------------------------------------------------------------------------
  2337.   # next_exp
  2338.   #  Returns the EXP needed to level up as number.
  2339.   #----------------------------------------------------------------------------
  2340.   def next_exp
  2341.     return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  2342.   end
  2343.  
  2344. end
  2345.  
  2346. #==============================================================================
  2347. # Hud
  2348. #==============================================================================
  2349.  
  2350. class Hud < Window_Base
  2351.  
  2352.   #----------------------------------------------------------------------------
  2353.   # initialize
  2354.   #----------------------------------------------------------------------------
  2355.   def initialize
  2356.     super(-12, -16, 192, 112)
  2357.     # invisible background
  2358.     self.opacity = 0
  2359.     # if not on top position
  2360.     unless TOP
  2361.       # move down
  2362.       self.y += 400
  2363.       # move up a bit if not SIMPLE mode
  2364.       self.y -= 16 unless SIMPLE
  2365.     end
  2366.     # increase height if not SIMPLE mode
  2367.     self.height += 32 unless SIMPLE
  2368.     self.z = 5000
  2369.     refresh
  2370.   end
  2371.   #----------------------------------------------------------------------------
  2372.   # refresh
  2373.   #  Draws all the details.
  2374.   #----------------------------------------------------------------------------
  2375.   def refresh
  2376.     # remove bitmap if already existing
  2377.     if self.contents != nil
  2378.       self.contents.dispose
  2379.       self.contents = nil
  2380.     end
  2381.     # change width
  2382.     self.width = FULL_DISPLAY ? 32 + 160 * $game_party.actors.size : 192
  2383.     # create new bitmap
  2384.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  2385.     # set font style
  2386.     self.contents.font.name = 'Arial'
  2387.     self.contents.font.size = 16
  2388.     self.contents.font.bold = true
  2389.     # initialize data
  2390.     @names, @levels, @hps, @sps, @exps = [], [], [], [], []
  2391.     # iterate through all actor indices
  2392.     $game_party.actors.each_index {|i|
  2393.         # get actor depending on FULL_DISPLAY option
  2394.         actor = $game_party.actors[(FULL_DISPLAY ? i : $game_system.index)]
  2395.         # set style and draw name
  2396.         self.contents.font.italic = true
  2397.         self.contents.font.size += 2
  2398.         self.contents.font.color = system_color
  2399.         self.contents.draw_text(i*160, -8, 152, 32, actor.name, 1)
  2400.         # reset style
  2401.         self.contents.font.italic = false
  2402.         if SIMPLE
  2403.           # draw other HP, SP and EXP on HUD
  2404.           self.contents.font.size -= 2
  2405.           draw_actor_hp_hud(actor, i*160, 16, 160)
  2406.           draw_actor_sp_hud(actor, i*160, 32, 160)
  2407.           draw_actor_exp_hud(actor, i*160, 48, 160)
  2408.         else
  2409.           # draw other HP, SP and EXP on HUD using Blizz-Art
  2410.           draw_actor_hp(actor, i*160, 8, 160)
  2411.           draw_actor_sp(actor, i*160, 32, 160)
  2412.           draw_actor_exp_alt(actor, i*160, 56, 160)
  2413.           self.contents.font.size -= 2
  2414.         end}
  2415.     # draw gold text
  2416.     self.contents.font.color = Color.new(255, 255, 0)
  2417.     self.contents.draw_text(0, (SIMPLE ? 56 : 84), 148, 32, $data_system.words.gold)
  2418.     self.contents.draw_text(0, (SIMPLE ? 56 : 84), 148, 32, $game_party.gold.to_s, 2)
  2419.     # iterate through all party members and add stats to data arrays
  2420.     $game_party.actors.each {|actor|
  2421.         @names.push(actor.name)
  2422.         @levels.push(actor.level)
  2423.         @hps.push(actor.hp)
  2424.         @sps.push(actor.sp)
  2425.         @exps.push(actor.exp)}
  2426.     @gold = $game_party.gold
  2427.   end
  2428.   #----------------------------------------------------------------------------
  2429.   # test_changed
  2430.   #  Tests if the HUD should be redrawn.
  2431.   #----------------------------------------------------------------------------
  2432.   def test_changes
  2433.     # draw if gold had changed
  2434.     return true if $game_party.gold != @gold
  2435.     # if all actors on HUD
  2436.     if FULL_DISPLAY
  2437.       # draw if any actor has changes
  2438.       $game_party.actors.each_index {|i|
  2439.           actor = $game_party.actors[i]
  2440.           if actor.name != @names[i] || actor.level != @levels[i] ||
  2441.               actor.hp != @hps[i] || actor.sp != @sps[i]
  2442.             return true
  2443.           end}
  2444.     else
  2445.       # draw if current actor had changes
  2446.       actor = $game_party.actors[$game_system.index]
  2447.       if actor.name != @names[$game_system.index] ||
  2448.           actor.level != @levels[$game_system.index] ||
  2449.           actor.hp != @hps[$game_system.index] ||
  2450.           actor.sp != @sps[$game_system.index]
  2451.         return true
  2452.       end
  2453.     end
  2454.     return false
  2455.   end
  2456.  
  2457. end
  2458.  
  2459. #==============================================================================
  2460. # Scene_Map
  2461. #==============================================================================
  2462.  
  2463. class Scene_Map
  2464.  
  2465.   #----------------------------------------------------------------------------
  2466.   # main
  2467.   #  Added HUD window creation.
  2468.   #----------------------------------------------------------------------------
  2469.   alias main_blizzart_hud_later main
  2470.   def main
  2471.     if (!$BlizzABS || BlizzABS::VERSION < 1.01) && $game_system.HUD
  2472.       @hud = Hud.new
  2473.     end
  2474.     main_blizzart_hud_later
  2475.     @hud.dispose unless @hud == nil || @hud.disposed?
  2476.   end
  2477.   #----------------------------------------------------------------------------
  2478.   # update
  2479.   #  Added HUD handling.
  2480.   #----------------------------------------------------------------------------
  2481.   alias upd_blizzart_hud_later update
  2482.   def update
  2483.     # skip if Blizz-ABS enabled
  2484.     if !$BlizzABS || BlizzABS::VERSION < 1.01
  2485.       # if HUD active
  2486.       if $game_system.HUD
  2487.         # create new if not existing
  2488.         @hud = Hud.new if @hud == nil
  2489.       # if HUD exists
  2490.       elsif @hud != nil
  2491.         # remove HUD
  2492.         @hud.dispose
  2493.         @hud = nil
  2494.       end
  2495.       # if HUD still exists
  2496.       if @hud != nil
  2497.         # change display depenging on button input
  2498.         if Input.press?(Input::Z) && Input.trigger?(Input::L)
  2499.           $game_system.index += $game_party.actors.size - 1
  2500.           $game_system.index %= $game_party.actors.size
  2501.           @hud.refresh
  2502.         elsif Input.press?(Input::Z) && Input.trigger?(Input::R)
  2503.           $game_system.index += 1
  2504.           $game_system.index %= $game_party.actors.size
  2505.           @hud.refresh
  2506.         elsif @hud.test_changes
  2507.           @hud.refresh
  2508.         end
  2509.       end
  2510.     end
  2511.     upd_blizzart_hud_later
  2512.   end
  2513.  
  2514. end
  2515.  
  2516. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2517. # Screen Tremble by Blizzard
  2518. # Version: 1.1b
  2519. # Type: Game Experience Improvement
  2520. # Date: 22.1.2007
  2521. # Date v1.0b: 24.1.2007
  2522. # Date v1.1b: 1.2.2007
  2523. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2524. #
  2525. # new in v1.0b:
  2526. #   - improved code and better method of shaking the screen apart
  2527. #   - now beta
  2528. #
  2529. # new in v1.1b:
  2530. #   - improved code and better method of shaking the screen apart
  2531. #
  2532. #
  2533. # Compatibility:
  2534. #
  2535. #   98% compatible with SDK v1.x. 90% compatible with SDK v2.x. WILL corrupt
  2536. #   old savegames. Might glitch with exotic CBS-es or exotic Map modifications.
  2537. #
  2538. #
  2539. # Explanation:
  2540. #
  2541. #   This add-on will add an advanced feature of screen shaking:
  2542. #   Vertical shaking!
  2543. #
  2544. #
  2545. # Configuration:
  2546. #
  2547. #   Change TREMBLE_SWITCH to a switch ID number. Turn this switch on to enable
  2548. #   vertical screen-shaking. You MUST have screen shaking turned on. This
  2549. #   add-on will not work if no screen shaking is activated at all. You can't
  2550. #   have only vertical screen shaking.
  2551. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2552.  
  2553. TREMBLE_SWITCH = 189
  2554.  
  2555. #==============================================================================
  2556. # Game_Screen
  2557. #==============================================================================
  2558.  
  2559. class Game_Screen
  2560.  
  2561.   attr_reader :tremble
  2562.  
  2563.   alias init_tremble_later initialize
  2564.   def initialize
  2565.     init_tremble_later
  2566.     @tremble, @tremble_power, @tremble_direction = 0, 0, 1
  2567.   end
  2568.  
  2569.   alias upd_tremble_later update
  2570.   def update
  2571.     upd_tremble_later
  2572.     if $game_system.TREMBLE && $game_switches[TREMBLE_SWITCH] &&
  2573.         (@shake_duration >= 1 || @tremble != 0)
  2574.       @tremble ||= 0
  2575.       @tremble_power ||= 0
  2576.       @tremble_direction ||= 1
  2577.       delta = (@tremble_power * (@shake_speed + 1) * @tremble_direction) / 10.0
  2578.       if @shake_duration <= 1 && @tremble * (@tremble + delta) < 0
  2579.         @tremble = 0
  2580.       else
  2581.         @tremble += delta
  2582.       end
  2583.       if @tremble > @tremble_power * 1.5
  2584.         @tremble_direction = -1
  2585.       elsif @tremble < -@tremble_power * 1.5
  2586.         @tremble_direction = 1
  2587.       end
  2588.       @shake_duration -= 1 if @shake_duration >= 1
  2589.     end
  2590.   end
  2591.  
  2592.   alias start_tremble start_shake
  2593.   def start_shake(power, speed, duration)
  2594.     start_tremble(power, speed, duration)
  2595.     @tremble_power = power * 8 / 7 if $game_switches[TREMBLE_SWITCH]
  2596.   end
  2597.  
  2598. end
  2599.  
  2600. #==============================================================================
  2601. # Spriteset_Map
  2602. #==============================================================================
  2603.  
  2604. class Spriteset_Map
  2605.  
  2606.   alias upd_tremble_later update
  2607.   def update
  2608.     @viewport1.oy = ($game_switches[TREMBLE_SWITCH] ? $game_screen.tremble : 0)||0
  2609.     upd_tremble_later
  2610.   end
  2611.  
  2612. end
  2613.  
  2614. #==============================================================================
  2615. # Spriteset_Battle
  2616. #==============================================================================
  2617.  
  2618. class Spriteset_Battle
  2619.  
  2620.   alias upd_tremble_later update
  2621.   def update
  2622.     @viewport1.oy = ($game_switches[TREMBLE_SWITCH] ? $game_screen.tremble : 0)||0
  2623.     upd_tremble_later
  2624.   end
  2625.  
  2626. end
  2627.  
  2628. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2629. # Animation Stack by Blizzard
  2630. # Version: 1.0
  2631. # Type: Battle Graphic Improvement
  2632. # Date: 1.2.2007
  2633. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2634. #
  2635. # This add-on will make the display of all status effect animations possible.
  2636. #
  2637. # LOOPS - set this value to the number of how many time an animation should
  2638. #         loop before the next one is being displayed
  2639. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2640.  
  2641. LOOPS = 3
  2642.  
  2643. #==============================================================================
  2644. # Game_Battler
  2645. #==============================================================================
  2646.  
  2647. class Game_Battler
  2648.  
  2649.  
  2650.   alias state_animation_id_anima_stack_later state_animation_id
  2651.   def state_animation_id
  2652.     if $game_system.ANIMATION_STACK
  2653.       if @states.size == 0
  2654.         @anima_count = @anima_index = 0
  2655.         return 0
  2656.       end
  2657.       size = 0
  2658.       @anima_count ||= 0
  2659.       @anima_index ||= 0
  2660.       loop do
  2661.         @anima_index %= @states.size
  2662.         state = $data_states[@states[@anima_index]]
  2663.         break unless $data_animations[state.animation_id] == nil
  2664.         @anima_index += 1
  2665.         size += 1
  2666.         return 0 if size == @states.size
  2667.       end
  2668.       state = $data_states[@states[@anima_index]]
  2669.       if @anima_count > 2*LOOPS*$data_animations[state.animation_id].frame_max
  2670.         @anima_count = 0
  2671.         @anima_index += 1
  2672.       else
  2673.         @anima_count += 1
  2674.       end
  2675.       return state.animation_id
  2676.     end
  2677.     return state_animation_id_anima_stack_later
  2678.   end
  2679.  
  2680. end
  2681.  
  2682. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2683. # Simple Facesets by Blizzard
  2684. # Version: 1.01b
  2685. # Type: Menu Graphic Alteration
  2686. # Date: 18.2.2007
  2687. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2688. #
  2689. # Explanation:
  2690. #
  2691. #   This little add-on will change the spritesets in the main menu to facesets
  2692. #   or any other pictures you might be using. Name the pictures exactly like
  2693. #   the spritesets and add _face to their name. Put them into the "Characters"
  2694. #   folder. Size is not fixed, the script will put it into the correct place,
  2695. #   it's up to you to find the right size.
  2696. #
  2697. # Note:
  2698. #
  2699. #   This might not be compatible with exotic CMS-es.
  2700. #==============================================================================
  2701.  
  2702. FACE_HUE = false # set it to true to apply the same hue as the spriteset
  2703.  
  2704. #==============================================================================
  2705. # Window_Base
  2706. #==============================================================================
  2707.  
  2708. class Window_Base
  2709.  
  2710.   alias draw_actor_graphic_faces_later draw_actor_graphic
  2711.   def draw_actor_graphic(actor, x, y)
  2712.     if $game_system.FACESETS && self.is_a?(Window_MenuStatus)
  2713.       if actor != nil && actor.character_name != ''
  2714.         draw_actor_face(actor, x, y)
  2715.       end
  2716.     else
  2717.       draw_actor_graphic_faces_later(actor, x, y)
  2718.     end
  2719.   end
  2720.  
  2721.   def draw_actor_face(actor, x, y)
  2722.     hue = (FACE_HUE ? actor.character_hue : 0)
  2723.     bitmap = RPG::Cache.character("#{actor.character_name}_face", hue)
  2724.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  2725.     self.contents.blt(x-bitmap.width/2, y-bitmap.height/2, bitmap, src_rect)
  2726.   end
  2727.  
  2728. end
  2729.  
  2730. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2731. # Caterpillar by Blizzard
  2732. # Version: 2.21b
  2733. # Type: Game Experience Improvement
  2734. # Date: 7.3.2007
  2735. # Date v1.01b: 7.3.2007
  2736. # Date v2.0: 7.8.2007
  2737. # Date v2.0b: 8.8.2007
  2738. # Date v2.1b: 17.2.2008
  2739. # Date v2.11b: 22.2.2008
  2740. # Date v2.2b: 1.11.2008
  2741. # Date v2.21b: 13.10.2009
  2742. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2743. #
  2744. # new in v1.01b:
  2745. #   - now events can't go through your party members anymore
  2746. #
  2747. # new in v2.0:
  2748. #   - completely overworked and improved
  2749. #
  2750. # new in v2.0b:
  2751. #   - improved coding and made it work more convenient
  2752. #   - fixed a few glitches
  2753. #   - added DEAD_DISPLAY option
  2754. #   - removed stop animation override upon the player character
  2755. #
  2756. # new in v2.1b:
  2757. #   - fixed bug where an empty party would cause a crash
  2758. #
  2759. # new in v2.11b:
  2760. #   - fixed a minor compatibility glitch with Blizz-ABS
  2761. #
  2762. # new in v2.2b:
  2763. #   - improved coding and made it work more convenient
  2764. #   - fixed the bug where deactivating the caterpillar wouldn't work properly
  2765. #
  2766. # new in v2.21b:
  2767. #   - player graphic can now be changed normally if this add-on isn't being
  2768. #     used
  2769. #
  2770. #
  2771. # Compatibility:
  2772. #
  2773. #   93% compatible with SDK v1.x. 60% compatible with SDK v2.x. You might
  2774. #   experience problems with pixel movement scripts or map graphic manipulating
  2775. #   scripts. Blizz-ABS disables this add-on automatically and uses the
  2776. #   Blizz-ABS Caterpillar system.
  2777. #
  2778. #
  2779. # Features:
  2780. #
  2781. #   - your party members follow you on the map
  2782. #   - less code than other caterpillar scripts
  2783. #   - use $game_player.update_buffer('reset') if you need all party members to
  2784. #     gather around the player
  2785. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2786.  
  2787. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2788. # START Configuration
  2789. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2790.  
  2791. # max number of party members
  2792. MAX_PARTY = 4
  2793. # actor IDs where the actor is animated even when not walking
  2794. ANIMATED_IDS = []
  2795. # 0 - shows all characters; 1 - shows "ghosts"; 2 - removes from caterpillar
  2796. DEAD_DISPLAY = 1
  2797.  
  2798. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2799. # END Configuration
  2800. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2801.  
  2802. #==============================================================================
  2803. # Game_Character
  2804. #==============================================================================
  2805.    
  2806. class Game_Character
  2807.  
  2808.   alias passable_caterpillar_later? passable?
  2809.   def passable?(x, y, d)
  2810.     result = passable_caterpillar_later?(x, y, d)
  2811.     return result if $BlizzABS && BlizzABS::VERSION >= 1.01
  2812.     return result if self.is_a?(Game_Player) || self.is_a?(Game_Member)
  2813.     new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
  2814.     new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
  2815.     unless @through
  2816.       $game_player.members.each {|member|
  2817.           if member.character_name != '' && member.x == new_x && member.y == new_y
  2818.             return false
  2819.           end}
  2820.     end
  2821.     return result
  2822.   end
  2823.  
  2824. end
  2825.  
  2826. #==============================================================================
  2827. # Game_Player
  2828. #==============================================================================
  2829.    
  2830. class Game_Player
  2831.  
  2832.   attr_reader :members
  2833.   attr_reader :move_speed
  2834.  
  2835.  
  2836.   def members
  2837.     if @members.nil?
  2838.       @members = []
  2839.       (1...MAX_PARTY).each {|i| @members.push(Game_Member.new(i))} unless $BlizzABS
  2840.     end
  2841.     @members
  2842.   end
  2843.    
  2844.   alias upd_caterpillar_later update
  2845.   def update
  2846.     upd_caterpillar_later
  2847.     members.each {|member| member.update}
  2848.     if $game_system.CATERPILLAR
  2849.       refresh if DEAD_DISPLAY > 0
  2850.       @step_anime = true if ANIMATED_IDS.include?(actor.id)
  2851.     end
  2852.   end
  2853.  
  2854.   alias straighten_caterpillar_later straighten
  2855.   def straighten
  2856.     straighten_caterpillar_later
  2857.     members.each {|member| member.straighten}
  2858.   end
  2859.  
  2860.   alias refresh_caterpillar refresh
  2861.   def refresh
  2862.     unless $game_system.CATERPILLAR
  2863.       refresh_caterpillar
  2864.       return
  2865.     end
  2866.     act, $game_party.actors[0] = $game_party.actors[0], actor
  2867.     $game_party.actors.pop if $game_party.actors[0] == nil
  2868.     refresh_caterpillar
  2869.     return if actor == nil
  2870.     $game_party.actors[0] = act
  2871.     if actor.dead? && DEAD_DISPLAY == 1
  2872.       @opacity = Graphics.frame_count % 4 / 2 * 255
  2873.       @blend_type = 1
  2874.     end
  2875.   end
  2876.  
  2877.   def actor
  2878.     if DEAD_DISPLAY > 0
  2879.       $game_party.actors.each {|actor| return actor unless actor.dead?}
  2880.     end
  2881.     return $game_party.actors[0]
  2882.   end
  2883.  
  2884.   def update_buffer(next_move)
  2885.     if next_move == nil
  2886.       members.each {|member| member.buffer = []}
  2887.     else
  2888.       members.each {|member| member.update_buffer(
  2889.           next_move == 'reset' ? nil : next_move)}
  2890.     end
  2891.   end
  2892.  
  2893.   alias move_down_caterpillar_later move_down
  2894.   def move_down(turn_enabled = true)
  2895.     update_buffer(2) if passable?(@x, @y, 2)
  2896.     move_down_caterpillar_later
  2897.   end
  2898.  
  2899.   alias move_left_caterpillar_later move_left
  2900.   def move_left(turn_enabled = true)
  2901.     update_buffer(4) if passable?(@x, @y, 4)
  2902.     move_left_caterpillar_later
  2903.   end
  2904.  
  2905.   alias move_right_caterpillar_later move_right
  2906.   def move_right(turn_enabled = true)
  2907.     update_buffer(6) if passable?(@x, @y, 6)
  2908.     move_right_caterpillar_later
  2909.   end
  2910.  
  2911.   alias move_up_caterpillar_later move_up
  2912.   def move_up(turn_enabled = true)
  2913.     update_buffer(8) if passable?(@x, @y, 8)
  2914.     move_up_caterpillar_later
  2915.   end
  2916.  
  2917.   alias move_lower_left_caterpillar_later move_lower_left
  2918.   def move_lower_left
  2919.     if passable?(@x, @y, 2) && passable?(@x, @y + 1, 4) ||
  2920.        passable?(@x, @y, 4) && passable?(@x - 1, @y, 2)
  2921.       update_buffer(1)
  2922.     end
  2923.     move_lower_left_caterpillar_later
  2924.   end
  2925.  
  2926.   alias move_lower_right_caterpillar_later move_lower_right
  2927.   def move_lower_right
  2928.     if passable?(@x, @y, 2) && passable?(@x, @y + 1, 6) ||
  2929.        passable?(@x, @y, 6) && passable?(@x + 1, @y, 2)
  2930.       update_buffer(3)
  2931.     end
  2932.     move_lower_right_caterpillar_later
  2933.   end
  2934.  
  2935.   alias move_upper_left_caterpillar_later move_upper_left
  2936.   def move_upper_left
  2937.     if passable?(@x, @y, 8) && passable?(@x, @y - 1, 4) ||
  2938.        passable?(@x, @y, 4) && passable?(@x - 1, @y, 8)
  2939.       update_buffer(7)
  2940.     end
  2941.     move_upper_left_caterpillar_later
  2942.   end
  2943.  
  2944.   alias move_upper_right_caterpillar_later move_upper_right
  2945.   def move_upper_right
  2946.     if passable?(@x, @y, 8) && passable?(@x, @y - 1, 6) ||
  2947.        passable?(@x, @y, 6) && passable?(@x + 1, @y, 8)
  2948.       update_buffer(9)
  2949.     end
  2950.     move_upper_right_caterpillar_later
  2951.   end
  2952.  
  2953.   alias jump_caterpillar_later jump
  2954.   def jump(x_plus, y_plus)
  2955.     if (x_plus != 0 || y_plus != 0) && passable?(@x + x_plus, @y + y_plus, 0)
  2956.       update_buffer([x_plus, y_plus])
  2957.     end
  2958.     jump_caterpillar_later(x_plus, y_plus)
  2959.   end
  2960.  
  2961.   alias moveto_caterpillar moveto
  2962.   def moveto(x, y)
  2963.     update_buffer(nil)
  2964.     moveto_caterpillar(x, y)
  2965.     members.each {|member|
  2966.         member.moveto(x, y)
  2967.         case @direction
  2968.         when 2 then member.turn_down
  2969.         when 4 then member.turn_left
  2970.         when 6 then member.turn_right
  2971.         when 8 then member.turn_up
  2972.         end}
  2973.   end
  2974.  
  2975. end
  2976.  
  2977. #==============================================================================
  2978. # Game_Member
  2979. #==============================================================================
  2980.  
  2981. class Game_Member < Game_Character
  2982.  
  2983.   attr_accessor :buffer
  2984.  
  2985.   def initialize(index)
  2986.     super()
  2987.     @index, @force_movement, @buffer, @through = index, 0, [], true
  2988.   end
  2989.  
  2990.   def refresh
  2991.     unless $game_system.CATERPILLAR && actor != nil
  2992.       @character_name, @character_hue = '', 0
  2993.       return
  2994.     end
  2995.     @character_name = actor.character_name
  2996.     @character_hue = actor.character_hue
  2997.     if actor.dead? && DEAD_DISPLAY == 1
  2998.       @opacity, @blend_type = Graphics.frame_count % 4 / 2 * 255, 1
  2999.     else
  3000.       @opacity, @blend_type = 255, 0
  3001.     end
  3002.   end
  3003.  
  3004.   def actor
  3005.     case DEAD_DISPLAY
  3006.     when 0 then return $game_party.actors[@index]
  3007.     when 1
  3008.       alive = 0
  3009.       $game_party.actors.each {|actor| alive += 1 unless actor.dead?}
  3010.       if @index >= alive
  3011.         ind, flag = @index - alive, true
  3012.       else
  3013.         ind, flag = @index, false
  3014.       end
  3015.       $game_party.actors.each_index {|i|
  3016.           ind -= 1 if (flag == $game_party.actors[i].dead?)
  3017.           return $game_party.actors[i] if ind < 0}
  3018.     when 2
  3019.       ind = @index
  3020.       $game_party.actors.each_index {|i|
  3021.           ind -= 1 unless $game_party.actors[i].dead?
  3022.           return $game_party.actors[i] if ind < 0}
  3023.     end
  3024.     return nil
  3025.   end
  3026.  
  3027.   def update
  3028.     refresh
  3029.     @transparent = $game_player.transparent
  3030.     @move_speed = $game_player.move_speed
  3031.     unless moving? || @buffer.size <= @index && @force_movement <= 0
  3032.       if @buffer.size > 0
  3033.         move = @buffer.shift
  3034.         if move.is_a?(Array)
  3035.           jump(move[0], move[1])
  3036.         else
  3037.           case move
  3038.           when 1 then move_lower_left
  3039.           when 2 then move_down(true)
  3040.           when 3 then move_lower_right
  3041.           when 4 then move_left(true)
  3042.           when 6 then move_right(true)
  3043.           when 7 then move_upper_left
  3044.           when 8 then move_up(true)
  3045.           when 9 then move_upper_right
  3046.           end
  3047.         end
  3048.         @force_movement -= 1 if @force_movement > 0
  3049.       end
  3050.     end
  3051.     super
  3052.     @step_anime = (ANIMATED_IDS.include?($game_party.actors[@index].id))
  3053.   end
  3054.  
  3055.   def update_buffer(next_move)
  3056.     if next_move == nil
  3057.       @force_movement = @buffer.size
  3058.     else
  3059.       @buffer.push(next_move)
  3060.       @force_movement = @buffer.size if next_move.is_a?(Array)
  3061.     end
  3062.   end
  3063.  
  3064.   def check_event_trigger_touch(x, y) # don't remove this, it's necessary...
  3065.   end
  3066.  
  3067.   def screen_z(height = 0)
  3068.     return (super - @index)
  3069.   end
  3070.  
  3071. end
  3072.  
  3073. #==============================================================================
  3074. # Spriteset_Map
  3075. #==============================================================================
  3076.  
  3077. class Spriteset_Map
  3078.  
  3079.   alias init_caterpillar_later initialize
  3080.   def initialize
  3081.     init_caterpillar_later
  3082.     return if $BlizzABS && BlizzABS::VERSION >= 1.01
  3083.     $game_player.members.each {|member|
  3084.         sprite = Sprite_Character.new(@viewport1, member)
  3085.         sprite.update
  3086.         @character_sprites.push(sprite)}
  3087.   end
  3088.  
  3089. end
  3090.  
  3091. #==============================================================================
  3092. # Scene_Map
  3093. #==============================================================================
  3094.  
  3095. class Scene_Map
  3096.  
  3097.   alias transfer_player_caterpillar_later transfer_player
  3098.   def transfer_player
  3099.     transfer_player_caterpillar_later
  3100.     return if $BlizzABS
  3101.     case $game_temp.player_new_direction
  3102.     when 2 then $game_player.members.each {|member| member.turn_down}
  3103.     when 4 then $game_player.members.each {|member| member.turn_left}
  3104.     when 6 then $game_player.members.each {|member| member.turn_right}
  3105.     when 8 then $game_player.members.each {|member| member.turn_up}
  3106.     end
  3107.   end
  3108.  
  3109. end
  3110.  
  3111. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3112. # Arrow over Player by Blizzard
  3113. # Version: 1.2b
  3114. # Type: Game Playability Improvement
  3115. # Date: 7.3.2007
  3116. # Date v1.01b: 30.7.2007
  3117. # Date v1.1b: 17.2.2008
  3118. # Date v1.2b: 23.4.2012
  3119. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3120. #
  3121. # new in v1.01b:
  3122. #   - shows arrow if tile has higher priority AND isn't completely transparent
  3123. #   - slightly faster arrow drawing due to half-optimized code
  3124. #
  3125. # new in v1.1b:
  3126. #   - fixed problem with turning this add-on on/off
  3127. #
  3128. # new in v1.2b:
  3129. #   - fixed imcompatibility with Blizz-ABS
  3130. #
  3131. # Explanation:
  3132. #
  3133. #   This add-on will show an arrow over the player's head if he's behind a tile
  3134. #   with a higher priority that isn't completely transparent.
  3135. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3136.  
  3137. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3138. # START Configuration
  3139. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3140.  
  3141. INNER_COLOR = Color.new(0, 0, 0, 128)
  3142. OUTER_COLOR = Color.new(255, 255, 255, 192)
  3143.  
  3144. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3145. # END Configuration
  3146. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3147.  
  3148. #==============================================================================
  3149. # Spriteset_Map
  3150. #==============================================================================
  3151.  
  3152. class Spriteset_Map
  3153.  
  3154.   alias init_arrow_over_player_later initialize
  3155.   def initialize
  3156.     create_arrow if $game_system.ARROW_OVER_PLAYER
  3157.     init_arrow_over_player_later
  3158.   end
  3159.  
  3160.   def create_arrow
  3161.     @arrow = Sprite.new
  3162.     @arrow.bitmap = Bitmap.new(16, 9)
  3163.     @arrow.bitmap.fill_rect(1, 0, 14, 1, OUTER_COLOR)
  3164.     @arrow.bitmap.set_pixel(0, 1, OUTER_COLOR)
  3165.     @arrow.bitmap.fill_rect(1, 1, 7, 1, INNER_COLOR)
  3166.     @arrow.bitmap.fill_rect(8, 1, 7, 1, INNER_COLOR)
  3167.     @arrow.bitmap.set_pixel(15, 1, OUTER_COLOR)
  3168.     @arrow.bitmap.set_pixel(1, 2, OUTER_COLOR)
  3169.     @arrow.bitmap.fill_rect(2, 2, 6, 1, INNER_COLOR)
  3170.     @arrow.bitmap.fill_rect(8, 2, 6, 1, INNER_COLOR)
  3171.     @arrow.bitmap.set_pixel(14, 2, OUTER_COLOR)
  3172.     @arrow.bitmap.set_pixel(2, 3, OUTER_COLOR)
  3173.     @arrow.bitmap.fill_rect(3, 3, 5, 1, INNER_COLOR)
  3174.     @arrow.bitmap.fill_rect(8, 3, 5, 1, INNER_COLOR)
  3175.     @arrow.bitmap.set_pixel(13, 3, OUTER_COLOR)
  3176.     @arrow.bitmap.set_pixel(3, 4, OUTER_COLOR)
  3177.     @arrow.bitmap.fill_rect(4, 4, 4, 1, INNER_COLOR)
  3178.     @arrow.bitmap.fill_rect(8, 4, 4, 1, INNER_COLOR)
  3179.     @arrow.bitmap.set_pixel(12, 4, OUTER_COLOR)
  3180.     @arrow.bitmap.set_pixel(4, 5, OUTER_COLOR)
  3181.     @arrow.bitmap.fill_rect(5, 5, 3, 1, INNER_COLOR)
  3182.     @arrow.bitmap.fill_rect(8, 5, 3, 1, INNER_COLOR)
  3183.     @arrow.bitmap.set_pixel(11, 5, OUTER_COLOR)
  3184.     @arrow.bitmap.set_pixel(5, 6, OUTER_COLOR)
  3185.     @arrow.bitmap.fill_rect(6, 6, 2, 1, INNER_COLOR)
  3186.     @arrow.bitmap.fill_rect(8, 6, 2, 1, INNER_COLOR)
  3187.     @arrow.bitmap.set_pixel(10, 6, OUTER_COLOR)
  3188.     @arrow.bitmap.set_pixel(6, 7, OUTER_COLOR)
  3189.     @arrow.bitmap.set_pixel(7, 7, INNER_COLOR)
  3190.     @arrow.bitmap.set_pixel(8, 7, INNER_COLOR)
  3191.     @arrow.bitmap.set_pixel(9, 7, OUTER_COLOR)
  3192.     @arrow.bitmap.fill_rect(7, 8, 2, 1, OUTER_COLOR)
  3193.     @arrow.visible = false
  3194.     @arrow.z = 5000
  3195.     @arrow.ox = 8
  3196.     @arrow_mode = true
  3197.   end
  3198.  
  3199.   alias upd_arrow_over_player_later update
  3200.   def update
  3201.     upd_arrow_over_player_later
  3202.     if $game_system.ARROW_OVER_PLAYER
  3203.       create_arrow if @arrow == nil
  3204.       @arrow.x, @arrow.y = $game_player.screen_x, $game_player.screen_y - 56
  3205.       @arrow.visible = false
  3206.       x, y = $game_player.real_x / 128, $game_player.real_y / 128 - 1
  3207.       (0..2).each {|n|
  3208.           tile_id = $game_map.data[x, y, n]
  3209.           if tile_id != nil && tile_id != 0 && $game_map.priorities[tile_id] > 1
  3210.             tile = RPG::Cache.tile($game_map.tileset_name, tile_id, 0)
  3211.             if tile_id < 384
  3212.               @arrow.visible = true
  3213.             else
  3214.               (0...32).each {|i| (0...32).each {|j|
  3215.                   unless tile.get_pixel(i, j).alpha == 0
  3216.                     @arrow.visible = true
  3217.                     break
  3218.                   end}}
  3219.             end
  3220.           end}
  3221.       if @arrow_mode
  3222.         @arrow.oy += 1
  3223.         @arrow_mode = (@arrow.oy < 4)
  3224.       else
  3225.         @arrow.oy -= 1
  3226.         @arrow_mode = (@arrow.oy <= -4)
  3227.       end
  3228.     elsif @arrow != nil
  3229.       @arrow.dispose
  3230.       @arrow = nil
  3231.     end
  3232.   end
  3233.  
  3234.   alias disp_arrow_over_player_later dispose
  3235.   def dispose
  3236.     disp_arrow_over_player_later
  3237.     @arrow.dispose if @arrow != nil
  3238.   end
  3239.  
  3240. end
  3241.  
  3242. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3243. # Animated Battle Background by Blizzard
  3244. # Version: 1.1b
  3245. # Type: Game Graphic Design Improvement
  3246. # Date: 12.3.2007
  3247. # Date v1.1b: 12.8.2007
  3248. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3249. #
  3250. # new in v1.1b:
  3251. #   - shorter code, increased performance and increased compatiblity
  3252. #
  3253. #
  3254. # Explanation:
  3255. #
  3256. #   This will animate battle backgrounds. To animate them, you MUST HAVE the
  3257. #   appropriate picture files. You can name them however you like, but you need
  3258. #   to give them numbers. Every other frame than the first has to have a number
  3259. #   higher than the one before. If one number is skipped, the animation will
  3260. #   loop until it reaches the highest number available before the skipped
  3261. #   number.
  3262. #
  3263. # Examples:
  3264. #
  3265. #   1)
  3266. #   Temple.png
  3267. #   Temple1.png
  3268. #   Temple2.png
  3269. #   Temple3.png
  3270. #   - all frames will be shown
  3271. #
  3272. #   2)
  3273. #   Temple.png
  3274. #   Temple1.png
  3275. #   Temple3.png
  3276. #   Temple4.png
  3277. #   - only the 1st and 2nd frame will be shown
  3278. #
  3279. #   3)
  3280. #   Temple.png
  3281. #   Temple3.png
  3282. #   Temple4.png
  3283. #   Temple5.png
  3284. #   - no animation at all
  3285. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3286.  
  3287. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3288. # START Configuration
  3289. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3290.  
  3291. # how many REAL frames that should be skipped before updating the background,
  3292. # note that using anything below 8 is not recommended and that using low values
  3293. # can increase lag dramatically
  3294. SPEED = 8
  3295.  
  3296. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3297. # END Configuration
  3298. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3299.  
  3300. #==============================================================================
  3301. # Spriteset_Battle
  3302. #==============================================================================
  3303.  
  3304. class Spriteset_Battle
  3305.  
  3306.   alias init_animated_battle_background_later initialize
  3307.   def initialize
  3308.     if $game_system.ANIMATED_BATTLE_BACKGROUND &&
  3309.         !$game_system.MAP_AS_BATTLEBACK
  3310.       setup_battleback
  3311.     end
  3312.     init_animated_battle_background_later
  3313.   end
  3314.  
  3315.   alias upd_animated_battle_background_later update
  3316.   def update
  3317.     if $game_system.ANIMATED_BATTLE_BACKGROUND &&
  3318.         !$game_system.MAP_AS_BATTLEBACK
  3319.       setup_battleback if @origin_name != $game_temp.battleback_name
  3320.       @frame = ((@frame||=0) + 1) % (@max_frame||=0) if Graphics.frame_count % SPEED == 0
  3321.       $game_temp.battleback_name = @origin_name + (@frame > 0 ? @frame.to_s : '')
  3322.       upd_animated_battle_background_later
  3323.       $game_temp.battleback_name = @origin_name
  3324.     else
  3325.       upd_animated_battle_background_later
  3326.     end
  3327.   end
  3328.  
  3329.   def setup_battleback
  3330.     @origin_name = $game_temp.battleback_name
  3331.     @frame, @max_frame = 0, 1
  3332.     name = @origin_name + @max_frame.to_s
  3333.     while FileTest.exist?("Graphics/Battlebacks/#{name}.jpg") ||
  3334.           FileTest.exist?("Graphics/Battlebacks/#{name}.png")
  3335.       @max_frame += 1
  3336.       name = @origin_name + @max_frame.to_s
  3337.     end
  3338.   end
  3339.  
  3340. end
  3341.  
  3342. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3343. # Map as Battleback by Blizzard
  3344. # Version: 1.51b
  3345. # Type: Game Design Alteration
  3346. # Date: 11.3.2007
  3347. # Date v1.5b: 12.8.2007
  3348. # Date v1.51b: 3.4.2008
  3349. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3350. #
  3351. # new in v1.5b:
  3352. #   - shortened code and increased performance
  3353. #
  3354. # new in v1.51b:
  3355. #   - now compatible with SDK and RTAB
  3356. #
  3357. # Explanation:
  3358. #
  3359. #   This will make the map to be the battle background. Note that this add-on
  3360. #   will automatically turn off Animated Battle Backgrounds.
  3361. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3362.  
  3363. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3364. # START Configuration
  3365. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3366.  
  3367. # Include any class definitions which you don't want to see on the background.
  3368. # Keep in mind that this works scriptwise, those are object classes. Here are
  3369. # a few classes for reference:
  3370. #  Game_Player    - the player on the map
  3371. #  Game_Member    - caterpillar allies
  3372. #  Game_Event     - events on the map
  3373. #  Game_Character - all possible characters on the map including player,
  3374. #                   allies and events
  3375. # Default configuration is [Game_Player, Game_Member]
  3376. REMOVE_CLASSES = [Game_Player, Game_Member]
  3377.  
  3378. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3379. # END Configuration
  3380. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3381.  
  3382. #==============================================================================
  3383. # Spriteset_Map
  3384. #==============================================================================
  3385.  
  3386. class Spriteset_Map
  3387.  
  3388.   def delete_characters
  3389.     @character_sprites.clone.each_index {|i|
  3390.         if REMOVE_CLASSES.include?(@character_sprites[i].character.class)
  3391.           @character_sprites[i].dispose
  3392.           @character_sprites[i] = nil
  3393.         end}
  3394.     @character_sprites.compact!
  3395.   end
  3396.  
  3397. end
  3398.  
  3399. #==============================================================================
  3400. # Spriteset_Battle
  3401. #==============================================================================
  3402.  
  3403. class Spriteset_Battle
  3404.  
  3405.   alias init_map_as_battleback_later initialize
  3406.   def initialize
  3407.     if $game_system.MAP_AS_BATTLEBACK
  3408.       @map_battleback = Spriteset_Map.new
  3409.       @map_battleback.delete_characters if REMOVE_CLASSES.size > 0
  3410.       init_map_as_battleback_later
  3411.       @battleback_sprite.dispose
  3412.       @battleback_sprite = nil
  3413.     else
  3414.       init_map_as_battleback_later
  3415.     end
  3416.   end
  3417.  
  3418.   alias disp_map_as_battleback_later dispose
  3419.   def dispose
  3420.     @battleback_sprite = Sprite.new if @battleback_sprite == nil
  3421.     if @map_battleback != nil
  3422.       @map_battleback.dispose
  3423.       @map_battleback = nil
  3424.     end
  3425.     disp_map_as_battleback_later
  3426.   end
  3427.  
  3428. end
  3429.  
  3430. #==============================================================================
  3431. # Facesets for Default Status Screen (DSS) by Zan
  3432. # Version: 1.01
  3433. # Type: Menu Layout Alteration
  3434. # Date: 2.4.2007
  3435. #
  3436. # This works just like Simple Facesets, except it applies to the status screen.
  3437. # In case you didn't look at that section, here are the incredibly complicated
  3438. # rules:
  3439. # Ready?
  3440. # You have to have pictures in your "Characters" folder for each of your
  3441. # characters. The pictures have to have the same name as the character's
  3442. # spriteset, with "_face" added on. That's it.
  3443. #
  3444. # Note:
  3445. # This script is currently set for *my* pictures, which are 108x108 pixels. To
  3446. # change it around for different-sized pictures, change the value of FACE_X and
  3447. # FACE_Y in the Config settings.
  3448. #
  3449. # Another note:
  3450. # Not compatible with any CMS that changes drastically the status scene or does
  3451. # not use the default status window.
  3452. #==============================================================================
  3453.  
  3454. #==============================================================================
  3455. # Config
  3456. #==============================================================================
  3457.  
  3458. FACE_X = 15 # set the x coordinate offset (higher value -> righter position)
  3459. FACE_Y = -30 # set the y coordinate offset (higher value -> lower position)
  3460.  
  3461. FACE_HUE = false # set it to true to apply the same hue as the spriteset
  3462.  
  3463. #==============================================================================
  3464. # Window_Base
  3465. #==============================================================================
  3466.  
  3467. class Window_Status
  3468.  
  3469.   alias draw_actor_graphic_faces_when draw_actor_graphic
  3470.   def draw_actor_graphic(actor, x, y)
  3471.     if $game_system.FACESETS_DSS && self.is_a?(Window_Status)
  3472.       if actor != nil && actor.character_name != ''
  3473.         draw_actor_face(actor, x, y)
  3474.       end
  3475.     else
  3476.       draw_actor_graphic_faces_when(actor, x, y)
  3477.     end
  3478.   end
  3479.  
  3480.   def draw_actor_face(actor, x, y)
  3481.     hue = (FACE_HUE ? actor.character_hue : 0)
  3482.     bitmap = RPG::Cache.character("#{actor.character_name}_face", hue)
  3483.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  3484.     self.contents.blt((x-bitmap.width/2)+FACE_X, (y-bitmap.height/2)+FACE_Y,
  3485.         bitmap, src_rect)
  3486.   end
  3487.  
  3488. end
  3489.  
  3490. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3491. # Status Effects as Icons by Blizzard
  3492. # Version: 1.2b
  3493. # Type: Game Design Improvement
  3494. # Date: 30.4.2007
  3495. # Date v1.0b: 17.11.2007
  3496. # Date v1.1b: 13.7.2008
  3497. # Date v1.2b: 19.10.2008
  3498. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3499. #
  3500. # new in v1.0b:
  3501. #   - added possibility that status effects are excluded from icons
  3502. #   - now beta
  3503. #
  3504. # new in v1.1b:
  3505. #   - fixed a bug caused by a typing mistake
  3506. #
  3507. # new in v1.2b:
  3508. #   - improved system
  3509. #
  3510. #
  3511. # Explanation:
  3512. #
  3513. #   This add-on will modify your game so no status text is displayed, but icons
  3514. #   instead. Note that you need to use default icon size of 24x24. Import the
  3515. #   icons into the new folder inside the default icon folder and name them like
  3516. #   the status effects, but type everything in lower case. The new folder has
  3517. #   to be named "State" so the path would be "Graphics/Icons/State/name.png".
  3518. #   In SPECIAL_EFFECTS include all the IDs from status effects that will
  3519. #   override the usual icon display and force the display of their name in the
  3520. #   default way of displaying.
  3521. #   If you want a status effect to have no icon at all, set its rating value in
  3522. #   the database to 0.
  3523. #
  3524. #   Example:
  3525. #  
  3526. #     status effect name: "Painful Distortion"
  3527. #     icon file name:     "State/painful distortion.png"
  3528. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3529.  
  3530. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3531. # START Configuration
  3532. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3533.  
  3534. SPECIAL_EFFECTS = []
  3535.  
  3536. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3537. # END Configuration
  3538. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3539.  
  3540. #==============================================================================
  3541. # Window_Base
  3542. #==============================================================================
  3543.  
  3544. class Window_Base
  3545.  
  3546.   alias draw_actor_state_icons_later draw_actor_state
  3547.   def draw_actor_state(actor, x, y, width = 120)
  3548.     if $game_system.STATUS_ICONS
  3549.       if actor != nil
  3550.         actor.states.each {|id|
  3551.             if SPECIAL_EFFECTS.include?(id)
  3552.               text = "[#{$data_states[id].name}]"
  3553.               self.contents.font.color = actor.dead? ? knockout_color : normal_color
  3554.               self.contents.draw_text(x, y, width, 32, text)
  3555.               return
  3556.             end}
  3557.         s = actor.states.find_all {|id| $data_states[id].rating > 0}
  3558.         s.each_index {|i|
  3559.             break if i*28 > width
  3560.             icon = RPG::Cache.icon("State/#{$data_states[s[i]].name.downcase}")
  3561.             self.contents.blt(x+2+i*28, y+4, icon, Rect.new(0, 0, 24, 24))}
  3562.       end
  3563.     else
  3564.       draw_actor_state_icons_later(actor, x, y, width)
  3565.     end
  3566.   end
  3567.  
  3568. end
  3569.  
  3570. #==============================================================================
  3571. # Window_Help
  3572. #==============================================================================
  3573.  
  3574. class Window_Help
  3575.  
  3576.   alias set_enemy_state_icons_later set_enemy
  3577.   def set_enemy(enemy)
  3578.     if !$game_system.STATUS_ICONS || $game_system.ENEMY_STATUS ||
  3579.         enemy.states.size == 0
  3580.       set_enemy_state_icons_later(enemy)
  3581.       return
  3582.     end
  3583.     text = enemy.name
  3584.     s = enemy.states.find_all {|id| $data_states[id].rating > 0}
  3585.     if s.size*28 + self.contents.text_size(text).width > self.contents.width
  3586.       width = self.contents.width/self.contents.text_size(' ').width
  3587.     else
  3588.       width = s.size*28/self.contents.text_size(' ').width
  3589.     end
  3590.     (0...width).each {|i| text += ' '}
  3591.     if @text != text || @align != 1
  3592.       enemy.states.each {|id|
  3593.           if SPECIAL_EFFECTS.include?(id)
  3594.             set_text("#{enemy.name}  [#{$data_states[id].name}]", 1)
  3595.             return
  3596.           end}
  3597.       set_text(text, 1)
  3598.       x = self.contents.width/2 - width/2
  3599.       s.each_index {|i|
  3600.           break if x+2+i*28 > self.contents.width
  3601.           icon = RPG::Cache.icon("State/#{$data_states[s[i]].name.downcase}")
  3602.           self.contents.blt(x+2+i*28, 4, icon, Rect.new(0, 0, 24, 24))}
  3603.     end
  3604.   end
  3605.  
  3606. end
  3607.  
  3608. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3609. # Animated Battlers for Non-Action BS by Blizzard
  3610. # Version: 1.3b
  3611. # Type: Battle Graphic Improvement
  3612. # Date: 5.5.2007
  3613. # Date v1.3b: 13.8.2007
  3614. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3615. #
  3616. # new in v1.3b:
  3617. #   - fixed the flicking glitch that appeared when a battler was dying
  3618. #   - improved coding, now executed over Sprite_Battler instead of
  3619. #     Spriteset_Battle and due to that increased compatibility and shorter code
  3620. #
  3621. #
  3622. # Compatibility:
  3623. #
  3624. #   95% compatible with SDK v1.x. 70% compatible with SDK v2.x. Not compatible
  3625. #   exotic action CBS-es that need special battler animation.
  3626. #
  3627. #
  3628. # Explanation:
  3629. #
  3630. #   This will animate battlers in the default battle system. To animate them,
  3631. #   you MUST HAVE the appropriate picture files. You can name them however you
  3632. #   like, but you need to give them numbers. Every other frame than the first
  3633. #   has to have a number higher than the one before. If one number is skipped,
  3634. #   the animation will loop until it reaches the highest number available
  3635. #   before the skipped number. Not that this works for actors AND for enemies.
  3636. #
  3637. # Examples:
  3638. #
  3639. #   1)
  3640. #   Arshes.png
  3641. #   Arshes1.png
  3642. #   Arshes2.png
  3643. #   Arshes3.png
  3644. #   - all frames will be shown
  3645. #
  3646. #   2)
  3647. #   Arshes.png
  3648. #   Arshes1.png
  3649. #   Arshes3.png
  3650. #   Arshes4.png
  3651. #   - only the 1st and 2nd frame will be shown
  3652. #
  3653. #   3)
  3654. #   Arshes.png
  3655. #   Arshes3.png
  3656. #   Arshes4.png
  3657. #   Arshes5.png
  3658. #   - no animation at all
  3659. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3660.  
  3661. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3662. # START Configuration
  3663. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3664.  
  3665. # how many REAL frames that should be skipped before updating the battlers,
  3666. # note that using anything below 2 is not recommended and that using low values
  3667. # can increase lag dramatically
  3668. B_SPEED = 4
  3669.  
  3670. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3671. # END Configuration
  3672. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3673.  
  3674. #==============================================================================
  3675. # Game_Battler
  3676. #==============================================================================
  3677.  
  3678. class Game_Battler
  3679.  
  3680.   attr_accessor :frame
  3681.   attr_accessor :max_frame
  3682.   attr_accessor :origin_name
  3683.   attr_accessor :battler_name
  3684.  
  3685. end
  3686.  
  3687. #==============================================================================
  3688. # Sprite_Battler
  3689. #==============================================================================
  3690.  
  3691. class Sprite_Battler
  3692.  
  3693.   alias upd_animated_battlers_dbs_later update
  3694.   def update
  3695.     if $game_system.ANIBATTLERS_NON_ACTION_BS && @battler != nil
  3696.       setup_battler if @battler.origin_name != @battler.battler_name
  3697.       if Graphics.frame_count % B_SPEED == 0
  3698.         @battler.frame = (@battler.frame + 1) % @battler.max_frame
  3699.       end
  3700.       if @frame != @battler.frame
  3701.         @frame = @battler.frame
  3702.         name = @battler.origin_name
  3703.         name += @frame.to_s if @frame > 0
  3704.         self.bitmap = RPG::Cache.battler(name, @battler.battler_hue)
  3705.         @width = bitmap.width
  3706.         @height = bitmap.height
  3707.         self.ox = @width / 2
  3708.         self.oy = @height
  3709.       end
  3710.     end
  3711.     upd_animated_battlers_dbs_later
  3712.   end
  3713.  
  3714.   def setup_battler
  3715.     @battler.origin_name = @battler.battler_name
  3716.     @battler.frame = @frame = 0
  3717.     @battler.max_frame = 1
  3718.     loop do
  3719.       name = @battler.origin_name + @battler.max_frame.to_s
  3720.       if FileTest.exist?("Graphics/Battlers/#{name}.jpg") ||
  3721.          FileTest.exist?("Graphics/Battlers/#{name}.png")
  3722.         @battler.max_frame += 1
  3723.       else
  3724.         break
  3725.       end
  3726.     end
  3727.   end
  3728.  
  3729.   def setup_battleback
  3730.     @battler.origin_name = @battler.battler_name
  3731.     @battler.frame, @frame, @battler.max_frame = 0, 0, 1
  3732.     name = @battler.origin_name + @battler.max_frame.to_s
  3733.     while FileTest.exist?("Graphics/Battlers/#{name}.jpg") ||
  3734.           FileTest.exist?("Graphics/Battlers/#{name}.png")
  3735.       @battler.max_frame += 1
  3736.       name = @battler.origin_name + @battler.max_frame.to_s
  3737.     end
  3738.   end
  3739.  
  3740. end
  3741.  
  3742. if TONS_OF_ADDONS::BATTLE_CURSORS
  3743. #==============================================================================
  3744. # Enhanced Battle Cursors v2.1 beta
  3745. # by Fantasist
  3746. #==============================================================================
  3747. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3748. # - code reviewed, optimized, integrated into Tons of Add-ons, freed from
  3749. #   potential bugs and beta tested by Blizzard
  3750. # - this add-on is part of Tons of Add-ons with full permission of the original
  3751. #   author(s)
  3752. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  3753. #------------------------------------------------------------------------------
  3754. # * Config (these can't be changed in-game)
  3755. #------------------------------------------------------------------------------
  3756. # Position
  3757. #       Set the position of the cursor
  3758. #
  3759. # 1) Monster_Height: The height of the cursor from the monster graphic's base.
  3760. # 2) Actor_Height: The height of the cursor from the actor graphic's base.
  3761. MONSTER_OFFSET = 0
  3762. ACTOR_OFFSET = 0
  3763. #------------------------------------------------------------------------------
  3764. # Movement Type Config
  3765. #       Configuration for the movement types used
  3766. #
  3767. # 1) Phase_Range: The distance the cursor moves away from the height while
  3768. #    phasing.
  3769. # 2) Zoom_Factor: The amount the cursor zooms in and out. Recommended range is
  3770. #    from 0 to 1, refrain from using more than 2 digits after decimal.
  3771. # 3) EBC_Type: This is the configuration of animation types
  3772. #        [Anim or not(true/false), movement type, transition type]
  3773. #      available movement types   -> phase, zoom, spin, spin2
  3774. #      available transition types -> trans, default
  3775. #    If you are using animations (first parameter is true) then use numbers
  3776. #    instead of movement and transition types to determine the animation IDs
  3777. #    of the animations used. The first is the actor, the second is the enemy
  3778. #    animation ID.
  3779. PHASE_RANGE = 16
  3780. ZOOM_FACTOR = 0.2
  3781. EBC_TYPE = [false, 'phase', 'trans']
  3782. # EBC_type can be changed ingame, refer to $game_system.battle_cursor and
  3783. # set the new values. This change is being saved with the save file.
  3784. #==============================================================================
  3785.  
  3786. #==============================================================================
  3787. # ** Game System
  3788. #==============================================================================
  3789.  
  3790. class Game_System
  3791.  
  3792.   attr_accessor :battle_cursor
  3793.  
  3794.   alias init_battle_cursor initialize_tons_of_addons
  3795.   def initialize_tons_of_addons
  3796.     init_battle_cursor
  3797.     @battle_cursor = EBC_TYPE
  3798.   end  
  3799.  
  3800. end
  3801.  
  3802. #==============================================================================
  3803. # ** Arrow_Base
  3804. #==============================================================================
  3805.  
  3806. class Arrow_Base < RPG::Sprite
  3807.  
  3808.   attr_reader   :index
  3809.   attr_reader   :help_window
  3810.    
  3811.   def initialize(viewport)
  3812.     super
  3813.     if $game_system.battle_cursor[0]
  3814.       tmp, @battler = $game_system.battle_cursor, nil
  3815.       @actor_cursor = (tmp[1].is_a?(Numeric) ? tmp[1] : 98)
  3816.       @enemy_cursor = (tmp[2].is_a?(Numeric) ? tmp[2] : 99)
  3817.     else
  3818.       # Main Sprite initialization
  3819.       self.bitmap = RPG::Cache.windowskin($game_system.windowskin_name)
  3820.       self.src_rect.set(128, 96, 32, 32)
  3821.       self.ox, self.oy, self.z = 16, 64, 2501
  3822.       # Sub-sprite initialization
  3823.       if animtype('trans')
  3824.         @sp2 = Sprite.new(viewport)
  3825.         @sp2.bitmap = self.bitmap
  3826.         @sp2.src_rect.set(160, 96, 32, 32)
  3827.         @sp2.ox, @sp2.oy, @sp2.z = self.ox, self.oy, self.z-1
  3828.       end
  3829.       # Variable initialization
  3830.       @rad = 0 if animtype('trans') || ['phase', 'zoom', 'spin2'].any? {|i| movetype(i)}
  3831.       @deg = 0 if movetype('spin')
  3832.       @battler = nil
  3833.       @blink_count = 0 if animtype('default')
  3834.     end
  3835.     @y, @index, @help_window = 0, 0, nil
  3836.     update
  3837.   end
  3838.  
  3839.   def movetype(type)
  3840.     return ($game_system.battle_cursor[1] == type)
  3841.   end
  3842.  
  3843.   def animtype(type)
  3844.     return ($game_system.battle_cursor[2] == type)
  3845.   end
  3846.  
  3847.   def index=(index)
  3848.     @index = index
  3849.     update
  3850.   end
  3851.  
  3852.   def help_window=(help_window)
  3853.     @help_window = help_window
  3854.     # Update help text (update_help is defined by the subclasses)
  3855.     update_help if @help_window != nil
  3856.   end
  3857.  
  3858.   def update
  3859.     super
  3860.     if $game_system.battle_cursor[0]
  3861.       # Update animation
  3862.       id = self.is_a?(Arrow_Actor) ? @actor_cursor : @enemy_cursor
  3863.       loop_animation($data_animations[id])
  3864.     else
  3865.       if @rad
  3866.         # Cycle @rad from 0 to 2 Pi
  3867.         if @rad < 2 * Math::PI
  3868.           @rad += Math::PI/(movetype('spin2') ? 30 : 10)
  3869.         else
  3870.           @rad = 0
  3871.         end
  3872.       end
  3873.       # Animations
  3874.       trans if animtype('trans')
  3875.       default if animtype('default')
  3876.       # Movement Types
  3877.       phase if movetype('phase')
  3878.       spin if movetype('spin')
  3879.       spin2 if movetype('spin2')
  3880.       zoom if movetype('zoom')
  3881.     end
  3882.     # Update Help Window
  3883.     update_help if @help_window != nil
  3884.   end
  3885.  
  3886.   def dispose
  3887.     @sp2.dispose unless @sp2 == nil || @sp2.disposed?
  3888.     super
  3889.   end
  3890.  
  3891.   #--------------------------------------------------------------------------
  3892.   # * Cursor Animations
  3893.   #--------------------------------------------------------------------------
  3894.   def trans
  3895.     self.opacity = (Math.sin(@rad)*255).round
  3896.   end
  3897.  
  3898.   def default
  3899.     @blink_count = (@blink_count + 1) % 8
  3900.     self.src_rect.set((@blink_count < 4 ? 128 : 160), 96, 32, 32)
  3901.   end
  3902.  
  3903.   #--------------------------------------------------------------------------
  3904.   # * Cursor Movements
  3905.   #--------------------------------------------------------------------------
  3906.   def phase
  3907.     @y = ((Math.sin(@rad))*PHASE_RANGE).round
  3908.   end
  3909.  
  3910.   def spin
  3911.     # Cycle @deg from 0 to 360
  3912.     self.angle = @deg = (@deg + 18) % 360
  3913.     @sp2.angle = @deg if @sp2
  3914.   end
  3915.  
  3916.   def spin2
  3917.     self.angle = (Math.sin(@rad)*360).round
  3918.     @sp2.angle = self.angle if @sp2
  3919.   end
  3920.  
  3921.   def zoom
  3922.     self.zoom_x = self.zoom_y = 1 + Math.sin(@rad)*ZOOM_FACTOR
  3923.     @sp2.zoom_x = self.zoom_x if @sp2
  3924.   end
  3925.  
  3926. end
  3927.  
  3928. #==============================================================================
  3929. # ** Arrow_Enemy
  3930. #==============================================================================
  3931.  
  3932. class Arrow_Enemy < Arrow_Base
  3933.    
  3934.   def enemy
  3935.     return $game_troop.enemies[@index]
  3936.   end
  3937.  
  3938.   def update
  3939.     super
  3940.     # Skip if indicating a nonexistant enemy
  3941.     $game_troop.enemies.size.times do
  3942.       break if self.enemy.exist?
  3943.       @index = (@index + 1) % $game_troop.enemies.size
  3944.     end
  3945.     # Cursor right
  3946.     if Input.repeat?(Input::RIGHT)
  3947.       $game_system.se_play($data_system.cursor_se)
  3948.       $game_troop.enemies.size.times do
  3949.         @index = (@index + 1) % $game_troop.enemies.size
  3950.         break if self.enemy.exist?
  3951.       end
  3952.     # Cursor left
  3953.     elsif Input.repeat?(Input::LEFT)
  3954.       $game_system.se_play($data_system.cursor_se)
  3955.       $game_troop.enemies.size.times do
  3956.         @index = (@index + $game_troop.enemies.size - 1) % $game_troop.enemies.size
  3957.         break if self.enemy.exist?
  3958.       end
  3959.     end
  3960.     # Set sprite coordinates
  3961.     if self.enemy != nil
  3962.       self.x = self.enemy.screen_x
  3963.       self.y = self.enemy.screen_y
  3964.       self.y += -@y - MONSTER_OFFSET
  3965.       @sp2.x, @sp2.y = self.x, self.y if @sp2
  3966.     end
  3967.   end
  3968.  
  3969.   def update_help
  3970.     if $game_system.ENEMY_STATUS
  3971.       # Display enemy name and state in the help window
  3972.       @help_window.set_actor(self.enemy)
  3973.     else
  3974.       @help_window.set_enemy(self.enemy)
  3975.     end
  3976.   end
  3977.  
  3978. end
  3979.  
  3980. #==============================================================================
  3981. # ** Arrow_Actor
  3982. #==============================================================================
  3983.  
  3984. class Arrow_Actor < Arrow_Base
  3985.  
  3986.   def actor
  3987.     return $game_party.actors[@index]
  3988.   end
  3989.  
  3990.   def update
  3991.     super
  3992.     # Cursor right
  3993.     if Input.repeat?(Input::RIGHT)
  3994.       $game_system.se_play($data_system.cursor_se)
  3995.       @index = (@index + 1) % $game_party.actors.size
  3996.     # Cursor left
  3997.     elsif Input.repeat?(Input::LEFT)
  3998.       $game_system.se_play($data_system.cursor_se)
  3999.       @index = (@index + $game_party.actors.size - 1) % $game_party.actors.size
  4000.     end
  4001.     # Set sprite coordinates
  4002.     if self.actor != nil
  4003.       if $game_system.CENTER_BATTLER
  4004.         self.x = case $game_party.actors.size
  4005.         when 1 then 240 + self.actor.screen_x
  4006.         when 2 then 2 * self.actor.screen_x
  4007.         when 3 then 80 + self.actor.screen_x
  4008.         when 4 then self.actor.screen_x
  4009.         end
  4010.       else
  4011.         self.x = self.actor.screen_x
  4012.       end
  4013.       self.y = self.actor.screen_y
  4014.       self.y += -@y - ACTOR_OFFSET
  4015.       @sp2.x, @sp2.y = self.x, self.y if @sp2
  4016.     end
  4017.   end
  4018.  
  4019.   def update_help
  4020.     # Display actor status in help window
  4021.     @help_window.set_actor(self.actor)
  4022.   end
  4023.  
  4024. end
  4025.  
  4026. end
  4027.  
  4028. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  4029. # Death Image by Blizzard
  4030. # Version: 1.2b
  4031. # Type: Graphic Alteration
  4032. # Date: 17.12.2007
  4033. # Date 1.0b: 17.12.2007
  4034. # Date 1.1b: 20.3.2008
  4035. # Date 1.2b: 22.8.2008
  4036. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  4037. #  
  4038. #   This add-on will allow the display of an image instead of none for dead
  4039. #   actors. Keep in mind that this add-on can increase lag in battle.
  4040. #   If you turn this add-on on/off, you shouldn't do that in battle.
  4041. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  4042.  
  4043. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4044. # START Configuration
  4045. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4046.  
  4047. DEATH_IMAGE = '' # the battler file name of your death image
  4048.  
  4049. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4050. # END Configuration
  4051. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4052.  
  4053. #==============================================================================
  4054. # Sprite_DummyBattler
  4055. #==============================================================================
  4056.  
  4057. class Sprite_DummyBattler < RPG::Sprite
  4058.  
  4059.   attr_accessor :battler
  4060.  
  4061.   def update
  4062.     return if @battler == nil
  4063.     super
  4064.     if self.bitmap == nil
  4065.       self.bitmap = RPG::Cache.battler(DEATH_IMAGE, 0)
  4066.       @width, @height = bitmap.width, bitmap.height
  4067.       self.ox, self.oy = @width / 2, @height
  4068.       self.opacity = 0 if @battler.dead? || @battler.hidden
  4069.     end
  4070.     if @battler_visible
  4071.       if !@battler.hidden && !@battler.dead? &&
  4072.           (@battler.damage == nil || @battler.damage_pop)
  4073.         escape
  4074.         @battler_visible = false
  4075.       elsif $game_temp.battle_main_phase
  4076.         self.opacity += 3 if self.opacity < 255
  4077.       elsif self.opacity > 207
  4078.         self.opacity -= 3
  4079.       end
  4080.     elsif @battler.damage == nil && @battler.dead?
  4081.       appear
  4082.       @battler_visible = true
  4083.     end
  4084.     if @battler != nil
  4085.       if $game_system.CENTER_BATTLER && @battler.is_a?(Game_Actor)
  4086.         self.x = case $game_party.actors.size
  4087.         when 1 then @battler.screen_x + 240
  4088.         when 2 then @battler.screen_x + 80 + @battler.index * 160
  4089.         when 3 then @battler.screen_x + 80
  4090.         when 4 then @battler.screen_x
  4091.         end
  4092.       else
  4093.         self.x = @battler.screen_x
  4094.       end
  4095.       self.y, self.z = @battler.screen_y, @battler.screen_z
  4096.     end
  4097.   end
  4098.  
  4099. end
  4100.  
  4101. #==============================================================================
  4102. # Spriteset_Battle
  4103. #==============================================================================
  4104.  
  4105. class Spriteset_Battle
  4106.  
  4107.   alias init_death_image_later initialize
  4108.   def initialize
  4109.     @death_sprites = []
  4110.     init_death_image_later
  4111.     if $game_system.DEATH_IMAGE
  4112.       @actor_sprites.size.times {
  4113.           sprite = Sprite_DummyBattler.new(@viewport2)
  4114.           sprite.opacity = 0
  4115.           @death_sprites.push(sprite)}
  4116.     end
  4117.   end
  4118.  
  4119.   alias upd_death_image_later update
  4120.   def update
  4121.     upd_death_image_later
  4122.     return unless $game_system.DEATH_IMAGE
  4123.     @death_sprites.each_index {|i|
  4124.         @death_sprites[i].battler = @actor_sprites[i].battler
  4125.         @death_sprites[i].update}
  4126.   end
  4127.  
  4128.   alias disp_death_image_later dispose
  4129.   def dispose
  4130.     @death_sprites.each {|sprite| sprite.dispose}
  4131.     disp_death_image_later
  4132.   end
  4133.  
  4134. end
  4135.  
  4136. #==============================================================================
  4137. # Terrain Battlebacks
  4138. # Author: game_guy
  4139. # Type: Battle Background Changer
  4140. # Version: 1.1
  4141. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  4142. # - code reviewed, optimized, integrated into Tons of Add-ons, freed from
  4143. #   potential bugs and beta tested by Blizzard
  4144. # - this add-on is part of Tons of Add-ons with full permission of the original
  4145. #   author(s)
  4146. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  4147. #==============================================================================
  4148.  
  4149. module GameGuy
  4150.   #====================================================
  4151.   # You first need to define all default terrains.
  4152.   # Set terrains. Then later you can set specific
  4153.   # terrains for tilesets.
  4154.   # Terrain[TERRAIN_ID] = "battleback_name"
  4155.   #====================================================
  4156.   Terrain = []
  4157.   Terrain[0] = '001-Grassland01'
  4158.   Terrain[1] = '001-Grassland01'
  4159.   Terrain[2] = '002-Woods01'
  4160.   Terrain[3] = '003-Forest01'
  4161.   Terrain[4] = '004-Mountain01'
  4162.   Terrain[5] = '004-Mountain01'
  4163.   Terrain[6] = '004-Mountain01'
  4164.   Terrain[7] = '004-Mountain01'
  4165.   #====================================================
  4166.   # Here you can define specific battlebacks for each
  4167.   # tileset. If a terrain is not defined for a tileset
  4168.   # it will use one of the default ones defined above.
  4169.   #
  4170.   # First set the tileset id to an array.
  4171.   # Tilesets[tileset_id] = []
  4172.   # Then start adding your terrains like this.
  4173.   # Tilesets[tile_id][terrain_id] = "battleback_name"
  4174.   # Examples below.
  4175.   #====================================================
  4176.   Tilesets = []
  4177.   Tilesets[1] = [] # Tilesets one, grasslands
  4178.   Tilesets[1][0] = "002-Woods01" # tileset 1, terrain 0
  4179.   Tilesets[1][1] = "003-Forest01" # tileset 1, terrain 1
  4180.   #====================================================
  4181.   # As you can see, the other terrains for this tileset
  4182.   # are'nt defined. So it will use one of the default
  4183.   # terrains defined above.
  4184.   #
  4185.   # If a tileset terrain and a default terrain is not
  4186.   # defined, it will use the tilesets original
  4187.   # battleback.
  4188.   #====================================================
  4189. end
  4190.  
  4191. #==============================================================================
  4192. # Game_Map
  4193. #==============================================================================
  4194.  
  4195. class Game_Map
  4196.  
  4197.   def battleback_name
  4198.     if $game_system.TERRAIN_BATTLEBACKS
  4199.       if GameGuy::Tilesets[@map.tileset_id] != nil &&
  4200.           GameGuy::Tilesets[@map.tileset_id][$game_player.terrain_tag] != nil
  4201.         return GameGuy::Tilesets[@map.tileset_id][$game_player.terrain_tag]
  4202.       elsif GameGuy::Terrain[$game_player.terrain_tag] != nil
  4203.         return GameGuy::Terrain[$game_player.terrain_tag]
  4204.       end
  4205.     end
  4206.     return @battleback_name
  4207.   end
  4208.  
  4209. end
Add Comment
Please, Sign In to add comment