Guest User

ToA1

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