设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2341|回复: 10
打印 上一主题 下一主题

[交流讨论] 怪物图鉴添加奖励代码

[复制链接]

Lv4.逐梦者

梦石
0
星屑
9238
在线时间
1833 小时
注册时间
2020-1-2
帖子
1082
跳转到指定楼层
1
发表于 2021-4-15 19:29:54 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
插件论坛
这个怪物图鉴有击杀怪物最大值我想添加一个  当击杀怪物达到最大值时候奖励金币或者经验、装备、属性、道具等
因为和一个成就系统有点像我试着模仿试了一下午没成功  主要是代码不会写  去找作者  作者2年前就不见了

Example.gif (853 KB, 下载次数: 20)

Example.gif
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送

Lv2.观梦者

梦石
0
星屑
814
在线时间
122 小时
注册时间
2018-7-23
帖子
114
2
发表于 2021-4-15 20:20:40 | 只看该作者
本帖最后由 leungzero 于 2021-4-15 20:22 编辑

最简单的方法,掉落物品是个类似箱子之类的开启性奖励。你没想过这个?这个可是公共事件都能做出来啊。
至于击杀成就,做成变量判断啊。变量会用吗?
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5692
在线时间
1556 小时
注册时间
2011-6-14
帖子
520
3
发表于 2021-4-15 20:57:45 | 只看该作者
兄弟。。。。。你想找人帮忙最少要把插件搬过来吧,这里不是每个人都有梯子的
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9238
在线时间
1833 小时
注册时间
2020-1-2
帖子
1082
4
 楼主| 发表于 2021-4-15 21:42:08 | 只看该作者
347780682 发表于 2021-4-15 20:57
兄弟。。。。。你想找人帮忙最少要把插件搬过来吧,这里不是每个人都有梯子的 ...

不用梯子啊
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9238
在线时间
1833 小时
注册时间
2020-1-2
帖子
1082
5
 楼主| 发表于 2021-4-15 21:42:48 | 只看该作者
  1. //=============================================================================
  2. // STV_BeastBook.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc v2.5 - STV_BeastBook
  6. * || This will add an Beast Register to your Game
  7. * @author SkottyTV (base idea from Yoji Ojima)
  8. *
  9. * @param ----- Window -----
  10. *
  11. * @param Show Window
  12. * @desc Show or Hide Window Skin
  13. * TRUE = show window / FALSE = hide window
  14. * @default TRUE
  15. *
  16. * @param Background Picture
  17. * @desc The Background Picture in img/pictures/
  18. * (leave empty for no Background Picture)
  19. * @default
  20. *
  21. * @param Show Background Enemy
  22. * @desc Show a Picture of the Enemy in the Background
  23. * (TRUE = show // FALSE = hide)
  24. * @default TRUE
  25. *
  26. * @param Show Battle Back
  27. * @desc Shows Picture of first kill/encounter place
  28. * (TRUE = show // FALSE = hide)
  29. * @default TRUE
  30. *
  31. * @param Default Battle Back
  32. * @desc The Default Battle Back Picture
  33. * (if beasts added with plugin commands) !(Use "/")
  34. * @default img/parallaxes/BlueSky.png
  35. *
  36. * @param Battle Back Index
  37. * @desc The Z Position of the Battle Back
  38. * (0 = behind Windowskin // 1 = over Windowskin)
  39. * @default 0
  40. *
  41. * @param ----- ASV -----
  42. *
  43. * @param ASV Animation Speed
  44. * @desc The Animation Speed of ASV-Battler
  45. * (the higher the number the slower the animation)
  46. * @default 10
  47. *
  48. * @param ASV Animated Pattern
  49. * @desc The ASV-Pattern you want to display
  50. * (default 0 = The topleft 3 Pictures)
  51. * @default 0
  52. *
  53. * @param ----- Functions -----
  54. *
  55. * @param Max Beasts
  56. * @desc Number of Beasts used. (first X in Database)
  57. * (leave empty to use all beasts)
  58. * @default
  59. *
  60. * @param Fill Behavior
  61. * @desc How the Book will get filled
  62. * 1 = Encounter / 2 = Kill / 3 = None (only commands)
  63. * @default 2
  64. *
  65. * @param ID in front of Name
  66. * @desc Show the ID in front of the Name
  67. * TRUE = "4 - Monster" / FALSE = "Monster"
  68. * @default TRUE
  69. *
  70. * @param ID in front of Unknown Enemy
  71. * @desc Show the ID in front of the Name
  72. * TRUE = "4 - ???" / FALSE = "???"
  73. * @default TRUE
  74. *
  75. * @param Animate Enemy
  76. * @desc Choose if you want an animated Enemy
  77. * TRUE = animated / FALSE = static
  78. * @default TRUE
  79. *
  80. * @param Backbar Opacity
  81. * @desc Set the Backbar opacity
  82. * 255 = Full Visible / 0 = Invisible
  83. * @default 130
  84. *
  85. * @param Count Discovered Variable
  86. * @desc Save number of discovered Enemies in Variable
  87. * @default 0
  88. *
  89. * @param Book Full Switch
  90. * @desc Switch set ON when beast book is full
  91. * @default 0
  92. *
  93. * @param Exp Icon
  94. * @desc Set the Exp Icon
  95. * @default 189
  96. *
  97. * @param Gold Icon
  98. * @desc Set the Gold Icon
  99. * @default 314
  100. *
  101. * @param ----- Text -----
  102. *
  103. * @param Unknown Info
  104. * @desc How "Unknown Info" Text appears
  105. * @default ???
  106. *
  107. * @param None Data
  108. * @desc How "None Data" Text appears
  109. * @default none
  110. *
  111. * @param Drops Text
  112. * @desc Headline of Enemy Item Drops
  113. * @default Items:
  114. *
  115. * @param Skills Text
  116. * @desc Headline of Enemy Skills
  117. * @default Skills:
  118. *
  119. * @param Weakness Text
  120. * @desc Headline of Weakness Window
  121. * @default Weakness
  122. *
  123. * @param Kill Counter Text
  124. * @desc Headline of Kill Counter
  125. * @default Kills:
  126. *
  127. * @param ----- Colors -----
  128. *
  129. * @param Drops Success Color
  130. * @desc The Default Color for Item Drops Success Rate
  131. * @default 6
  132. *
  133. * @param Skills Color
  134. * @desc The Default Color for Skills
  135. * @default 3
  136. *
  137. * @param Unknown Color
  138. * @desc The Default Color for "Unknown"
  139. * @default 7
  140. *
  141. * @param ----- Switches -----
  142. *
  143. * @param Info Window Switch
  144. * @desc Choose a Switch to show the Info Window
  145. * (leave empty or "0" to show the window permanently)
  146. * @default 0
  147. *
  148. * @param Weakness Window Switch
  149. * @desc Choose a Switch to show the Weakness Window
  150. * (leave empty or "0" to show the window permanently)
  151. * @default 0
  152. *
  153. * @param Parameter Window Switch
  154. * @desc Choose a Switch to show the Parameter Window
  155. * (leave empty or "0" to show the window permanently)
  156. * @default 0
  157. *
  158. * @param Show Items Switch
  159. * @desc The Switch for showing Items
  160. * (leave empty or "0" to show the Items permanently)
  161. * @default 0
  162. *
  163. * @param Show Skills Switch
  164. * @desc The Switch for showing Skills
  165. * (leave empty or "0" to show the Skills permanently)
  166. * @default 0
  167. *
  168. * @param Show EXP Switch
  169. * @desc The Switch for showing EXP
  170. * (leave empty or "0" to show the EXP permanently)
  171. * @default 0
  172. *
  173. * @param Show Gold Switch
  174. * @desc The Switch for showing Gold
  175. * (leave empty or "0" to show the Gold permanently)
  176. * @default 0
  177. *
  178. * @param Show Kill Counter Switch
  179. * @desc The Switch for showing Kill Counter
  180. * (leave empty or "0" to show the Kill Counter permanently)
  181. * @default 0
  182. *
  183. * @param ----- Kill Counter -----
  184. *
  185. * @param Max Kills Value
  186. * @desc The default value for kills needed
  187. * (get overwritten by plugin command "BeastBook maxkills")
  188. * @default 25
  189. *
  190. * @param Kills Achievment Start Switch
  191. * @desc Number of the switch to start with achievments
  192. * (Example: 500 = Enemy Id 17 will set Switch 517)
  193. * @default 0
  194. *
  195. * @param Kills Bar Color 1
  196. * @desc The first Color for the Kill Counter Bar
  197. * @default 6
  198. *
  199. * @param Kills Bar Color 2
  200. * @desc The second Color for the Kill Counter Bar
  201. * @default 17
  202. *
  203. * @help
  204. *
  205. * ////////////////////////////////////////////////////////////////////////////
  206. * ----------------------------- Terms of Usage: ------------------------------
  207. * ////////////////////////////////////////////////////////////////////////////

  208. * Feel free to use this Plugin in 1. Non-Commercial Games, 2. Commercial Games
  209. * However it would be nice to give proper Credits to "SkottyTV".
  210. * Please also give proper Credits to Yoji Ojima for the base idea.
  211. *
  212. * Have Fun And Enjoy! :)
  213. *
  214. *
  215. *
  216. * ////////////////////////////////////////////////////////////////////////////
  217. * --------------------------------- Updates:----------------------------------
  218. * ////////////////////////////////////////////////////////////////////////////
  219. *
  220. * Update v2.5
  221. * - Added "Max Beasts" option.
  222. * - Added Plugincommand "BeastBook hide X" and "BeastBook show X".
  223. *
  224. * Update v2.4a
  225. * - Bug fixes
  226. *
  227. * Update v2.4
  228. * - Added support funtion for YEP_X_AnimatedSVEnemies
  229. * - Code clean / Bug fixes
  230. *
  231. * Update v2.3
  232. * - Added the possibility to print Icons in front of the Weaknesses
  233. * - Option to show the BattleBackground where the Beast was killed/encountered
  234. *
  235. * Update v2.2h
  236. * - Option to show the ID in front of Unknown Beast -> "1 - ???"
  237. * - Added possibility to change the Beast Pic with <BeastBookPic:Path>
  238. * - Added option to change "unknown" color.
  239. * - Maxkills can now be set in the Enemy note box!
  240. * - IMPORTANT: Fixed Bug where savegames not contain BeastBook data !!!
  241. *
  242. * Update v2.1a
  243. * - bug fixes
  244. *
  245. * Update v2.1
  246. * - Added functions: completekills, completeitems
  247. * - bug fixes
  248. *
  249. * Update v2.0
  250. * - Option to hide skills inside the Book
  251. * - Added a Kill Counter Function including Achievment Switches
  252. * - Drop Items show only if discovered
  253. * - Drop Items now show their success Rate
  254. * - Better Beast Animation
  255. * - Background Picture possible
  256. * - Visual improvements!
  257. *
  258. *
  259. * ////////////////////////////////////////////////////////////////////////////
  260. * -------------------------------- Commands: ---------------------------------
  261. * ////////////////////////////////////////////////////////////////////////////
  262. *
  263. * Plugin Command:
  264. *   BeastBook open             # Open the beast book screen
  265. *   BeastBook hide 6           # Hide Beast 6 in book.
  266. *   BeastBook show 6           # Show Beast 6 in book.
  267. *   BeastBook add 3            # Add enemy #3 to the beast book
  268. *   BeastBook addvar 10        # Add enemy (ID) that is in variable 10
  269. *   BeastBook addkill 6 2      # Add 2 kills for enemyID 6
  270. *   BeastBook addkill 6 -4     # Removes 4 kills from enemyID 6
  271. *   BeastBook maxkills 3 50    # Set max kills for enemyID 3 to 50 kills
  272. *   BeastBook remove 16        # Remove enemy #16 from the beast book
  273. *   BeastBook complete         # Complete the whole Book
  274. *   BeastBook completeenemies  # Complete all Enemies
  275. *   BeastBook completeitems    # Complete all Drops
  276. *   BeastBook completekills    # Complete all Kills
  277. *   BeastBook clear            # Clear the beast book
  278. *   BeastBook clearitems       # Clear all items
  279. *
  280. * Enemy Note:
  281. *   <desc1:The mighty Clown>   # Description text in the beast book, line 1
  282. *   <desc2:This is Line 2>     # Description text in the beast book, line 2
  283. *   <desc3:Some Info here?>    # Description text in the beast book, line 3
  284. *   <desc4:Even more Info!>    # Description text in the beast book, line 4
  285. *   <BeastBook:hide>           # This Enemy will not appear in the beast book
  286. *   <BeastBookPic:PATH>        # Changes the Pic of an Enemy to "PATH"
  287. *                                Example: <BeastBookPic:img/enemies/Slime>
  288. *                                Don´t type ".png" !
  289. *   <BeastBookMaxKills:5>      # Set the MaxKills of the Enemy to 5.
  290. *
  291. * Skill Note:
  292. *   <BeastBook:hide>           # This Skill will not appear in the beast book
  293. *
  294. *
  295. *
  296. * ////////////////////////////////////////////////////////////////////////////
  297. * --------------------- Examples / Tutorials / Help: -------------------------
  298. * ////////////////////////////////////////////////////////////////////////////
  299. *
  300. * ------------------------Investigate Skill Tutorial:--------------------------
  301. * (!!! You will NEED YanFly´s Battle Engine Core and ActSeqPack1 !!!)
  302. *
  303. * - First set the "Fill Behavior" option of this plugin to "3" (None).
  304. * - Now create a skill which calls a common event "X" and have the following
  305. *   in its notebox:
  306. *   <Target Action>
  307. *    Change Variable Y = target._enemyId
  308. *   </Target Action>
  309. * - Now in the common event "X" call a Plugin-Line and write:
  310. *   BeastBook addvar Y
  311. * - Done!
  312. *
  313. * ("X" and "Y" is a number you choose)
  314. * -----------------------------------------------------------------------------
  315. *
  316. * ------------------------ Weakness Icons Tutorial:----------------------------
  317. * You are able to use icons for the beast weaknesses.
  318. *
  319. * Got to: RPG Maker MV Editor -> Database -> Types
  320. * On the Elements tab rename an element like this:
  321. *
  322. * 01. Physical ->   \i[76]Physical         //This will print Icon 76 in front
  323. * 01. Fire     ->   \i[64]Fire             //This will print Icon 64 in front
  324. *
  325. *
  326. * -----------------------------------------------------------------------------
  327. *
  328. * -------------------------- Animated Side View: ------------------------------
  329. * With Yanfly´s "YEP_X_AnimatedSVEnemies" Plugin you are able
  330. * to set an animated Battler grafic by typing "<Sideview Battler: filename>"
  331. * into an enemies notebox.
  332. * The STV_BeastBook will show this animated battler if it is used.
  333. *
  334. * With the Plugin Parameter "ASV Animated Pattern" you can decide which Pattern
  335. * you want the Book to show.
  336. *
  337. * A default ASV Battler file looks like this: ( [] <- a pic of the enemy)
  338. * [][][][][][][][][]
  339. * [][][][][][][][][]
  340. * [][][][][][][][][]
  341. * [][][][][][][][][]
  342. * [][][][][][][][][]
  343. * [][][][][][][][][]
  344. *
  345. * So if you set the "ASV Animated Pattern" to 3 the animation will be:
  346. * [][][][][][][][][]
  347. * [][][][][][][][][]
  348. * [][][][][][][][][]
  349. * [x][x][x][][][][][][]
  350. * [][][][][][][][][]
  351. * [][][][][][][][][]
  352. *
  353. *
  354. * -----------------------------------------------------------------------------
  355. *
  356. */

  357. // ----------------------------------------------------------------------------------------------------------------------------
  358. // STV_BeastBook Parameters
  359. // ----------------------------------------------------------------------------------------------------------------------------
  360.     var stv_BeastBook_parameters = PluginManager.parameters('STV_BeastBook');
  361.    
  362.     //----- Window -----
  363.     var stv_BeastBook_showWindow = String(stv_BeastBook_parameters['Show Window'] || 'TRUE');
  364.     var stv_BeastBook_bgPicture = String(stv_BeastBook_parameters['Background Picture'] || '');
  365.     var stv_BeastBook_showBgBeast = String(stv_BeastBook_parameters['Show Background Enemy'] || 'TRUE');
  366.     var stv_BeastBook_showBattleBack = String(stv_BeastBook_parameters['Show Battle Back'] || 'TRUE');
  367.     var stv_BeastBook_defaultBattleBack = String(stv_BeastBook_parameters['Default Battle Back'] || 'img/parallaxes/BlueSky.png');
  368.     var stv_BeastBook_battleBackIndex = Number(stv_BeastBook_parameters['Battle Back Index'] || 0);
  369.    
  370.     //--- Animated Side View ---
  371.     var stv_BeastBook_asvSpeed = Number(stv_BeastBook_parameters['ASV Animation Speed'] || 10);
  372.     var stv_BeastBook_asvPattern = Number(stv_BeastBook_parameters['ASV Animated Pattern'] || 0);
  373.    
  374.     //----- Functions -----
  375.     var stv_BeastBook_fillBehavior = String(stv_BeastBook_parameters['Fill Behavior'] || '2');
  376.     var stv_BeastBook_showID = String(stv_BeastBook_parameters['ID in front of Name'] || 'TRUE');
  377.     var stv_BeastBook_showIDunknown = String(stv_BeastBook_parameters['ID in front of Unknown Enemy'] || 'TRUE');
  378.     var stv_BeastBook_animateBeast = String(stv_BeastBook_parameters['Animate Enemy'] || 'TRUE');
  379.     var stv_BeastBook_bbOpacity = Number(stv_BeastBook_parameters['Backbar Opacity'] || 130);
  380.     var stv_BeastBook_expIcon = Number(stv_BeastBook_parameters['Exp Icon'] || 189);
  381.     var stv_BeastBook_goldIcon = Number(stv_BeastBook_parameters['Gold Icon'] || 314);
  382.     var stv_BeastBook_countDiscovered = Number(stv_BeastBook_parameters['Count Discovered Variable'] || 0);
  383.     var stv_BeastBook_bookFullSwitch = Number(stv_BeastBook_parameters['Book Full Switch'] || 0);
  384.     var stv_BeastBook_maxBeasts = Number(stv_BeastBook_parameters['Max Beasts']);

  385.     //----- Text -----
  386.     var stv_BeastBook_unknownData = String(stv_BeastBook_parameters['Unknown Info'] || '???');
  387.     var stv_BeastBook_noData = String(stv_BeastBook_parameters['None Data'] || 'none');
  388.     var stv_BeastBook_dropsText = String(stv_BeastBook_parameters['Drops Text'] || 'Items:');
  389.     var stv_BeastBook_skillsText = String(stv_BeastBook_parameters['Skills Text'] || 'Skills:');
  390.     var stv_BeastBook_weaknessText = String(stv_BeastBook_parameters['Weakness Text'] || 'Weakness');
  391.     var stv_BeastBook_killsText = String(stv_BeastBook_parameters['Kill Counter Text'] || 'Kills:');
  392.    
  393.     //----- Colors -----
  394.     var stv_BeastBook_unknownColor = Number(stv_BeastBook_parameters['Unknown Color'] || 7);
  395.     var stv_BeastBook_skillsColor = Number(stv_BeastBook_parameters['Skills Color'] || 3);
  396.     var stv_BeastBook_dropsSuccessColor = Number(stv_BeastBook_parameters['Drops Success Color'] || 6);
  397.    
  398.     //----- Switches -----
  399.     var stv_BeastBook_statusSwitch = Number(stv_BeastBook_parameters['Info Window Switch'] || 0);
  400.     var stv_BeastBook_elementsSwitch = Number(stv_BeastBook_parameters['Weakness Window Switch'] || 0);
  401.     var stv_BeastBook_parameterSwitch = Number(stv_BeastBook_parameters['Parameter Window Switch'] || 0);
  402.     var stv_BeastBook_showItemsSwitch = Number(stv_BeastBook_parameters['Show Items Switch'] || 0);
  403.     var stv_BeastBook_showSkillsSwitch = Number(stv_BeastBook_parameters['Show Skills Switch'] || 0);
  404.     var stv_BeastBook_showExpSwitch = Number(stv_BeastBook_parameters['Show EXP Switch'] || 0);
  405.     var stv_BeastBook_showGoldSwitch = Number(stv_BeastBook_parameters['Show Gold Switch'] || 0);
  406.     var stv_BeastBook_showKillCounterSwitch = Number(stv_BeastBook_parameters['Show Kill Counter Switch'] || 0);
  407.    
  408.     //----- Kill Counter -----
  409.     var stv_BeastBook_maxKills = Number(stv_BeastBook_parameters['Max Kills Value'] || 25);
  410.     var stv_BeastBook_killsCountColor1 = Number(stv_BeastBook_parameters['Kills Bar Color 1'] || 6);
  411.     var stv_BeastBook_killsCountColor2 = Number(stv_BeastBook_parameters['Kills Bar Color 2'] || 17);
  412.     var stv_BeastBook_killAchievmentSwitch = Number(stv_BeastBook_parameters['Kills Achievment Start Switch'] || 0);
  413.    
  414.     //----- GLOBAL -----
  415.     var stv_BeastBook_padding = 5;


  416. // ----------------------------------------------------------------------------------------------------------------------------
  417. // Scene BeastBook create
  418. // ----------------------------------------------------------------------------------------------------------------------------  
  419.     Scene_BeastBook = function() {
  420.         this.initialize.apply(this, arguments);
  421.     };

  422.     Scene_BeastBook.prototype = Object.create(Scene_MenuBase.prototype);
  423.     Scene_BeastBook.prototype.constructor = Scene_BeastBook;

  424.     Scene_BeastBook.prototype.initialize = function() {
  425.         Scene_MenuBase.prototype.initialize.call(this);
  426.     };                                                         
  427.    
  428.     Scene_BeastBook.prototype.createBackground = function() {
  429.         this._backgroundSprite = new Sprite();
  430.         this._backgroundSprite.move(0, 0, Graphics.width, Graphics.height);
  431.         this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
  432.         this.addChild(this._backgroundSprite);
  433.         if (stv_BeastBook_bgPicture){
  434.             this._foregroundSprite = new Sprite();
  435.             this._foregroundSprite.move(0, 0, Graphics.width, Graphics.height);
  436.             this._foregroundSprite.bitmap = ImageManager.loadPicture(stv_BeastBook_bgPicture);
  437.             this.addChild(this._foregroundSprite);
  438.         }
  439.     };
  440.    
  441.     Scene_BeastBook.prototype.create = function() {
  442.         Scene_MenuBase.prototype.create.call(this);
  443.       
  444.         this.createWindowPositions();
  445.         this.createSelectionWindow();
  446.       
  447.         if ($gameSwitches.value(stv_BeastBook_statusSwitch) || !stv_BeastBook_statusSwitch) this.createStatusWindow();
  448.         if ($gameSwitches.value(stv_BeastBook_elementsSwitch) || !stv_BeastBook_elementsSwitch) this.createElementsWindow();
  449.         if ($gameSwitches.value(stv_BeastBook_parameterSwitch) || !stv_BeastBook_parameterSwitch) this.createParametersWindow();
  450.       
  451.         this.createDescriptionWindow();
  452.       
  453.         if(stv_BeastBook_showWindow != "TRUE"){
  454.             this._selectionWindow.opacity = 0;
  455.             this._infoWindow.opacity = 0;
  456.             this._elementsWindow.opacity = 0;
  457.             this._parametersWindow.opacity = 0;
  458.             this._descriptionWindow.opacity = 0;
  459.         }
  460.       
  461.         this.renewWindows();
  462.     };
  463.    
  464. // ----------------------------------------------------------------------------------------------------------------------------
  465. // Create Window Positions
  466. // ----------------------------------------------------------------------------------------------------------------------------
  467.     Scene_BeastBook.prototype.createWindowPositions = function() {
  468.       
  469.         var maxWidth = Graphics.boxWidth,
  470.             maxHeight = Graphics.boxHeight;
  471.       
  472.         var sX = 0,
  473.             sY = 0,
  474.             sW = (maxWidth/3),
  475.             sH = (maxHeight/3)*2;
  476.         this._selectionWindow = new Window_BeastBook_Selection(sX, sY, sW, sH);
  477.       
  478.         var eX = sX,
  479.             eY = sH,
  480.             eW = sW,
  481.             eH = (maxHeight/3);
  482.         this._elementsWindow = new Window_BeastBook_Elements(eX, eY, eW, eH);
  483.       
  484.         var iX = sW,
  485.             iY = sY,
  486.             iW = maxWidth - sW,
  487.             iH = sH;
  488.         this._infoWindow = new Window_BeastBook_Info(iX, iY, iW, iH);
  489.       
  490.         var pX = sW,
  491.             pY = eY,
  492.             pW = iW,
  493.             pH = eH;
  494.         this._parametersWindow = new Window_BeastBook_Parameters(pX, pY, pW, pH);
  495.       
  496.         var dX = pX,
  497.             dY = pY,
  498.             dW = pW,
  499.             dH = pH;
  500.         this._descriptionWindow = new Window_BeastBook_Description(dX, dY, dW, dH);
  501.       
  502.     };
  503.    
  504. // ----------------------------------------------------------------------------------------------------------------------------
  505. // Setup Index Window
  506. // ----------------------------------------------------------------------------------------------------------------------------
  507.     Scene_BeastBook.prototype.createSelectionWindow = function() {
  508.         this._selectionWindow.setHandler('ok', this.onEnemySelect.bind(this));
  509.         this._selectionWindow.setHandler('cancel', this.popScene.bind(this));
  510.         this._selectionWindow.setBeastDataWindows(this._infoWindow, this._parametersWindow, this._elementsWindow, this._descriptionWindow);
  511.         this.addWindow(this._selectionWindow);
  512.     };
  513.    
  514. // ----------------------------------------------------------------------------------------------------------------------------
  515. // Setup Info Window
  516. // ----------------------------------------------------------------------------------------------------------------------------
  517.     Scene_BeastBook.prototype.createStatusWindow = function() {
  518.         this.addWindow(this._infoWindow);
  519.     };

  520. // ----------------------------------------------------------------------------------------------------------------------------
  521. // Setup Elements Window
  522. // ----------------------------------------------------------------------------------------------------------------------------
  523.     Scene_BeastBook.prototype.createElementsWindow = function() {
  524.         this.addWindow(this._elementsWindow);
  525.     };

  526. // ----------------------------------------------------------------------------------------------------------------------------
  527. // Setup Parameters Window
  528. // ----------------------------------------------------------------------------------------------------------------------------
  529.     Scene_BeastBook.prototype.createParametersWindow = function() {
  530.         this.addWindow(this._parametersWindow);
  531.     };
  532.    
  533. // ----------------------------------------------------------------------------------------------------------------------------
  534. // Setup Description Window
  535. // ----------------------------------------------------------------------------------------------------------------------------
  536.     Scene_BeastBook.prototype.createDescriptionWindow = function() {
  537.         this.addWindow(this._descriptionWindow);
  538.         this._descriptionWindow.hide();
  539.     };
  540.    
  541. // ----------------------------------------------------------------------------------------------------------------------------
  542. // Setup Enemy Select
  543. // ----------------------------------------------------------------------------------------------------------------------------
  544.     Scene_BeastBook.prototype.onEnemySelect = function() {
  545.         if(this._descriptionWindow.visible) {
  546.             this._descriptionWindow.hide();
  547.         } else {
  548.             this._descriptionWindow.show();
  549.         }
  550.         this._selectionWindow.activate();

  551.     };
  552.    
  553. // ----------------------------------------------------------------------------------------------------------------------------
  554. // Refresh Windows
  555. // ----------------------------------------------------------------------------------------------------------------------------
  556.     Scene_BeastBook.prototype.renewWindows = function() {
  557.             this._selectionWindow.refresh();
  558.             this._infoWindow.refresh();
  559.             this._elementsWindow.refresh();
  560.             this._parametersWindow.refresh();
  561.             this._descriptionWindow.refresh();
  562.     };
  563.    
  564. // ----------------------------------------------------------------------------------------------------------------------------
  565. // Fill Selection Window
  566. // ----------------------------------------------------------------------------------------------------------------------------
  567.     function Window_BeastBook_Selection() {
  568.         this.initialize.apply(this, arguments);
  569.     }

  570.     Window_BeastBook_Selection.prototype = Object.create(Window_Selectable.prototype);
  571.     Window_BeastBook_Selection.prototype.constructor = Window_BeastBook_Selection;

  572.     Window_BeastBook_Selection.lastTopRow = 0;
  573.     Window_BeastBook_Selection.lastIndex  = 0;

  574.     Window_BeastBook_Selection.prototype.initialize = function(x, y, width, height) {
  575.         Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  576.       
  577.         this.refresh();
  578.         this.setTopRow(Window_BeastBook_Selection.lastTopRow);
  579.         this.select(Window_BeastBook_Selection.lastIndex);
  580.         this.activate();
  581.       
  582.     };
  583.    
  584.     Window_BeastBook_Selection.prototype.maxCols = function() {
  585.         return 1;
  586.     };

  587.     Window_BeastBook_Selection.prototype.maxItems = function() {
  588.         return this._list ? this._list.length : 0;
  589.     };
  590.    
  591.     Window_BeastBook_Selection.prototype.setBeastDataWindows = function(window1, window2, window3, window4) {
  592.         this._infoWindow = window1;
  593.         this._parametersWindow = window2;
  594.         this._elementsWindow = window3;
  595.         this._descriptionWindow = window4;
  596.         this.updateStatus();
  597.     };
  598.    
  599.     Window_BeastBook_Selection.prototype.update = function() {
  600.         Window_Selectable.prototype.update.call(this);
  601.         this.updateStatus();
  602.     };
  603.    
  604.     Window_BeastBook_Selection.prototype.updateStatus = function() {
  605.       
  606.         var beast = this._list[this.index()];
  607.       
  608.         if (this._infoWindow) {
  609.             this._infoWindow.setBeast(beast);
  610.         }
  611.         if (this._parametersWindow) {
  612.             this._parametersWindow.setBeast(beast);
  613.         }
  614.         if (this._elementsWindow) {
  615.             this._elementsWindow.setBeast(beast);
  616.         }
  617.         if (this._descriptionWindow) {
  618.             this._descriptionWindow.setBeast(beast);
  619.         }
  620.     };
  621.    
  622.     Window_BeastBook_Selection.prototype.refresh = function() {
  623.         this._list = [];
  624.         for (var i = 1; i < $beastBook.beasts.length; i++) {
  625.             var beast = $dataEnemies[i];
  626.             if (beast.name && $beastBook.beasts[i].show) {
  627.                 this._list.push(beast);
  628.             }
  629.         }
  630.         this.createContents();
  631.         this.drawAllItems();
  632.     };

  633.     Window_BeastBook_Selection.prototype.drawItem = function(index) {
  634.         var beast= this._list[index],
  635.             rect = this.itemRectForText(index),
  636.             id = index + 1,
  637.             name;
  638.       
  639.         this.changeTextColor(this.normalColor());
  640.            
  641.         if ($beastBook.isRevealed(beast.id)) {
  642.             if (stv_BeastBook_showID == "TRUE") {
  643.                 name = id + " - " + beast.name;
  644.             } else {
  645.                 name = beast.name;
  646.             }
  647.         } else {
  648.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  649.             if (stv_BeastBook_showIDunknown  == "TRUE") {
  650.                 name = id + " - " + stv_BeastBook_unknownData;
  651.             } else {
  652.                 name = stv_BeastBook_unknownData;
  653.             }
  654.         }
  655.       
  656.         this.drawText(name, rect.x, rect.y, rect.width);
  657.         this.changeTextColor(this.normalColor());
  658.     };
  659.    
  660. // ----------------------------------------------------------------------------------------------------------------------------
  661. // Fill Description Window
  662. // ----------------------------------------------------------------------------------------------------------------------------   
  663.     function Window_BeastBook_Description() {
  664.         this.initialize.apply(this, arguments);
  665.     }

  666.     Window_BeastBook_Description.prototype = Object.create(Window_Base.prototype);
  667.     Window_BeastBook_Description.prototype.constructor = Window_BeastBook_Description;

  668.     Window_BeastBook_Description.prototype.initialize = function(x, y, width, height) {
  669.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  670.       
  671.     };
  672.    
  673.     Window_BeastBook_Description.prototype.setBeast= function(beast) {
  674.         this._beast = beast;
  675.         this.refresh();
  676.     };
  677.    
  678.     Window_BeastBook_Description.prototype.update = function() {
  679.         Window_Base.prototype.update.call(this);
  680.     };
  681.    
  682.     Window_BeastBook_Description.prototype.createDescription = function() {
  683.         var beast = $dataEnemies[this._beast.id];
  684.         var y = this.lineHeight();
  685.       
  686.         if ($beastBook.isRevealed(this._beast.id)) {
  687.             this.drawTextEx(beast.meta.desc1, (this.contents.width/2) - (this.textWidth(beast.meta.desc1)/2), 0);
  688.             this.drawTextEx(beast.meta.desc2, (this.contents.width/2) - (this.textWidth(beast.meta.desc2)/2), y*1);
  689.             this.drawTextEx(beast.meta.desc3, (this.contents.width/2) - (this.textWidth(beast.meta.desc3)/2), y*2);
  690.             this.drawTextEx(beast.meta.desc4, (this.contents.width/2) - (this.textWidth(beast.meta.desc4)/2), y*3);
  691.         } else {
  692.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  693.             this.drawText(stv_BeastBook_unknownData, (this.contents.width/2) - (this.textWidth(stv_BeastBook_unknownData)/2), 0);
  694.             this.changeTextColor(this.normalColor());
  695.         }
  696.     };
  697.    
  698.     Window_BeastBook_Description.prototype.refresh = function() {
  699.         this.contents.clear();
  700.         this.createDescription();
  701.     };
  702.    
  703. // ----------------------------------------------------------------------------------------------------------------------------
  704. // Fill Info Window
  705. // ----------------------------------------------------------------------------------------------------------------------------
  706.     function Window_BeastBook_Info() {
  707.         this.initialize.apply(this, arguments);
  708.     }

  709.     Window_BeastBook_Info.prototype = Object.create(Window_Base.prototype);
  710.     Window_BeastBook_Info.prototype.constructor = Window_BeastBook_Info;

  711.     Window_BeastBook_Info.prototype.initialize = function(x, y, width, height) {
  712.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  713.         this.setBeastSprites();
  714.         this.setBattleBackSprites();
  715.     };
  716.    
  717.     Window_BeastBook_Info.prototype.setBattleBackSprites = function() {
  718.         this._battleBack2 = new Sprite();
  719.         this._battleBack2.anchor.x = 0;
  720.         this._battleBack2.anchor.y = 0;
  721.         this._battleBack2.x = 0;
  722.         this._battleBack2.y = 0;
  723.         this.addChildAt(this._battleBack2, stv_BeastBook_battleBackIndex);
  724.       
  725.         this._battleBack1 = new Sprite();
  726.         this._battleBack1.anchor.x = 0;
  727.         this._battleBack1.anchor.y = 0;
  728.         this._battleBack1.x = 0;
  729.         this._battleBack1.y = 0;
  730.         this.addChildAt(this._battleBack1, stv_BeastBook_battleBackIndex);
  731.     };
  732.    
  733.     Window_BeastBook_Info.prototype.setBeastSprites = function() {
  734.         this._beastSprite = new Sprite();
  735.         this._beastSprite.anchor.x = 0.5;
  736.         this._beastSprite.anchor.y = 0.5;
  737.         this._beastSprite.x = this.width/2;
  738.         this._beastSprite.y = this.height/2;
  739.         this._beastSprite.scale.x = 0.8;
  740.         this._beastSprite.scale.y = 0.8;
  741.         this.addChildToBack(this._beastSprite);
  742.            
  743.         this._beastBackSprite = new Sprite();
  744.         this._beastBackSprite.anchor.x = 0.5;
  745.         this._beastBackSprite.anchor.y = 0.5;
  746.         this._beastBackSprite.x = this.width/1.1;
  747.         this._beastBackSprite.y = this.height/1.2;
  748.         this._beastBackSprite.scale.x = 2.0;
  749.         this._beastBackSprite.scale.y = 2.0;
  750.         this._beastBackSprite.opacity = 50;
  751.         this.addChildToBack(this._beastBackSprite);
  752.     };
  753.    
  754.     Window_BeastBook_Info.prototype.setBeast= function(beast) {
  755.         this._beast = beast;
  756.         this.refresh();
  757.     };
  758.    
  759.     Window_BeastBook_Info.prototype.update = function() {
  760.         Window_Base.prototype.update.call(this);
  761.     };
  762.    
  763.     Window_BeastBook_Info.prototype.contentDrawItems = function() {
  764.         var y = this.lineHeight();
  765.         var maxLength = ((this.contents.width/2) - stv_BeastBook_padding*2 - this.textWidth("100%"));
  766.       
  767.         this.contents.fillRect(0, y-5, (this.contents.width/2) - stv_BeastBook_padding, 1, this.normalColor());
  768.         this.drawText(stv_BeastBook_dropsText, 0, 0);
  769.       
  770.         for (var j = 0; j < 3; j++) {
  771.             var di = this._beast.dropItems[j];
  772.             if (di.kind > 0) {
  773.                 if ($beastBook.beasts[this._beast.id] && $beastBook.beasts[this._beast.id].discoveredItems[j]) {
  774.                     var item = Game_Enemy.prototype.itemObject(di.kind, di.dataId);
  775.                     var successRate = Math.round((1/this._beast.dropItems[j].denominator)*100);
  776.                     this.changeTextColor(this.textColor(stv_BeastBook_dropsSuccessColor));
  777.                     this.drawText(successRate + "%", 0, y);
  778.                     this.changeTextColor(this.normalColor());
  779.                     this.drawItemName(item, this.textWidth("100%") + stv_BeastBook_padding, y, maxLength);
  780.                 } else {
  781.                     this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  782.                     this.drawText(stv_BeastBook_unknownData, 0, y, maxLength);
  783.                     this.changeTextColor(this.normalColor());
  784.                 }
  785.                 y += this.lineHeight();
  786.             }
  787.         }

  788.         if (!this._beast.dropItems[0].kind && !this._beast.dropItems[1].kind && !this._beast.dropItems[2].kind) {
  789.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  790.             this.drawText(stv_BeastBook_noData, 0, y);
  791.             this.changeTextColor(this.normalColor());
  792.         }   
  793.     };
  794.    
  795.     Window_BeastBook_Info.prototype.contentDrawAbilities = function() {
  796.         y = this.lineHeight();
  797.         var maxLength = ((this.contents.width/2) - stv_BeastBook_padding*2 - 32);
  798.       
  799.         this.contents.fillRect((this.contents.width/2) + stv_BeastBook_padding, y-5, (this.contents.width/2) - stv_BeastBook_padding, 1, this.normalColor());
  800.         this.drawText(stv_BeastBook_skillsText, this.contents.width-this.textWidth(stv_BeastBook_skillsText), 0);
  801.          
  802.         for (var j = 0; j < this._beast.actions.length; j++) {
  803.             var ai = this._beast.actions[j];
  804.                 if (ai.skillId > 0) {
  805.                     var skill = $dataSkills[ai.skillId];
  806.                     if (skill.meta.BeastBook !== "hide") {
  807.                         this.changeTextColor(this.textColor(stv_BeastBook_skillsColor));
  808.                         this.drawSkillName(skill, this.contents.width - this.textWidth(skill.name) - 36, y, maxLength);
  809.                         y += this.lineHeight();
  810.                         this.changeTextColor(this.normalColor());
  811.                     }
  812.                 }
  813.         }
  814.         if (this._beast.actions.length <= 0) {
  815.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  816.             this.drawText(stv_BeastBook_noData, this.contents.width-this.textWidth(stv_BeastBook_noData), y);
  817.             this.changeTextColor(this.normalColor());
  818.         }   
  819.     };
  820.    
  821.     Window_BeastBook_Info.prototype.contentDrawExp = function() {
  822.         y = this.lineHeight();
  823.       
  824.         this.contents.paintOpacity = stv_BeastBook_bbOpacity;
  825.         this.contents.fillRect(0, (this.contents.height - y*2) - stv_BeastBook_padding, this.contents.width, y, this.gaugeBackColor());
  826.         this.contents.paintOpacity = 255;
  827.       
  828.         this.drawIcon(stv_BeastBook_expIcon, this.contents.width - 32, this.contents.height - y*2 + 2 - stv_BeastBook_padding);
  829.         this.drawText(TextManager.exp + ":", 0, this.contents.height - y*2 - stv_BeastBook_padding);
  830.         this.drawText(this._beast.exp, this.contents.width - 32 - this.textWidth(this._beast.exp) - stv_BeastBook_padding, this.contents.height - y*2 - stv_BeastBook_padding);

  831.     };
  832.    
  833.     Window_BeastBook_Info.prototype.contentDrawGold = function() {
  834.         y = this.lineHeight();
  835.       
  836.         this.contents.paintOpacity = stv_BeastBook_bbOpacity;
  837.         this.contents.fillRect(0, this.contents.height - y, this.contents.width, y, this.gaugeBackColor());
  838.         this.contents.paintOpacity = 255;

  839.         this.drawIcon(stv_BeastBook_goldIcon, this.contents.width - 32, this.contents.height - y + 2);
  840.         this.drawText(TextManager.currencyUnit + ":", 0, this.contents.height - y);
  841.         this.drawText(this._beast.gold, this.contents.width - 32 - this.textWidth(this._beast.gold) - stv_BeastBook_padding, this.contents.height - y);        
  842.     };
  843.    
  844.     Window_BeastBook_Info.prototype.contentDrawBattleBack = function() {
  845.         var beast = this._beast;
  846.         var pic1 = $beastBook.beasts[beast.id]._battleBack1;
  847.         var pic2 = $beastBook.beasts[beast.id]._battleBack2;
  848.       
  849.         var bitmap1 = ImageManager.loadNormalBitmap(pic1, 0 || 0);
  850.         var bitmap2 = ImageManager.loadNormalBitmap(pic2, 0 || 0);
  851.       
  852.         this._battleBack1.bitmap = bitmap1;
  853.         this._battleBack2.bitmap = bitmap2;
  854.       
  855.         this._battleBack1.scale.x = this.width/this._battleBack1.bitmap.width;
  856.         this._battleBack1.scale.y = this.height/this._battleBack1.bitmap.height;
  857.         this._battleBack2.scale.x = this.width/this._battleBack2.bitmap.width;
  858.         this._battleBack2.scale.y = this.height/this._battleBack2.bitmap.height;
  859.     };
  860.    
  861.     Window_BeastBook_Info.prototype.aSVMotion = function(speed, max) {
  862.         var thisSpeed = speed;
  863.         if (!this._counter) this._counter = 0;
  864.         if (!this._pattern) this._pattern = 0;
  865.         if (!this._switch) this._switch = false;
  866.       
  867.         if (this._counter < thisSpeed) {
  868.             this._counter += 1;
  869.         } else {
  870.             this._counter = 0;
  871.             if (!this._switch) this._pattern = (this._pattern + 1) % (max+1);
  872.             if (this._switch) this._pattern = (this._pattern - 1) % (max+1);
  873.         }
  874.       
  875.         if (this._pattern == max & !this._switch) this._switch = !this._switch;
  876.         if (this._pattern === 0 & this._switch) this._switch = !this._switch;
  877.       
  878.         return this._pattern;
  879.     };
  880.    
  881.     Window_BeastBook_Info.prototype.staticMotion = function() {
  882.         var bitmapHeight = this._beastSprite.bitmap.height;
  883.         var contentsHeight = this.contents.height;
  884.         var scalex = (Math.cos(Graphics.frameCount*0.03))/16;
  885.         var scaley = ((Math.cos(Graphics.frameCount*0.03))/8);
  886.            
  887.         this._beastSprite.scale.x = (scalex*scalex)+0.8;
  888.         this._beastSprite.scale.y = (scaley*scaley)+0.8;
  889.         this._beastSprite.anchor.y = (scaley*scaley)+0.4;
  890.       
  891.         if (bitmapHeight > contentsHeight) {
  892.             this._beastSprite.scale.x = ((scalex*scalex)+0.9)-0.3;
  893.             this._beastSprite.scale.y = ((scaley*scaley)+0.9)-0.3;
  894.             this._beastSprite.anchor.y = ((scaley*scaley)+0.4);
  895.         }
  896.     };
  897.    
  898.     Window_BeastBook_Info.prototype.contentDrawBeast = function() {
  899.         var beast = this._beast,
  900.             note = beast.note;
  901.            
  902.             if (beast.meta.BeastBookPic) {
  903.                 this._bitmap = ImageManager.loadNormalBitmap(beast.meta.BeastBookPic + ".png", 0 || 0);
  904.                 this.drawBeastStatic();
  905.             } else {
  906.                 if (note.match(/<(?:SIDEVIEW BATTLER):[ ](.*)>/i)) {
  907.                     this._bitmap = ImageManager.loadSvActor(String(RegExp.$1), 0);
  908.                     this.drawBeastASV();
  909.                 } else {
  910.                     if ($gameSystem.isSideView()) {this._bitmap = ImageManager.loadSvEnemy($dataEnemies[beast.id].battlerName, beast.battlerHue);}
  911.                     else {this._bitmap = ImageManager.loadEnemy($dataEnemies[beast.id].battlerName, beast.battlerHue);}
  912.                     this.drawBeastStatic();
  913.                 }
  914.             }
  915.     };
  916.    
  917.     Window_BeastBook_Info.prototype.drawBeastASV = function() {
  918.         this._beastSprite.bitmap = this._bitmap;
  919.         this._beastBackSprite.bitmap = this._bitmap;
  920.         var bitmap = this._beastSprite.bitmap;
  921.         if (bitmap) {
  922.             var bw = bitmap.width / 9;
  923.             var bh = bitmap.height / 6;
  924.             var cx = Math.floor(stv_BeastBook_asvPattern / 6) * 3 + this.aSVMotion(stv_BeastBook_asvSpeed, 2);
  925.             var cy = stv_BeastBook_asvPattern % 6;
  926.             this._beastSprite.setFrame(cx * bw, cy * bh, bw, bh);
  927.             this._beastBackSprite.setFrame(0, 0, bw, bh);
  928.             if (stv_BeastBook_showBgBeast == "TRUE") this._beastBackSprite.bitmap = bitmap;
  929.         }
  930.     };
  931.    
  932.     Window_BeastBook_Info.prototype.drawBeastStatic = function() {
  933.         this._beastSprite.bitmap = this._bitmap;
  934.         if (stv_BeastBook_showBgBeast == "TRUE") this._beastBackSprite.bitmap = this._bitmap;
  935.         if (stv_BeastBook_animateBeast == "TRUE") this.staticMotion();
  936.     };
  937.    
  938.     Window_BeastBook_Info.prototype.contentDrawKillCounter = function() {
  939.         var beast = this._beast.id;
  940.       
  941.         var gaugeWidth = 200;
  942.         var gaugeXpos = (this.contents.width - gaugeWidth);
  943.         var gaugeYpos = (this.contents.height - (this.lineHeight() * 3) - stv_BeastBook_padding*2);
  944.         var actualkillsCount = $beastBook.beasts[beast].kills;
  945.         var maxKillsCount = $beastBook.beasts[beast].maxKills;
  946.         var killsCountText = actualkillsCount + " / " + maxKillsCount;
  947.       
  948.         this.drawGauge(gaugeXpos, gaugeYpos - stv_BeastBook_padding, gaugeWidth, actualkillsCount / maxKillsCount, this.textColor(stv_BeastBook_killsCountColor1), this.textColor(stv_BeastBook_killsCountColor2));
  949.         this.drawText(stv_BeastBook_killsText, gaugeXpos - this.textWidth(stv_BeastBook_killsText) - stv_BeastBook_padding, gaugeYpos);
  950.         this.drawText(killsCountText, this.contents.width - this.textWidth(killsCountText), gaugeYpos);
  951.       
  952.     };
  953.    
  954.     Window_BeastBook_Info.prototype.deleteBitmaps = function() {
  955.         this._beastSprite.bitmap = null;
  956.         this._beastBackSprite.bitmap = null;
  957.         this._battleBack1.bitmap = null;
  958.         this._battleBack2.bitmap = null;
  959.     };
  960.    
  961.     Window_BeastBook_Info.prototype.refresh = function() {
  962.         this.contents.clear();
  963.         this.deleteBitmaps();
  964.       
  965.         if ($beastBook.isRevealed(this._beast.id)) {
  966.             if (stv_BeastBook_showBattleBack == "TRUE") this.contentDrawBattleBack();
  967.             this.contentDrawBeast();
  968.             if ($gameSwitches.value(stv_BeastBook_showItemsSwitch) || !stv_BeastBook_showItemsSwitch) this.contentDrawItems();
  969.             if ($gameSwitches.value(stv_BeastBook_showSkillsSwitch) || !stv_BeastBook_showSkillsSwitch) this.contentDrawAbilities();
  970.             if ($gameSwitches.value(stv_BeastBook_showKillCounterSwitch) || !stv_BeastBook_showKillCounterSwitch) this.contentDrawKillCounter();
  971.             if ($gameSwitches.value(stv_BeastBook_showExpSwitch) || !stv_BeastBook_showExpSwitch) this.contentDrawExp();
  972.             if ($gameSwitches.value(stv_BeastBook_showGoldSwitch) || !stv_BeastBook_showGoldSwitch) this.contentDrawGold();
  973.         }
  974.     };

  975. // ----------------------------------------------------------------------------------------------------------------------------
  976. // Fill Elements Window
  977. // ----------------------------------------------------------------------------------------------------------------------------
  978.     function Window_BeastBook_Elements() {
  979.         this.initialize.apply(this, arguments);
  980.     }

  981.     Window_BeastBook_Elements.prototype = Object.create(Window_Base.prototype);
  982.     Window_BeastBook_Elements.prototype.constructor = Window_BeastBook_Elements;

  983.     Window_BeastBook_Elements.prototype.initialize = function(x, y, width, height) {
  984.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  985.     };
  986.    
  987.     Window_BeastBook_Elements.prototype.setBeast= function(beast) {
  988.         this._beast = beast;
  989.         this.refresh();
  990.     };
  991.    
  992.     Window_BeastBook_Elements.prototype.contentDrawResistance = function() {
  993.         var ii = 1;
  994.         var counter = 0;
  995.         var y = this.lineHeight()-stv_BeastBook_padding;
  996.       
  997.         for (var i = 0; i < 30; i++) {
  998.       
  999.             if (i < this._beast.traits.length) {
  1000.                 if (this._beast.traits[i].code === 11) {
  1001.                     counter += 1;
  1002.                     this.changeTextColor(this.systemColor());
  1003.                     this.drawTextEx($dataSystem.elements[this._beast.traits[i].dataId], 0, y*ii);
  1004.                         if (this._beast.traits[i].value*100 > 100) {
  1005.                             this.changeTextColor(this.textColor(3));
  1006.                         }
  1007.                         else if (this._beast.traits[i].value*100 < 100) {
  1008.                             this.changeTextColor(this.textColor(2));
  1009.                         } else {
  1010.                             this.changeTextColor(this.normalColor());
  1011.                         }
  1012.                     this.drawText((Math.round(this._beast.traits[i].value*100)) + "%", (Graphics.boxWidth/3) - 110, y*ii, 70, 'right');
  1013.                     ii += 1;
  1014.                     this.changeTextColor(this.normalColor());
  1015.                 }
  1016.             }
  1017.         }
  1018.         if (counter <= 0) {
  1019.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  1020.             this.drawText(stv_BeastBook_noData, (this.contents.width/2) - (this.textWidth(stv_BeastBook_noData)/2), y);
  1021.             this.changeTextColor(this.normalColor());
  1022.         }
  1023.       
  1024.     };
  1025.    
  1026.     Window_BeastBook_Elements.prototype.refresh = function() {
  1027.         this.contents.clear();
  1028.       
  1029.         this.drawText(stv_BeastBook_weaknessText, (this.contents.width/2) - (this.textWidth(stv_BeastBook_weaknessText)/2),0);
  1030.       
  1031.         if ($beastBook.isRevealed(this._beast.id)) {
  1032.             this.contentDrawResistance();
  1033.         }
  1034.     };

  1035. // ----------------------------------------------------------------------------------------------------------------------------
  1036. // Fill Parameters Window
  1037. // ----------------------------------------------------------------------------------------------------------------------------
  1038.     function Window_BeastBook_Parameters() {
  1039.         this.initialize.apply(this, arguments);
  1040.     }

  1041.     Window_BeastBook_Parameters.prototype = Object.create(Window_Base.prototype);
  1042.     Window_BeastBook_Parameters.prototype.constructor = Window_BeastBook_Parameters;

  1043.     Window_BeastBook_Parameters.prototype.initialize = function(x, y, width, height) {
  1044.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  1045.     };
  1046.    
  1047.     Window_BeastBook_Parameters.prototype.setBeast= function(beast) {
  1048.         this._beast = beast;
  1049.         this.refresh();
  1050.     };
  1051.    
  1052.     Window_BeastBook_Parameters.prototype.contentDrawLeftParameters = function() {
  1053.         var y = 0;
  1054.         var leftEdgePos = (this.contents.width/2) - stv_BeastBook_padding;
  1055.       
  1056.         for (var i = 0; i < 4; i++) {
  1057.            
  1058.             this.contents.paintOpacity = stv_BeastBook_bbOpacity;
  1059.             this.contents.fillRect(0, y, leftEdgePos, this.lineHeight(), this.gaugeBackColor());
  1060.             this.contents.paintOpacity = 255;
  1061.            
  1062.             this.changeTextColor(this.systemColor());
  1063.             this.drawText(TextManager.param(i), stv_BeastBook_padding, y, 160);
  1064.             this.resetTextColor();        
  1065.             this.drawText(this._beast.params[i], leftEdgePos - stv_BeastBook_padding - this.textWidth(this._beast.params[i]), y, 60);
  1066.             y += this.lineHeight() + stv_BeastBook_padding;
  1067.         }
  1068.     };
  1069.    
  1070.     Window_BeastBook_Parameters.prototype.contentDrawRightParameters = function() {
  1071.         var y = 0;
  1072.         var rightEdgePos = (this.contents.width/2) + stv_BeastBook_padding;
  1073.         var leftEdgePos = (this.contents.width/2) - stv_BeastBook_padding;
  1074.       
  1075.         for (var j = 4; j < 8; j++) {
  1076.            
  1077.             this.contents.paintOpacity = stv_BeastBook_bbOpacity;
  1078.             this.contents.fillRect(rightEdgePos, y, leftEdgePos, this.lineHeight(), this.gaugeBackColor());
  1079.             this.contents.paintOpacity = 255;
  1080.            
  1081.             this.changeTextColor(this.systemColor());
  1082.             this.drawText(TextManager.param(j), rightEdgePos + stv_BeastBook_padding, y, 160);
  1083.             this.resetTextColor();        
  1084.             this.drawText(this._beast.params[j], this.contents.width - stv_BeastBook_padding - this.textWidth(this._beast.params[j]), y, 60);
  1085.             y += this.lineHeight() + stv_BeastBook_padding;
  1086.         }
  1087.     };
  1088.    
  1089.     Window_BeastBook_Parameters.prototype.refresh = function() {
  1090.         this.contents.clear();
  1091.       
  1092.         if ($beastBook.isRevealed(this._beast.id)) {
  1093.             this.contentDrawLeftParameters();
  1094.             this.contentDrawRightParameters();
  1095.         }
  1096.     };


  1097. // ----------------------------------------------------------------------------------------------------------------------------
  1098. // Alias methods
  1099. // ----------------------------------------------------------------------------------------------------------------------------
  1100.     STV_BeastBook_PluginCommand = Game_Interpreter.prototype.pluginCommand;
  1101.     STV_BeastBook_Create = DataManager.createGameObjects;
  1102.     STV_BeastBook_Save = DataManager.makeSaveContents;
  1103.     STV_BeastBook_Load = DataManager.extractSaveContents;
  1104.     STV_BeastBook_BattleBack = Spriteset_Battle.prototype.createBattleback;
  1105.     STV_BeastBook_DropItems = Game_Enemy.prototype.makeDropItems;

  1106. // ----------------------------------------------------------------------------------------------------------------------------
  1107. // DataManager
  1108. // ----------------------------------------------------------------------------------------------------------------------------
  1109.     var $beastBook = null;

  1110.     DataManager.makeSaveContents = function() {
  1111.         contents = STV_BeastBook_Save.call(this);
  1112.         contents.enemybook = $beastBook;
  1113.         return contents;
  1114.     };
  1115.    
  1116.     DataManager.extractSaveContents = function(contents) {
  1117.         STV_BeastBook_Load.call(this, contents);
  1118.         $beastBook = contents.enemybook;
  1119.     };
  1120.    
  1121.     DataManager.createGameObjects = function() {
  1122.         STV_BeastBook_Create.call(this);
  1123.         $beastBook = new Beast_Book();
  1124.     };
  1125.    
  1126. // ----------------------------------------------------------------------------------------------------------------------------
  1127. // Get EnemyTroop Info
  1128. // ----------------------------------------------------------------------------------------------------------------------------
  1129.     Game_Troop.prototype.updateInterpreter = function() {
  1130.         this._interpreter.update();

  1131.             for (var i = 0; i < $gameTroop.members().length; i++) {
  1132.             var stv_beastID = $gameTroop.members()[i]._enemyId;
  1133.             var stv_beastIsAlive = $gameTroop.members()[i].isAlive();
  1134.            
  1135.             switch (stv_BeastBook_fillBehavior) {
  1136.                 case '1':
  1137.                     $beastBook.addBeast(stv_beastID);
  1138.                     $beastBook.setBattleBacks(stv_beastID);
  1139.                 break;
  1140.                 case '2':
  1141.                     if (!stv_beastIsAlive){
  1142.                         $beastBook.addBeast(stv_beastID);
  1143.                         $beastBook.setBattleBacks(stv_beastID);
  1144.                     }
  1145.                 break;
  1146.                 case '3':
  1147.                 break;
  1148.             }
  1149.         }
  1150.     };
  1151.    
  1152. // ----------------------------------------------------------------------------------------------------------------------------
  1153. // Get BattleBack Info
  1154. // ----------------------------------------------------------------------------------------------------------------------------   
  1155.     Spriteset_Battle.prototype.createBattleback = function() {
  1156.         STV_BeastBook_BattleBack.call(this);
  1157.         $beastBook.battleBack1 = this._back1Sprite.bitmap._url;
  1158.         $beastBook.battleBack2 = this._back2Sprite.bitmap._url;
  1159.     };
  1160.    
  1161. // ----------------------------------------------------------------------------------------------------------------------------
  1162. // Item Discover // Kill Counter
  1163. // ----------------------------------------------------------------------------------------------------------------------------
  1164.     Game_Enemy.prototype.makeDropItems = function() {
  1165.         var rewards = STV_BeastBook_DropItems.call(this);
  1166.         var beastId = this._enemyId;
  1167.         var list = $beastBook.beasts[beastId];
  1168.            
  1169.         if(list.kills < list.maxKills) list.kills += 1;
  1170.         $beastBook.killAchievmentCheck(beastId);
  1171.         rewards.forEach(function(item) {
  1172.             $beastBook.discoverItem(beastId, item);
  1173.         });
  1174.         return rewards;
  1175.     };

  1176. // ----------------------------------------------------------------------------------------------------------------------------
  1177. // Beast_Book
  1178. // ----------------------------------------------------------------------------------------------------------------------------

  1179.     function Beast_Book() {
  1180.         this.initialize.apply(this, arguments);
  1181.     }
  1182.    
  1183.     Beast_Book.prototype.initialize = function() {
  1184.         this.clear();
  1185.     };
  1186.    
  1187.     // Set BattleBacks
  1188.     Beast_Book.prototype.setBattleBacks = function(beastId) {
  1189.         $beastBook.beasts[beastId]._battleBack1 = $beastBook.battleBack1;
  1190.         $beastBook.beasts[beastId]._battleBack2 = $beastBook.battleBack2;
  1191.     };
  1192.    
  1193.     // Clear Book
  1194.     Beast_Book.prototype.clear = function() {
  1195.         this.beasts = [0];
  1196.         var maxBeasts = $dataEnemies.length;
  1197.         if (stv_BeastBook_maxBeasts && stv_BeastBook_maxBeasts < maxBeasts) maxBeasts = stv_BeastBook_maxBeasts + 1;
  1198.       
  1199.         for (var i = 1; i < maxBeasts; ++i) {
  1200.            
  1201.             var enemy = $dataEnemies[i];
  1202.             if (!this.beasts[i]) this.beasts[i] = {};
  1203.            
  1204.             if (!this.beasts[i].show) {
  1205.                 this.beasts[i].show = true;
  1206.                 if (enemy.meta.BeastBook == 'hide') this.beasts[i].show = false;
  1207.             }
  1208.             if (!this.beasts[i].discovered) this.beasts[i].discovered = false;
  1209.             if (!this.beasts[i].discoveredItems) this.beasts[i].discoveredItems = [false,false,false];
  1210.             if (!this.beasts[i].kills) this.beasts[i].kills = 0;
  1211.             if (!this.beasts[i]._battleBack1) this.beasts[i]._battleBack1 = stv_BeastBook_defaultBattleBack;
  1212.             if (!this.beasts[i]._battleBack2) this.beasts[i]._battleBack2 = stv_BeastBook_defaultBattleBack;
  1213.            
  1214.             if (!this.beasts[i].maxKills) {
  1215.                 if (!enemy.meta.BeastBookMaxKills) {
  1216.                     this.beasts[i].maxKills = stv_BeastBook_maxKills;
  1217.                 } else {
  1218.                     this.beasts[i].maxKills = enemy.meta.BeastBookMaxKills;
  1219.                 }
  1220.             }  
  1221.         }
  1222.     };
  1223.    
  1224.     // Complete All
  1225.     Beast_Book.prototype.complete = function() {
  1226.         this.completeBeasts();
  1227.         this.completeItems();
  1228.         this.completeKills();
  1229.     };  
  1230.    
  1231.     // Complete Enemies
  1232.     Beast_Book.prototype.completeBeasts = function() {
  1233.         for (var i = 1; i < this.beasts.length; i++) {
  1234.             this.beasts[i].discovered = true;
  1235.         }
  1236.         this.getRevealed();
  1237.     };
  1238.    
  1239.     // Complete Items
  1240.     Beast_Book.prototype.completeItems = function() {
  1241.         for (var i = 1; i < this.beasts.length; i++) {
  1242.             this.beasts[i].discoveredItems = [true,true,true];
  1243.         }
  1244.     };
  1245.    
  1246.     // Complete Kills
  1247.     Beast_Book.prototype.completeKills = function() {
  1248.         for (var i = 1; i < this.beasts.length; i++) {
  1249.             this.beasts[i].kills = this.beasts[i].maxKills;
  1250.             this.killAchievmentCheck(i);
  1251.         }
  1252.     };
  1253.    
  1254.     // Clear Items
  1255.     Beast_Book.prototype.clearItems = function() {
  1256.         for (var i = 1; i < this.beasts.length; i++) {
  1257.             this.beasts[i].discoveredItems = [false,false,false];
  1258.         }
  1259.     };
  1260.    
  1261.     // Hide Beast
  1262.     Beast_Book.prototype.hideBeast = function(beastId) {
  1263.         if (!this.beasts) this.clear();
  1264.         if (this.beasts[beastId]) this.beasts[beastId].show = false;
  1265.         this.getRevealed();
  1266.     };
  1267.    
  1268.     // Show Beast
  1269.     Beast_Book.prototype.showBeast = function(beastId) {
  1270.         if (!this.beasts) this.clear();
  1271.         if (this.beasts[beastId]) this.beasts[beastId].show = true;
  1272.         this.getRevealed();
  1273.     };
  1274.    
  1275.     // Add Beast
  1276.     Beast_Book.prototype.addBeast = function(beastId) {
  1277.         if (!this.beasts) this.clear();
  1278.         this.beasts[beastId].discovered = true;
  1279.         this.getRevealed();
  1280.     };

  1281.     // Remove Beast
  1282.     Beast_Book.prototype.removeBeast = function(beastId) {
  1283.         if (this.beasts) {
  1284.             this.beasts[beastId].discovered = false;
  1285.         }
  1286.     };
  1287.    
  1288.     // Check if Enemy is revealed
  1289.     Beast_Book.prototype.isRevealed = function(beast) {
  1290.         if (this.beasts && beast) {
  1291.             return this.beasts[beast].discovered;
  1292.         } else {
  1293.             return false;
  1294.         }
  1295.     };
  1296.    
  1297.     // Add Kill
  1298.     Beast_Book.prototype.addKill = function(beastId, value) {
  1299.         if (this.beasts[beastId]) {
  1300.             this.beasts[beastId].kills += value;
  1301.         }
  1302.     };

  1303.     // Set Max Kills
  1304.     Beast_Book.prototype.setMaxKills = function(beastId, value) {
  1305.         if (this.beasts[beastId]) {
  1306.             this.beasts[beastId].maxKills = value;
  1307.         }
  1308.     };
  1309.    
  1310.     // Check Kill Achievment
  1311.     Beast_Book.prototype.killAchievmentCheck = function(beastID) {
  1312.             var beast = this.beasts[beastID];
  1313.             if(beast.kills == beast.maxKills) {
  1314.                 var achievmentSwitch = stv_BeastBook_killAchievmentSwitch + beastID;
  1315.             if (stv_BeastBook_killAchievmentSwitch) $gameSwitches.setValue(achievmentSwitch, true);
  1316.             }
  1317.     };  
  1318.    
  1319.     // Get Revealed Beasts
  1320.     Beast_Book.prototype.getRevealed = function() {
  1321.         var discoveredLength = 0;
  1322.         for (var i = 1; i < this.beasts.length; i++) {
  1323.             if(this.beasts[i].discovered) discoveredLength += 1;
  1324.         }
  1325.         $gameVariables.setValue(stv_BeastBook_countDiscovered, discoveredLength);
  1326.         if(discoveredLength >= ($dataEnemies.length-1)) $gameSwitches.setValue(stv_BeastBook_bookFullSwitch, true);
  1327.     };
  1328.    
  1329.     // Discover Item
  1330.     Beast_Book.prototype.discoverItem = function(E_Id, item) {
  1331.         var itemKind;
  1332.         if (DataManager.isItem(item)) itemKind = 1;
  1333.         if (DataManager.isWeapon(item)) itemKind = 2;
  1334.         if (DataManager.isArmor(item)) itemKind = 3;   
  1335.         for (var i = 0; i < 3; i++) {
  1336.             if ($dataEnemies[E_Id].dropItems[i].kind == itemKind && $dataEnemies[E_Id].dropItems[i].dataId == item.id) {
  1337.                 var items = this.beasts[E_Id].discoveredItems;
  1338.                 items[i] = true;
  1339.             }
  1340.         }  
  1341.     };

  1342. // ----------------------------------------------------------------------------------------------------------------------------
  1343. // Draw Skill Name Function
  1344. // ----------------------------------------------------------------------------------------------------------------------------  
  1345.     Window_Base.prototype.drawSkillName = function(skill, x, y, width) {
  1346.         if (skill) {
  1347.             if (this.textWidth(skill.name) > width) {
  1348.                 this.drawText(skill.name, x + this.textWidth(skill.name) - width, y, width);  
  1349.             } else{
  1350.                 this.drawText(skill.name, x, y, width);  
  1351.             }
  1352.             this.drawIcon(skill.iconIndex, x + this.textWidth(skill.name) + 4, y + 2);
  1353.         }
  1354.     };

  1355. // ----------------------------------------------------------------------------------------------------------------------------
  1356. // Plugin Commands
  1357. // ----------------------------------------------------------------------------------------------------------------------------
  1358.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  1359.         STV_BeastBook_PluginCommand.call(this, command, args);
  1360.       
  1361.         if (command === 'BeastBook') {
  1362.             switch (args[0]) {
  1363.                 case 'open':
  1364.                     SceneManager.push(Scene_BeastBook);
  1365.                 break;
  1366.                 case 'hide':
  1367.                     $beastBook.hideBeast(Number(args[1]));
  1368.                 break;
  1369.                 case 'show':
  1370.                     $beastBook.showBeast(Number(args[1]));
  1371.                 break;
  1372.                 case 'add':
  1373.                     $beastBook.addBeast(Number(args[1]));
  1374.                 break;
  1375.                 case 'addvar':
  1376.                     $beastBook.addBeast(Number($gameVariables.value(args[1])));
  1377.                 break;
  1378.                 case 'addkill':
  1379.                     $beastBook.addKill(Number(args[1]), Number(args[2]));
  1380.                 break;
  1381.                 case 'maxkills':
  1382.                     $beastBook.setMaxKills(Number(args[1]), Number(args[2]));
  1383.                 break;
  1384.                 case 'remove':
  1385.                     $beastBook.removeBeast(Number(args[1]));
  1386.                 break;
  1387.                 case 'clear':
  1388.                     $beastBook.clear();
  1389.                 break;
  1390.                 case 'complete':
  1391.                     $beastBook.complete();
  1392.                 break;
  1393.                 case 'completebeasts':
  1394.                     $beastBook.completeBeasts();
  1395.                 break;
  1396.                 case 'completeitems':
  1397.                     $beastBook.completeItems();
  1398.                 break;
  1399.                 case 'completekills':
  1400.                     $beastBook.completeKills();
  1401.                 break;
  1402.                 case 'clearitems':
  1403.                     $beastBook.clearItems();
  1404.                 break;
  1405.             }
  1406.         }
  1407.     };
复制代码
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5692
在线时间
1556 小时
注册时间
2011-6-14
帖子
520
6
发表于 2021-4-16 00:13:30 | 只看该作者
改好了 使用方法是这样,需要自己设置满击杀值后的奖励,与判定开关,具体看说明




JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // STV_BeastBook.js
  3. //=============================================================================
  4.  
  5. /*:
  6. * @plugindesc v2.5 - STV_BeastBook
  7. * || This will add an Beast Register to your Game
  8. * @author SkottyTV (base idea from Yoji Ojima) & 9527(奖励获取功能添加)
  9. *
  10. * @param ----- Window -----
  11. *
  12. * @param Show Window
  13. * @desc Show or Hide Window Skin
  14. * TRUE = show window / FALSE = hide window
  15. * @default TRUE
  16. *
  17. * @param Background Picture
  18. * @desc The Background Picture in img/pictures/
  19. * (leave empty for no Background Picture)
  20. * @default
  21. *
  22. * @param Show Background Enemy
  23. * @desc Show a Picture of the Enemy in the Background
  24. * (TRUE = show // FALSE = hide)
  25. * @default TRUE
  26. *
  27. * @param Show Battle Back
  28. * @desc Shows Picture of first kill/encounter place
  29. * (TRUE = show // FALSE = hide)
  30. * @default TRUE
  31. *
  32. * @param Default Battle Back
  33. * @desc The Default Battle Back Picture
  34. * (if beasts added with plugin commands) !(Use "/")
  35. * @default img/parallaxes/BlueSky.png
  36. *
  37. * @param Battle Back Index
  38. * @desc The Z Position of the Battle Back
  39. * (0 = behind Windowskin // 1 = over Windowskin)
  40. * @default 0
  41. *
  42. * @param ----- ASV -----
  43. *
  44. * @param ASV Animation Speed
  45. * @desc The Animation Speed of ASV-Battler
  46. * (the higher the number the slower the animation)
  47. * @default 10
  48. *
  49. * @param ASV Animated Pattern
  50. * @desc The ASV-Pattern you want to display
  51. * (default 0 = The topleft 3 Pictures)
  52. * @default 0
  53. *
  54. * @param ----- Functions -----
  55. *
  56. * @param Max Beasts
  57. * @desc Number of Beasts used. (first X in Database)
  58. * (leave empty to use all beasts)
  59. * @default
  60. *
  61. * @param Fill Behavior
  62. * @desc How the Book will get filled
  63. * 1 = Encounter / 2 = Kill / 3 = None (only commands)
  64. * @default 2
  65. *
  66. * @param ID in front of Name
  67. * @desc Show the ID in front of the Name
  68. * TRUE = "4 - Monster" / FALSE = "Monster"
  69. * @default TRUE
  70. *
  71. * @param ID in front of Unknown Enemy
  72. * @desc Show the ID in front of the Name
  73. * TRUE = "4 - ???" / FALSE = "???"
  74. * @default TRUE
  75. *
  76. * @param Animate Enemy
  77. * @desc Choose if you want an animated Enemy
  78. * TRUE = animated / FALSE = static
  79. * @default TRUE
  80. *
  81. * @param Backbar Opacity
  82. * @desc Set the Backbar opacity
  83. * 255 = Full Visible / 0 = Invisible
  84. * @default 130
  85. *
  86. * @param Count Discovered Variable
  87. * @desc Save number of discovered Enemies in Variable
  88. * @default 0
  89. *
  90. * @param Book Full Switch
  91. * @desc Switch set ON when beast book is full
  92. * @default 0
  93. *
  94. * @param Exp Icon
  95. * @desc Set the Exp Icon
  96. * @default 189
  97. *
  98. * @param Gold Icon
  99. * @desc Set the Gold Icon
  100. * @default 314
  101. *
  102. * @param ----- Text -----
  103. *
  104. * @param Unknown Info
  105. * @desc How "Unknown Info" Text appears
  106. * @default ???
  107. *
  108. * @param None Data
  109. * @desc How "None Data" Text appears
  110. * @default none
  111. *
  112. * @param Drops Text
  113. * @desc Headline of Enemy Item Drops
  114. * @default Items:
  115. *
  116. * @param Skills Text
  117. * @desc Headline of Enemy Skills
  118. * @default Skills:
  119. *
  120. * @param Weakness Text
  121. * @desc Headline of Weakness Window
  122. * @default Weakness
  123. *
  124. * @param Kill Counter Text
  125. * @desc Headline of Kill Counter
  126. * @default Kills:
  127. *
  128. * @param ----- Colors -----
  129. *
  130. * @param Drops Success Color
  131. * @desc The Default Color for Item Drops Success Rate
  132. * @default 6
  133. *
  134. * @param Skills Color
  135. * @desc The Default Color for Skills
  136. * @default 3
  137. *
  138. * @param Unknown Color
  139. * @desc The Default Color for "Unknown"
  140. * @default 7
  141. *
  142. * @param ----- Switches -----
  143. *
  144. * @param Info Window Switch
  145. * @desc Choose a Switch to show the Info Window
  146. * (leave empty or "0" to show the window permanently)
  147. * @default 0
  148. *
  149. * @param Weakness Window Switch
  150. * @desc Choose a Switch to show the Weakness Window
  151. * (leave empty or "0" to show the window permanently)
  152. * @default 0
  153. *
  154. * @param Parameter Window Switch
  155. * @desc Choose a Switch to show the Parameter Window
  156. * (leave empty or "0" to show the window permanently)
  157. * @default 0
  158. *
  159. * @param Show Items Switch
  160. * @desc The Switch for showing Items
  161. * (leave empty or "0" to show the Items permanently)
  162. * @default 0
  163. *
  164. * @param Show Skills Switch
  165. * @desc The Switch for showing Skills
  166. * (leave empty or "0" to show the Skills permanently)
  167. * @default 0
  168. *
  169. * @param Show EXP Switch
  170. * @desc The Switch for showing EXP
  171. * (leave empty or "0" to show the EXP permanently)
  172. * @default 0
  173. *
  174. * @param Show Gold Switch
  175. * @desc The Switch for showing Gold
  176. * (leave empty or "0" to show the Gold permanently)
  177. * @default 0
  178. *
  179. * @param Show Kill Counter Switch
  180. * @desc The Switch for showing Kill Counter
  181. * (leave empty or "0" to show the Kill Counter permanently)
  182. * @default 0
  183. *
  184. * @param ----- Kill Counter -----
  185. *
  186. * @param Max Kills Value
  187. * @desc The default value for kills needed
  188. * (get overwritten by plugin command "BeastBook maxkills")
  189. * @default 25
  190. *
  191. * @param Kills Achievment Start Switch
  192. * @desc Number of the switch to start with achievments
  193. * (Example: 500 = Enemy Id 17 will set Switch 517)
  194. * @default 0
  195. *
  196. * @param Kills Bar Color 1
  197. * @desc The first Color for the Kill Counter Bar
  198. * @default 6
  199. *
  200. * @param Kills Bar Color 2
  201. * @desc The second Color for the Kill Counter Bar
  202. * @default 17
  203. *
  204. * @help
  205. *
  206. * ////////////////////////////////////////////////////////////////////////////
  207. * ----------------------------- Terms of Usage: ------------------------------
  208. * ////////////////////////////////////////////////////////////////////////////
  209.  
  210. * Feel free to use this Plugin in 1. Non-Commercial Games, 2. Commercial Games
  211. * However it would be nice to give proper Credits to "SkottyTV".
  212. * Please also give proper Credits to Yoji Ojima for the base idea.
  213. *
  214. * Have Fun And Enjoy! :)
  215. *
  216. *
  217. *
  218. * ////////////////////////////////////////////////////////////////////////////
  219. * --------------------------------- Updates:----------------------------------
  220. * ////////////////////////////////////////////////////////////////////////////
  221. *
  222. * Update v2.5
  223. * - Added "Max Beasts" option.
  224. * - Added Plugincommand "BeastBook hide X" and "BeastBook show X".
  225. *
  226. * Update v2.4a
  227. * - Bug fixes
  228. *
  229. * Update v2.4
  230. * - Added support funtion for YEP_X_AnimatedSVEnemies
  231. * - Code clean / Bug fixes
  232. *
  233. * Update v2.3
  234. * - Added the possibility to print Icons in front of the Weaknesses
  235. * - Option to show the BattleBackground where the Beast was killed/encountered
  236. *
  237. * Update v2.2h
  238. * - Option to show the ID in front of Unknown Beast -> "1 - ???"
  239. * - Added possibility to change the Beast Pic with <BeastBookPic:Path>
  240. * - Added option to change "unknown" color.
  241. * - Maxkills can now be set in the Enemy note box!
  242. * - IMPORTANT: Fixed Bug where savegames not contain BeastBook data !!!
  243. *
  244. * Update v2.1a
  245. * - bug fixes
  246. *
  247. * Update v2.1
  248. * - Added functions: completekills, completeitems
  249. * - bug fixes
  250. *
  251. * Update v2.0
  252. * - Option to hide skills inside the Book
  253. * - Added a Kill Counter Function including Achievment Switches
  254. * - Drop Items show only if discovered
  255. * - Drop Items now show their success Rate
  256. * - Better Beast Animation
  257. * - Background Picture possible
  258. * - Visual improvements!
  259. *
  260. *
  261. 使用方法:   在打开图鉴插件指令下面创建脚本指令  dhjl.apply(this);     
  262. 具体设定更改在1421行以下更改
  263. 检测开关x判断有没有获取过奖励,如果开关x打开就不给奖励
  264.  
  265. 增加属性例子
  266.         for(var i = 1;i<$gameParty.members().length;i++){
  267.         $gameActors.actor(i).addParam(0,100);
  268.         所有角色最大hp增加100
  269.         $gameActors.actor(i).addParam(1,100);
  270.         所有角色最大mp增加100
  271.         $gameActors.actor(i).addParam(2,100);
  272.         所有角色攻击力增加100
  273.         $gameActors.actor(i).addParam(3,100);
  274.         所有角色防御力增加100
  275.         $gameActors.actor(i).addParam(4,100);
  276.         所有角色魔攻增加100
  277.         $gameActors.actor(i).addParam(5,100);
  278.         所有角色魔防增加100
  279.         $gameActors.actor(i).addParam(6,100);
  280.         所有角色敏捷增加100
  281.         $gameActors.actor(i).addParam(7,100);
  282.         所有角色幸运增加100
  283.                 $gameActors.actor(i).gainExp(100); //为所有队伍成员获得100点经验值
  284.                 $gameActors.actor(i).changeLevel($gameActors.actor(i).level+1,false);所有队伍成员等级提升1,显示升级信息第一个参数为角色的编号,第二个为是否显示升级信息,true或者false
  285.         }
  286.  
  287. 增加物品例子
  288. $gameParty.gainItem($dataItems[5], 1, true); //获取5号物品
  289.  
  290.  
  291. 增加武器例子
  292. $gameParty.gainItem($dataWeapons[5], 1, true); //获取5号武器
  293.  
  294. 增加属性例子
  295. $gameParty.gainItem($dataArmors[5], 1, true); //获取5号防具
  296.  
  297.  
  298.  
  299. * ////////////////////////////////////////////////////////////////////////////
  300. * -------------------------------- Commands: ---------------------------------
  301. * ////////////////////////////////////////////////////////////////////////////
  302. *
  303. * Plugin Command:
  304. *   BeastBook open             # Open the beast book screen
  305. *   BeastBook hide 6           # Hide Beast 6 in book.
  306. *   BeastBook show 6           # Show Beast 6 in book.
  307. *   BeastBook add 3            # Add enemy #3 to the beast book
  308. *   BeastBook addvar 10        # Add enemy (ID) that is in variable 10
  309. *   BeastBook addkill 6 2      # Add 2 kills for enemyID 6
  310. *   BeastBook addkill 6 -4     # Removes 4 kills from enemyID 6
  311. *   BeastBook maxkills 3 50    # Set max kills for enemyID 3 to 50 kills
  312. *   BeastBook remove 16        # Remove enemy #16 from the beast book
  313. *   BeastBook complete         # Complete the whole Book
  314. *   BeastBook completeenemies  # Complete all Enemies
  315. *   BeastBook completeitems    # Complete all Drops
  316. *   BeastBook completekills    # Complete all Kills
  317. *   BeastBook clear            # Clear the beast book
  318. *   BeastBook clearitems       # Clear all items
  319. *
  320. * Enemy Note:
  321. *   <desc1:The mighty Clown>   # Description text in the beast book, line 1
  322. *   <desc2:This is Line 2>     # Description text in the beast book, line 2
  323. *   <desc3:Some Info here?>    # Description text in the beast book, line 3
  324. *   <desc4:Even more Info!>    # Description text in the beast book, line 4
  325. *   <BeastBook:hide>           # This Enemy will not appear in the beast book
  326. *   <BeastBookPic:PATH>        # Changes the Pic of an Enemy to "PATH"
  327. *                                Example: <BeastBookPic:img/enemies/Slime>
  328. *                                Don´t type ".png" !
  329. *   <BeastBookMaxKills:5>      # Set the MaxKills of the Enemy to 5.
  330. *
  331. * Skill Note:
  332. *   <BeastBook:hide>           # This Skill will not appear in the beast book
  333. *
  334. *
  335. *
  336. * ////////////////////////////////////////////////////////////////////////////
  337. * --------------------- Examples / Tutorials / Help: -------------------------
  338. * ////////////////////////////////////////////////////////////////////////////
  339. *
  340. * ------------------------Investigate Skill Tutorial:--------------------------
  341. * (!!! You will NEED YanFly´s Battle Engine Core and ActSeqPack1 !!!)
  342. *
  343. * - First set the "Fill Behavior" option of this plugin to "3" (None).
  344. * - Now create a skill which calls a common event "X" and have the following
  345. *   in its notebox:
  346. *   <Target Action>
  347. *    Change Variable Y = target._enemyId
  348. *   </Target Action>
  349. * - Now in the common event "X" call a Plugin-Line and write:
  350. *   BeastBook addvar Y
  351. * - Done!
  352. *
  353. * ("X" and "Y" is a number you choose)
  354. * -----------------------------------------------------------------------------
  355. *
  356. * ------------------------ Weakness Icons Tutorial:----------------------------
  357. * You are able to use icons for the beast weaknesses.
  358. *
  359. * Got to: RPG Maker MV Editor -> Database -> Types
  360. * On the Elements tab rename an element like this:
  361. *
  362. * 01. Physical ->   \i[76]Physical         //This will print Icon 76 in front
  363. * 01. Fire     ->   \i[64]Fire             //This will print Icon 64 in front
  364. *
  365. *
  366. * -----------------------------------------------------------------------------
  367. *
  368. * -------------------------- Animated Side View: ------------------------------
  369. * With Yanfly´s "YEP_X_AnimatedSVEnemies" Plugin you are able
  370. * to set an animated Battler grafic by typing "<Sideview Battler: filename>"
  371. * into an enemies notebox.
  372. * The STV_BeastBook will show this animated battler if it is used.
  373. *
  374. * With the Plugin Parameter "ASV Animated Pattern" you can decide which Pattern
  375. * you want the Book to show.
  376. *
  377. * A default ASV Battler file looks like this: ( [] <- a pic of the enemy)
  378. * [][][][][][][][][]
  379. * [][][][][][][][][]
  380. * [][][][][][][][][]
  381. * [][][][][][][][][]
  382. * [][][][][][][][][]
  383. * [][][][][][][][][]
  384. *
  385. * So if you set the "ASV Animated Pattern" to 3 the animation will be:
  386. * [][][][][][][][][]
  387. * [][][][][][][][][]
  388. * [][][][][][][][][]
  389. * [x][x][x][][][][][][]
  390. * [][][][][][][][][]
  391. * [][][][][][][][][]
  392. *
  393. *
  394. * -----------------------------------------------------------------------------
  395. *
  396. */
  397.  
  398. // ----------------------------------------------------------------------------------------------------------------------------
  399. // STV_BeastBook Parameters
  400. // ----------------------------------------------------------------------------------------------------------------------------
  401.     var stv_BeastBook_parameters = PluginManager.parameters('STV_BeastBook');
  402.  
  403.     //----- Window -----
  404.     var stv_BeastBook_showWindow = String(stv_BeastBook_parameters['Show Window'] || 'TRUE');
  405.     var stv_BeastBook_bgPicture = String(stv_BeastBook_parameters['Background Picture'] || '');
  406.     var stv_BeastBook_showBgBeast = String(stv_BeastBook_parameters['Show Background Enemy'] || 'TRUE');
  407.     var stv_BeastBook_showBattleBack = String(stv_BeastBook_parameters['Show Battle Back'] || 'TRUE');
  408.     var stv_BeastBook_defaultBattleBack = String(stv_BeastBook_parameters['Default Battle Back'] || 'img/parallaxes/BlueSky.png');
  409.     var stv_BeastBook_battleBackIndex = Number(stv_BeastBook_parameters['Battle Back Index'] || 0);
  410.  
  411.     //--- Animated Side View ---
  412.     var stv_BeastBook_asvSpeed = Number(stv_BeastBook_parameters['ASV Animation Speed'] || 10);
  413.     var stv_BeastBook_asvPattern = Number(stv_BeastBook_parameters['ASV Animated Pattern'] || 0);
  414.  
  415.     //----- Functions -----
  416.     var stv_BeastBook_fillBehavior = String(stv_BeastBook_parameters['Fill Behavior'] || '2');
  417.     var stv_BeastBook_showID = String(stv_BeastBook_parameters['ID in front of Name'] || 'TRUE');
  418.     var stv_BeastBook_showIDunknown = String(stv_BeastBook_parameters['ID in front of Unknown Enemy'] || 'TRUE');
  419.     var stv_BeastBook_animateBeast = String(stv_BeastBook_parameters['Animate Enemy'] || 'TRUE');
  420.     var stv_BeastBook_bbOpacity = Number(stv_BeastBook_parameters['Backbar Opacity'] || 130);
  421.     var stv_BeastBook_expIcon = Number(stv_BeastBook_parameters['Exp Icon'] || 189);
  422.     var stv_BeastBook_goldIcon = Number(stv_BeastBook_parameters['Gold Icon'] || 314);
  423.     var stv_BeastBook_countDiscovered = Number(stv_BeastBook_parameters['Count Discovered Variable'] || 0);
  424.     var stv_BeastBook_bookFullSwitch = Number(stv_BeastBook_parameters['Book Full Switch'] || 0);
  425.     var stv_BeastBook_maxBeasts = Number(stv_BeastBook_parameters['Max Beasts']);
  426.  
  427.     //----- Text -----
  428.     var stv_BeastBook_unknownData = String(stv_BeastBook_parameters['Unknown Info'] || '???');
  429.     var stv_BeastBook_noData = String(stv_BeastBook_parameters['None Data'] || 'none');
  430.     var stv_BeastBook_dropsText = String(stv_BeastBook_parameters['Drops Text'] || 'Items:');
  431.     var stv_BeastBook_skillsText = String(stv_BeastBook_parameters['Skills Text'] || 'Skills:');
  432.     var stv_BeastBook_weaknessText = String(stv_BeastBook_parameters['Weakness Text'] || 'Weakness');
  433.     var stv_BeastBook_killsText = String(stv_BeastBook_parameters['Kill Counter Text'] || 'Kills:');
  434.  
  435.     //----- Colors -----
  436.     var stv_BeastBook_unknownColor = Number(stv_BeastBook_parameters['Unknown Color'] || 7);
  437.     var stv_BeastBook_skillsColor = Number(stv_BeastBook_parameters['Skills Color'] || 3);
  438.     var stv_BeastBook_dropsSuccessColor = Number(stv_BeastBook_parameters['Drops Success Color'] || 6);
  439.  
  440.     //----- Switches -----
  441.     var stv_BeastBook_statusSwitch = Number(stv_BeastBook_parameters['Info Window Switch'] || 0);
  442.     var stv_BeastBook_elementsSwitch = Number(stv_BeastBook_parameters['Weakness Window Switch'] || 0);
  443.     var stv_BeastBook_parameterSwitch = Number(stv_BeastBook_parameters['Parameter Window Switch'] || 0);
  444.     var stv_BeastBook_showItemsSwitch = Number(stv_BeastBook_parameters['Show Items Switch'] || 0);
  445.     var stv_BeastBook_showSkillsSwitch = Number(stv_BeastBook_parameters['Show Skills Switch'] || 0);
  446.     var stv_BeastBook_showExpSwitch = Number(stv_BeastBook_parameters['Show EXP Switch'] || 0);
  447.     var stv_BeastBook_showGoldSwitch = Number(stv_BeastBook_parameters['Show Gold Switch'] || 0);
  448.     var stv_BeastBook_showKillCounterSwitch = Number(stv_BeastBook_parameters['Show Kill Counter Switch'] || 0);
  449.  
  450.     //----- Kill Counter -----
  451.     var stv_BeastBook_maxKills = Number(stv_BeastBook_parameters['Max Kills Value'] || 25);
  452.     var stv_BeastBook_killsCountColor1 = Number(stv_BeastBook_parameters['Kills Bar Color 1'] || 6);
  453.     var stv_BeastBook_killsCountColor2 = Number(stv_BeastBook_parameters['Kills Bar Color 2'] || 17);
  454.     var stv_BeastBook_killAchievmentSwitch = Number(stv_BeastBook_parameters['Kills Achievment Start Switch'] || 0);
  455.  
  456.     //----- GLOBAL -----
  457.     var stv_BeastBook_padding = 5;
  458.  
  459.  
  460. // ----------------------------------------------------------------------------------------------------------------------------
  461. // Scene BeastBook create
  462. // ----------------------------------------------------------------------------------------------------------------------------  
  463.     Scene_BeastBook = function() {
  464.         this.initialize.apply(this, arguments);
  465.     };
  466.  
  467.     Scene_BeastBook.prototype = Object.create(Scene_MenuBase.prototype);
  468.     Scene_BeastBook.prototype.constructor = Scene_BeastBook;
  469.  
  470.     Scene_BeastBook.prototype.initialize = function() {
  471.         Scene_MenuBase.prototype.initialize.call(this);
  472.     };                                                         
  473.  
  474.     Scene_BeastBook.prototype.createBackground = function() {
  475.         this._backgroundSprite = new Sprite();
  476.         this._backgroundSprite.move(0, 0, Graphics.width, Graphics.height);
  477.         this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
  478.         this.addChild(this._backgroundSprite);
  479.         if (stv_BeastBook_bgPicture){
  480.             this._foregroundSprite = new Sprite();
  481.             this._foregroundSprite.move(0, 0, Graphics.width, Graphics.height);
  482.             this._foregroundSprite.bitmap = ImageManager.loadPicture(stv_BeastBook_bgPicture);
  483.             this.addChild(this._foregroundSprite);
  484.         }
  485.     };
  486.  
  487.     Scene_BeastBook.prototype.create = function() {
  488.         Scene_MenuBase.prototype.create.call(this);
  489.  
  490.         this.createWindowPositions();
  491.         this.createSelectionWindow();
  492.  
  493.         if ($gameSwitches.value(stv_BeastBook_statusSwitch) || !stv_BeastBook_statusSwitch) this.createStatusWindow();
  494.         if ($gameSwitches.value(stv_BeastBook_elementsSwitch) || !stv_BeastBook_elementsSwitch) this.createElementsWindow();
  495.         if ($gameSwitches.value(stv_BeastBook_parameterSwitch) || !stv_BeastBook_parameterSwitch) this.createParametersWindow();
  496.  
  497.         this.createDescriptionWindow();
  498.  
  499.         if(stv_BeastBook_showWindow != "TRUE"){
  500.             this._selectionWindow.opacity = 0;
  501.             this._infoWindow.opacity = 0;
  502.             this._elementsWindow.opacity = 0;
  503.             this._parametersWindow.opacity = 0;
  504.             this._descriptionWindow.opacity = 0;
  505.         }
  506.  
  507.         this.renewWindows();
  508.     };
  509.  
  510. // ----------------------------------------------------------------------------------------------------------------------------
  511. // Create Window Positions
  512. // ----------------------------------------------------------------------------------------------------------------------------
  513.     Scene_BeastBook.prototype.createWindowPositions = function() {
  514.  
  515.         var maxWidth = Graphics.boxWidth,
  516.             maxHeight = Graphics.boxHeight;
  517.  
  518.         var sX = 0,
  519.             sY = 0,
  520.             sW = (maxWidth/3),
  521.             sH = (maxHeight/3)*2;
  522.         this._selectionWindow = new Window_BeastBook_Selection(sX, sY, sW, sH);
  523.  
  524.         var eX = sX,
  525.             eY = sH,
  526.             eW = sW,
  527.             eH = (maxHeight/3);
  528.         this._elementsWindow = new Window_BeastBook_Elements(eX, eY, eW, eH);
  529.  
  530.         var iX = sW,
  531.             iY = sY,
  532.             iW = maxWidth - sW,
  533.             iH = sH;
  534.         this._infoWindow = new Window_BeastBook_Info(iX, iY, iW, iH);
  535.  
  536.         var pX = sW,
  537.             pY = eY,
  538.             pW = iW,
  539.             pH = eH;
  540.         this._parametersWindow = new Window_BeastBook_Parameters(pX, pY, pW, pH);
  541.  
  542.         var dX = pX,
  543.             dY = pY,
  544.             dW = pW,
  545.             dH = pH;
  546.         this._descriptionWindow = new Window_BeastBook_Description(dX, dY, dW, dH);
  547.  
  548.     };
  549.  
  550. // ----------------------------------------------------------------------------------------------------------------------------
  551. // Setup Index Window
  552. // ----------------------------------------------------------------------------------------------------------------------------
  553.     Scene_BeastBook.prototype.createSelectionWindow = function() {
  554.         this._selectionWindow.setHandler('ok', this.onEnemySelect.bind(this));
  555.         this._selectionWindow.setHandler('cancel', this.popScene.bind(this));
  556.         this._selectionWindow.setBeastDataWindows(this._infoWindow, this._parametersWindow, this._elementsWindow, this._descriptionWindow);
  557.         this.addWindow(this._selectionWindow);
  558.     };
  559.  
  560. // ----------------------------------------------------------------------------------------------------------------------------
  561. // Setup Info Window
  562. // ----------------------------------------------------------------------------------------------------------------------------
  563.     Scene_BeastBook.prototype.createStatusWindow = function() {
  564.         this.addWindow(this._infoWindow);
  565.     };
  566.  
  567. // ----------------------------------------------------------------------------------------------------------------------------
  568. // Setup Elements Window
  569. // ----------------------------------------------------------------------------------------------------------------------------
  570.     Scene_BeastBook.prototype.createElementsWindow = function() {
  571.         this.addWindow(this._elementsWindow);
  572.     };
  573.  
  574. // ----------------------------------------------------------------------------------------------------------------------------
  575. // Setup Parameters Window
  576. // ----------------------------------------------------------------------------------------------------------------------------
  577.     Scene_BeastBook.prototype.createParametersWindow = function() {
  578.         this.addWindow(this._parametersWindow);
  579.     };
  580.  
  581. // ----------------------------------------------------------------------------------------------------------------------------
  582. // Setup Description Window
  583. // ----------------------------------------------------------------------------------------------------------------------------
  584.     Scene_BeastBook.prototype.createDescriptionWindow = function() {
  585.         this.addWindow(this._descriptionWindow);
  586.         this._descriptionWindow.hide();
  587.     };
  588.  
  589. // ----------------------------------------------------------------------------------------------------------------------------
  590. // Setup Enemy Select
  591. // ----------------------------------------------------------------------------------------------------------------------------
  592.     Scene_BeastBook.prototype.onEnemySelect = function() {
  593.         if(this._descriptionWindow.visible) {
  594.             this._descriptionWindow.hide();
  595.         } else {
  596.             this._descriptionWindow.show();
  597.         }
  598.         this._selectionWindow.activate();
  599.  
  600.     };
  601.  
  602. // ----------------------------------------------------------------------------------------------------------------------------
  603. // Refresh Windows
  604. // ----------------------------------------------------------------------------------------------------------------------------
  605.     Scene_BeastBook.prototype.renewWindows = function() {
  606.             this._selectionWindow.refresh();
  607.             this._infoWindow.refresh();
  608.             this._elementsWindow.refresh();
  609.             this._parametersWindow.refresh();
  610.             this._descriptionWindow.refresh();
  611.     };
  612.  
  613. // ----------------------------------------------------------------------------------------------------------------------------
  614. // Fill Selection Window
  615. // ----------------------------------------------------------------------------------------------------------------------------
  616.     function Window_BeastBook_Selection() {
  617.         this.initialize.apply(this, arguments);
  618.     }
  619.  
  620.     Window_BeastBook_Selection.prototype = Object.create(Window_Selectable.prototype);
  621.     Window_BeastBook_Selection.prototype.constructor = Window_BeastBook_Selection;
  622.  
  623.     Window_BeastBook_Selection.lastTopRow = 0;
  624.     Window_BeastBook_Selection.lastIndex  = 0;
  625.  
  626.     Window_BeastBook_Selection.prototype.initialize = function(x, y, width, height) {
  627.         Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  628.  
  629.         this.refresh();
  630.         this.setTopRow(Window_BeastBook_Selection.lastTopRow);
  631.         this.select(Window_BeastBook_Selection.lastIndex);
  632.         this.activate();
  633.  
  634.     };
  635.  
  636.     Window_BeastBook_Selection.prototype.maxCols = function() {
  637.         return 1;
  638.     };
  639.  
  640.     Window_BeastBook_Selection.prototype.maxItems = function() {
  641.         return this._list ? this._list.length : 0;
  642.     };
  643.  
  644.     Window_BeastBook_Selection.prototype.setBeastDataWindows = function(window1, window2, window3, window4) {
  645.         this._infoWindow = window1;
  646.         this._parametersWindow = window2;
  647.         this._elementsWindow = window3;
  648.         this._descriptionWindow = window4;
  649.         this.updateStatus();
  650.     };
  651.  
  652.     Window_BeastBook_Selection.prototype.update = function() {
  653.         Window_Selectable.prototype.update.call(this);
  654.         this.updateStatus();
  655.     };
  656.  
  657.     Window_BeastBook_Selection.prototype.updateStatus = function() {
  658.  
  659.         var beast = this._list[this.index()];
  660.  
  661.         if (this._infoWindow) {
  662.             this._infoWindow.setBeast(beast);
  663.         }
  664.         if (this._parametersWindow) {
  665.             this._parametersWindow.setBeast(beast);
  666.         }
  667.         if (this._elementsWindow) {
  668.             this._elementsWindow.setBeast(beast);
  669.         }
  670.         if (this._descriptionWindow) {
  671.             this._descriptionWindow.setBeast(beast);
  672.         }
  673.     };
  674.  
  675.     Window_BeastBook_Selection.prototype.refresh = function() {
  676.         this._list = [];
  677.         for (var i = 1; i < $beastBook.beasts.length; i++) {
  678.             var beast = $dataEnemies[i];
  679.             if (beast.name && $beastBook.beasts[i].show) {
  680.                 this._list.push(beast);
  681.             }
  682.         }
  683.         this.createContents();
  684.         this.drawAllItems();
  685.     };
  686.  
  687.     Window_BeastBook_Selection.prototype.drawItem = function(index) {
  688.         var beast= this._list[index],
  689.             rect = this.itemRectForText(index),
  690.             id = index + 1,
  691.             name;
  692.  
  693.         this.changeTextColor(this.normalColor());
  694.  
  695.         if ($beastBook.isRevealed(beast.id)) {
  696.             if (stv_BeastBook_showID == "TRUE") {
  697.                 name = id + " - " + beast.name;
  698.             } else {
  699.                 name = beast.name;
  700.             }
  701.         } else {
  702.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  703.             if (stv_BeastBook_showIDunknown  == "TRUE") {
  704.                 name = id + " - " + stv_BeastBook_unknownData;
  705.             } else {
  706.                 name = stv_BeastBook_unknownData;
  707.             }
  708.         }
  709.  
  710.         this.drawText(name, rect.x, rect.y, rect.width);
  711.         this.changeTextColor(this.normalColor());
  712.     };
  713.  
  714. // ----------------------------------------------------------------------------------------------------------------------------
  715. // Fill Description Window
  716. // ----------------------------------------------------------------------------------------------------------------------------   
  717.     function Window_BeastBook_Description() {
  718.         this.initialize.apply(this, arguments);
  719.     }
  720.  
  721.     Window_BeastBook_Description.prototype = Object.create(Window_Base.prototype);
  722.     Window_BeastBook_Description.prototype.constructor = Window_BeastBook_Description;
  723.  
  724.     Window_BeastBook_Description.prototype.initialize = function(x, y, width, height) {
  725.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  726.  
  727.     };
  728.  
  729.     Window_BeastBook_Description.prototype.setBeast= function(beast) {
  730.         this._beast = beast;
  731.         this.refresh();
  732.     };
  733.  
  734.     Window_BeastBook_Description.prototype.update = function() {
  735.         Window_Base.prototype.update.call(this);
  736.     };
  737.  
  738.     Window_BeastBook_Description.prototype.createDescription = function() {
  739.         var beast = $dataEnemies[this._beast.id];
  740.         var y = this.lineHeight();
  741.  
  742.         if ($beastBook.isRevealed(this._beast.id)) {
  743.             this.drawTextEx(beast.meta.desc1, (this.contents.width/2) - (this.textWidth(beast.meta.desc1)/2), 0);
  744.             this.drawTextEx(beast.meta.desc2, (this.contents.width/2) - (this.textWidth(beast.meta.desc2)/2), y*1);
  745.             this.drawTextEx(beast.meta.desc3, (this.contents.width/2) - (this.textWidth(beast.meta.desc3)/2), y*2);
  746.             this.drawTextEx(beast.meta.desc4, (this.contents.width/2) - (this.textWidth(beast.meta.desc4)/2), y*3);
  747.         } else {
  748.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  749.             this.drawText(stv_BeastBook_unknownData, (this.contents.width/2) - (this.textWidth(stv_BeastBook_unknownData)/2), 0);
  750.             this.changeTextColor(this.normalColor());
  751.         }
  752.     };
  753.  
  754.     Window_BeastBook_Description.prototype.refresh = function() {
  755.         this.contents.clear();
  756.         this.createDescription();
  757.     };
  758.  
  759. // ----------------------------------------------------------------------------------------------------------------------------
  760. // Fill Info Window
  761. // ----------------------------------------------------------------------------------------------------------------------------
  762.     function Window_BeastBook_Info() {
  763.         this.initialize.apply(this, arguments);
  764.     }
  765.  
  766.     Window_BeastBook_Info.prototype = Object.create(Window_Base.prototype);
  767.     Window_BeastBook_Info.prototype.constructor = Window_BeastBook_Info;
  768.  
  769.     Window_BeastBook_Info.prototype.initialize = function(x, y, width, height) {
  770.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  771.         this.setBeastSprites();
  772.         this.setBattleBackSprites();
  773.     };
  774.  
  775.     Window_BeastBook_Info.prototype.setBattleBackSprites = function() {
  776.         this._battleBack2 = new Sprite();
  777.         this._battleBack2.anchor.x = 0;
  778.         this._battleBack2.anchor.y = 0;
  779.         this._battleBack2.x = 0;
  780.         this._battleBack2.y = 0;
  781.         this.addChildAt(this._battleBack2, stv_BeastBook_battleBackIndex);
  782.  
  783.         this._battleBack1 = new Sprite();
  784.         this._battleBack1.anchor.x = 0;
  785.         this._battleBack1.anchor.y = 0;
  786.         this._battleBack1.x = 0;
  787.         this._battleBack1.y = 0;
  788.         this.addChildAt(this._battleBack1, stv_BeastBook_battleBackIndex);
  789.     };
  790.  
  791.     Window_BeastBook_Info.prototype.setBeastSprites = function() {
  792.         this._beastSprite = new Sprite();
  793.         this._beastSprite.anchor.x = 0.5;
  794.         this._beastSprite.anchor.y = 0.5;
  795.         this._beastSprite.x = this.width/2;
  796.         this._beastSprite.y = this.height/2;
  797.         this._beastSprite.scale.x = 0.8;
  798.         this._beastSprite.scale.y = 0.8;
  799.         this.addChildToBack(this._beastSprite);
  800.  
  801.         this._beastBackSprite = new Sprite();
  802.         this._beastBackSprite.anchor.x = 0.5;
  803.         this._beastBackSprite.anchor.y = 0.5;
  804.         this._beastBackSprite.x = this.width/1.1;
  805.         this._beastBackSprite.y = this.height/1.2;
  806.         this._beastBackSprite.scale.x = 2.0;
  807.         this._beastBackSprite.scale.y = 2.0;
  808.         this._beastBackSprite.opacity = 50;
  809.         this.addChildToBack(this._beastBackSprite);
  810.     };
  811.  
  812.     Window_BeastBook_Info.prototype.setBeast= function(beast) {
  813.         this._beast = beast;
  814.         this.refresh();
  815.     };
  816.  
  817.     Window_BeastBook_Info.prototype.update = function() {
  818.         Window_Base.prototype.update.call(this);
  819.     };
  820.  
  821.     Window_BeastBook_Info.prototype.contentDrawItems = function() {
  822.         var y = this.lineHeight();
  823.         var maxLength = ((this.contents.width/2) - stv_BeastBook_padding*2 - this.textWidth("100%"));
  824.  
  825.         this.contents.fillRect(0, y-5, (this.contents.width/2) - stv_BeastBook_padding, 1, this.normalColor());
  826.         this.drawText(stv_BeastBook_dropsText, 0, 0);
  827.  
  828.         for (var j = 0; j < 3; j++) {
  829.             var di = this._beast.dropItems[j];
  830.             if (di.kind > 0) {
  831.                 if ($beastBook.beasts[this._beast.id] && $beastBook.beasts[this._beast.id].discoveredItems[j]) {
  832.                     var item = Game_Enemy.prototype.itemObject(di.kind, di.dataId);
  833.                     var successRate = Math.round((1/this._beast.dropItems[j].denominator)*100);
  834.                     this.changeTextColor(this.textColor(stv_BeastBook_dropsSuccessColor));
  835.                     this.drawText(successRate + "%", 0, y);
  836.                     this.changeTextColor(this.normalColor());
  837.                     this.drawItemName(item, this.textWidth("100%") + stv_BeastBook_padding, y, maxLength);
  838.                 } else {
  839.                     this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  840.                     this.drawText(stv_BeastBook_unknownData, 0, y, maxLength);
  841.                     this.changeTextColor(this.normalColor());
  842.                 }
  843.                 y += this.lineHeight();
  844.             }
  845.         }
  846.  
  847.         if (!this._beast.dropItems[0].kind && !this._beast.dropItems[1].kind && !this._beast.dropItems[2].kind) {
  848.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  849.             this.drawText(stv_BeastBook_noData, 0, y);
  850.             this.changeTextColor(this.normalColor());
  851.         }   
  852.     };
  853.  
  854.     Window_BeastBook_Info.prototype.contentDrawAbilities = function() {
  855.         y = this.lineHeight();
  856.         var maxLength = ((this.contents.width/2) - stv_BeastBook_padding*2 - 32);
  857.  
  858.         this.contents.fillRect((this.contents.width/2) + stv_BeastBook_padding, y-5, (this.contents.width/2) - stv_BeastBook_padding, 1, this.normalColor());
  859.         this.drawText(stv_BeastBook_skillsText, this.contents.width-this.textWidth(stv_BeastBook_skillsText), 0);
  860.  
  861.         for (var j = 0; j < this._beast.actions.length; j++) {
  862.             var ai = this._beast.actions[j];
  863.                 if (ai.skillId > 0) {
  864.                     var skill = $dataSkills[ai.skillId];
  865.                     if (skill.meta.BeastBook !== "hide") {
  866.                         this.changeTextColor(this.textColor(stv_BeastBook_skillsColor));
  867.                         this.drawSkillName(skill, this.contents.width - this.textWidth(skill.name) - 36, y, maxLength);
  868.                         y += this.lineHeight();
  869.                         this.changeTextColor(this.normalColor());
  870.                     }
  871.                 }
  872.         }
  873.         if (this._beast.actions.length <= 0) {
  874.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  875.             this.drawText(stv_BeastBook_noData, this.contents.width-this.textWidth(stv_BeastBook_noData), y);
  876.             this.changeTextColor(this.normalColor());
  877.         }   
  878.     };
  879.  
  880.     Window_BeastBook_Info.prototype.contentDrawExp = function() {
  881.         y = this.lineHeight();
  882.  
  883.         this.contents.paintOpacity = stv_BeastBook_bbOpacity;
  884.         this.contents.fillRect(0, (this.contents.height - y*2) - stv_BeastBook_padding, this.contents.width, y, this.gaugeBackColor());
  885.         this.contents.paintOpacity = 255;
  886.  
  887.         this.drawIcon(stv_BeastBook_expIcon, this.contents.width - 32, this.contents.height - y*2 + 2 - stv_BeastBook_padding);
  888.         this.drawText(TextManager.exp + ":", 0, this.contents.height - y*2 - stv_BeastBook_padding);
  889.         this.drawText(this._beast.exp, this.contents.width - 32 - this.textWidth(this._beast.exp) - stv_BeastBook_padding, this.contents.height - y*2 - stv_BeastBook_padding);
  890.  
  891.     };
  892.  
  893.     Window_BeastBook_Info.prototype.contentDrawGold = function() {
  894.         y = this.lineHeight();
  895.  
  896.         this.contents.paintOpacity = stv_BeastBook_bbOpacity;
  897.         this.contents.fillRect(0, this.contents.height - y, this.contents.width, y, this.gaugeBackColor());
  898.         this.contents.paintOpacity = 255;
  899.  
  900.         this.drawIcon(stv_BeastBook_goldIcon, this.contents.width - 32, this.contents.height - y + 2);
  901.         this.drawText(TextManager.currencyUnit + ":", 0, this.contents.height - y);
  902.         this.drawText(this._beast.gold, this.contents.width - 32 - this.textWidth(this._beast.gold) - stv_BeastBook_padding, this.contents.height - y);        
  903.     };
  904.  
  905.     Window_BeastBook_Info.prototype.contentDrawBattleBack = function() {
  906.         var beast = this._beast;
  907.         var pic1 = $beastBook.beasts[beast.id]._battleBack1;
  908.         var pic2 = $beastBook.beasts[beast.id]._battleBack2;
  909.  
  910.         var bitmap1 = ImageManager.loadNormalBitmap(pic1, 0 || 0);
  911.         var bitmap2 = ImageManager.loadNormalBitmap(pic2, 0 || 0);
  912.  
  913.         this._battleBack1.bitmap = bitmap1;
  914.         this._battleBack2.bitmap = bitmap2;
  915.  
  916.         this._battleBack1.scale.x = this.width/this._battleBack1.bitmap.width;
  917.         this._battleBack1.scale.y = this.height/this._battleBack1.bitmap.height;
  918.         this._battleBack2.scale.x = this.width/this._battleBack2.bitmap.width;
  919.         this._battleBack2.scale.y = this.height/this._battleBack2.bitmap.height;
  920.     };
  921.  
  922.     Window_BeastBook_Info.prototype.aSVMotion = function(speed, max) {
  923.         var thisSpeed = speed;
  924.         if (!this._counter) this._counter = 0;
  925.         if (!this._pattern) this._pattern = 0;
  926.         if (!this._switch) this._switch = false;
  927.  
  928.         if (this._counter < thisSpeed) {
  929.             this._counter += 1;
  930.         } else {
  931.             this._counter = 0;
  932.             if (!this._switch) this._pattern = (this._pattern + 1) % (max+1);
  933.             if (this._switch) this._pattern = (this._pattern - 1) % (max+1);
  934.         }
  935.  
  936.         if (this._pattern == max & !this._switch) this._switch = !this._switch;
  937.         if (this._pattern === 0 & this._switch) this._switch = !this._switch;
  938.  
  939.         return this._pattern;
  940.     };
  941.  
  942.     Window_BeastBook_Info.prototype.staticMotion = function() {
  943.         var bitmapHeight = this._beastSprite.bitmap.height;
  944.         var contentsHeight = this.contents.height;
  945.         var scalex = (Math.cos(Graphics.frameCount*0.03))/16;
  946.         var scaley = ((Math.cos(Graphics.frameCount*0.03))/8);
  947.  
  948.         this._beastSprite.scale.x = (scalex*scalex)+0.8;
  949.         this._beastSprite.scale.y = (scaley*scaley)+0.8;
  950.         this._beastSprite.anchor.y = (scaley*scaley)+0.4;
  951.  
  952.         if (bitmapHeight > contentsHeight) {
  953.             this._beastSprite.scale.x = ((scalex*scalex)+0.9)-0.3;
  954.             this._beastSprite.scale.y = ((scaley*scaley)+0.9)-0.3;
  955.             this._beastSprite.anchor.y = ((scaley*scaley)+0.4);
  956.         }
  957.     };
  958.  
  959.     Window_BeastBook_Info.prototype.contentDrawBeast = function() {
  960.         var beast = this._beast,
  961.             note = beast.note;
  962.  
  963.             if (beast.meta.BeastBookPic) {
  964.                 this._bitmap = ImageManager.loadNormalBitmap(beast.meta.BeastBookPic + ".png", 0 || 0);
  965.                 this.drawBeastStatic();
  966.             } else {
  967.                 if (note.match(/<(?:SIDEVIEW BATTLER):[ ](.*)>/i)) {
  968.                     this._bitmap = ImageManager.loadSvActor(String(RegExp.$1), 0);
  969.                     this.drawBeastASV();
  970.                 } else {
  971.                     if ($gameSystem.isSideView()) {this._bitmap = ImageManager.loadSvEnemy($dataEnemies[beast.id].battlerName, beast.battlerHue);}
  972.                     else {this._bitmap = ImageManager.loadEnemy($dataEnemies[beast.id].battlerName, beast.battlerHue);}
  973.                     this.drawBeastStatic();
  974.                 }
  975.             }
  976.     };
  977.  
  978.     Window_BeastBook_Info.prototype.drawBeastASV = function() {
  979.         this._beastSprite.bitmap = this._bitmap;
  980.         this._beastBackSprite.bitmap = this._bitmap;
  981.         var bitmap = this._beastSprite.bitmap;
  982.         if (bitmap) {
  983.             var bw = bitmap.width / 9;
  984.             var bh = bitmap.height / 6;
  985.             var cx = Math.floor(stv_BeastBook_asvPattern / 6) * 3 + this.aSVMotion(stv_BeastBook_asvSpeed, 2);
  986.             var cy = stv_BeastBook_asvPattern % 6;
  987.             this._beastSprite.setFrame(cx * bw, cy * bh, bw, bh);
  988.             this._beastBackSprite.setFrame(0, 0, bw, bh);
  989.             if (stv_BeastBook_showBgBeast == "TRUE") this._beastBackSprite.bitmap = bitmap;
  990.         }
  991.     };
  992.  
  993.     Window_BeastBook_Info.prototype.drawBeastStatic = function() {
  994.         this._beastSprite.bitmap = this._bitmap;
  995.         if (stv_BeastBook_showBgBeast == "TRUE") this._beastBackSprite.bitmap = this._bitmap;
  996.         if (stv_BeastBook_animateBeast == "TRUE") this.staticMotion();
  997.     };
  998.  
  999.     Window_BeastBook_Info.prototype.contentDrawKillCounter = function() {
  1000.         var beast = this._beast.id;
  1001.  
  1002.         var gaugeWidth = 200;
  1003.         var gaugeXpos = (this.contents.width - gaugeWidth);
  1004.         var gaugeYpos = (this.contents.height - (this.lineHeight() * 3) - stv_BeastBook_padding*2);
  1005.         var actualkillsCount = $beastBook.beasts[beast].kills;
  1006.         var maxKillsCount = $beastBook.beasts[beast].maxKills;
  1007.         var killsCountText = actualkillsCount + " / " + maxKillsCount;
  1008.  
  1009.         this.drawGauge(gaugeXpos, gaugeYpos - stv_BeastBook_padding, gaugeWidth, actualkillsCount / maxKillsCount, this.textColor(stv_BeastBook_killsCountColor1), this.textColor(stv_BeastBook_killsCountColor2));
  1010.         this.drawText(stv_BeastBook_killsText, gaugeXpos - this.textWidth(stv_BeastBook_killsText) - stv_BeastBook_padding, gaugeYpos);
  1011.         this.drawText(killsCountText, this.contents.width - this.textWidth(killsCountText), gaugeYpos);
  1012.  
  1013.     };
  1014.  
  1015.     Window_BeastBook_Info.prototype.deleteBitmaps = function() {
  1016.         this._beastSprite.bitmap = null;
  1017.         this._beastBackSprite.bitmap = null;
  1018.         this._battleBack1.bitmap = null;
  1019.         this._battleBack2.bitmap = null;
  1020.     };
  1021.  
  1022.     Window_BeastBook_Info.prototype.refresh = function() {
  1023.         this.contents.clear();
  1024.         this.deleteBitmaps();
  1025.  
  1026.         if ($beastBook.isRevealed(this._beast.id)) {
  1027.             if (stv_BeastBook_showBattleBack == "TRUE") this.contentDrawBattleBack();
  1028.             this.contentDrawBeast();
  1029.             if ($gameSwitches.value(stv_BeastBook_showItemsSwitch) || !stv_BeastBook_showItemsSwitch) this.contentDrawItems();
  1030.             if ($gameSwitches.value(stv_BeastBook_showSkillsSwitch) || !stv_BeastBook_showSkillsSwitch) this.contentDrawAbilities();
  1031.             if ($gameSwitches.value(stv_BeastBook_showKillCounterSwitch) || !stv_BeastBook_showKillCounterSwitch) this.contentDrawKillCounter();
  1032.             if ($gameSwitches.value(stv_BeastBook_showExpSwitch) || !stv_BeastBook_showExpSwitch) this.contentDrawExp();
  1033.             if ($gameSwitches.value(stv_BeastBook_showGoldSwitch) || !stv_BeastBook_showGoldSwitch) this.contentDrawGold();
  1034.         }
  1035.     };
  1036.  
  1037. // ----------------------------------------------------------------------------------------------------------------------------
  1038. // Fill Elements Window
  1039. // ----------------------------------------------------------------------------------------------------------------------------
  1040.     function Window_BeastBook_Elements() {
  1041.         this.initialize.apply(this, arguments);
  1042.     }
  1043.  
  1044.     Window_BeastBook_Elements.prototype = Object.create(Window_Base.prototype);
  1045.     Window_BeastBook_Elements.prototype.constructor = Window_BeastBook_Elements;
  1046.  
  1047.     Window_BeastBook_Elements.prototype.initialize = function(x, y, width, height) {
  1048.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  1049.     };
  1050.  
  1051.     Window_BeastBook_Elements.prototype.setBeast= function(beast) {
  1052.         this._beast = beast;
  1053.         this.refresh();
  1054.     };
  1055.  
  1056.     Window_BeastBook_Elements.prototype.contentDrawResistance = function() {
  1057.         var ii = 1;
  1058.         var counter = 0;
  1059.         var y = this.lineHeight()-stv_BeastBook_padding;
  1060.  
  1061.         for (var i = 0; i < 30; i++) {
  1062.  
  1063.             if (i < this._beast.traits.length) {
  1064.                 if (this._beast.traits[i].code === 11) {
  1065.                     counter += 1;
  1066.                     this.changeTextColor(this.systemColor());
  1067.                     this.drawTextEx($dataSystem.elements[this._beast.traits[i].dataId], 0, y*ii);
  1068.                         if (this._beast.traits[i].value*100 > 100) {
  1069.                             this.changeTextColor(this.textColor(3));
  1070.                         }
  1071.                         else if (this._beast.traits[i].value*100 < 100) {
  1072.                             this.changeTextColor(this.textColor(2));
  1073.                         } else {
  1074.                             this.changeTextColor(this.normalColor());
  1075.                         }
  1076.                     this.drawText((Math.round(this._beast.traits[i].value*100)) + "%", (Graphics.boxWidth/3) - 110, y*ii, 70, 'right');
  1077.                     ii += 1;
  1078.                     this.changeTextColor(this.normalColor());
  1079.                 }
  1080.             }
  1081.         }
  1082.         if (counter <= 0) {
  1083.             this.changeTextColor(this.textColor(stv_BeastBook_unknownColor));
  1084.             this.drawText(stv_BeastBook_noData, (this.contents.width/2) - (this.textWidth(stv_BeastBook_noData)/2), y);
  1085.             this.changeTextColor(this.normalColor());
  1086.         }
  1087.  
  1088.     };
  1089.  
  1090.     Window_BeastBook_Elements.prototype.refresh = function() {
  1091.         this.contents.clear();
  1092.  
  1093.         this.drawText(stv_BeastBook_weaknessText, (this.contents.width/2) - (this.textWidth(stv_BeastBook_weaknessText)/2),0);
  1094.  
  1095.         if ($beastBook.isRevealed(this._beast.id)) {
  1096.             this.contentDrawResistance();
  1097.         }
  1098.     };
  1099.  
  1100. // ----------------------------------------------------------------------------------------------------------------------------
  1101. // Fill Parameters Window
  1102. // ----------------------------------------------------------------------------------------------------------------------------
  1103.     function Window_BeastBook_Parameters() {
  1104.         this.initialize.apply(this, arguments);
  1105.     }
  1106.  
  1107.     Window_BeastBook_Parameters.prototype = Object.create(Window_Base.prototype);
  1108.     Window_BeastBook_Parameters.prototype.constructor = Window_BeastBook_Parameters;
  1109.  
  1110.     Window_BeastBook_Parameters.prototype.initialize = function(x, y, width, height) {
  1111.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  1112.     };
  1113.  
  1114.     Window_BeastBook_Parameters.prototype.setBeast= function(beast) {
  1115.         this._beast = beast;
  1116.         this.refresh();
  1117.     };
  1118.  
  1119.     Window_BeastBook_Parameters.prototype.contentDrawLeftParameters = function() {
  1120.         var y = 0;
  1121.         var leftEdgePos = (this.contents.width/2) - stv_BeastBook_padding;
  1122.  
  1123.         for (var i = 0; i < 4; i++) {
  1124.  
  1125.             this.contents.paintOpacity = stv_BeastBook_bbOpacity;
  1126.             this.contents.fillRect(0, y, leftEdgePos, this.lineHeight(), this.gaugeBackColor());
  1127.             this.contents.paintOpacity = 255;
  1128.  
  1129.             this.changeTextColor(this.systemColor());
  1130.             this.drawText(TextManager.param(i), stv_BeastBook_padding, y, 160);
  1131.             this.resetTextColor();        
  1132.             this.drawText(this._beast.params[i], leftEdgePos - stv_BeastBook_padding - this.textWidth(this._beast.params[i]), y, 60);
  1133.             y += this.lineHeight() + stv_BeastBook_padding;
  1134.         }
  1135.     };
  1136.  
  1137.     Window_BeastBook_Parameters.prototype.contentDrawRightParameters = function() {
  1138.         var y = 0;
  1139.         var rightEdgePos = (this.contents.width/2) + stv_BeastBook_padding;
  1140.         var leftEdgePos = (this.contents.width/2) - stv_BeastBook_padding;
  1141.  
  1142.         for (var j = 4; j < 8; j++) {
  1143.  
  1144.             this.contents.paintOpacity = stv_BeastBook_bbOpacity;
  1145.             this.contents.fillRect(rightEdgePos, y, leftEdgePos, this.lineHeight(), this.gaugeBackColor());
  1146.             this.contents.paintOpacity = 255;
  1147.  
  1148.             this.changeTextColor(this.systemColor());
  1149.             this.drawText(TextManager.param(j), rightEdgePos + stv_BeastBook_padding, y, 160);
  1150.             this.resetTextColor();        
  1151.             this.drawText(this._beast.params[j], this.contents.width - stv_BeastBook_padding - this.textWidth(this._beast.params[j]), y, 60);
  1152.             y += this.lineHeight() + stv_BeastBook_padding;
  1153.         }
  1154.     };
  1155.  
  1156.     Window_BeastBook_Parameters.prototype.refresh = function() {
  1157.         this.contents.clear();
  1158.  
  1159.         if ($beastBook.isRevealed(this._beast.id)) {
  1160.             this.contentDrawLeftParameters();
  1161.             this.contentDrawRightParameters();
  1162.         }
  1163.     };
  1164.  
  1165.  
  1166. // ----------------------------------------------------------------------------------------------------------------------------
  1167. // Alias methods
  1168. // ----------------------------------------------------------------------------------------------------------------------------
  1169.     STV_BeastBook_PluginCommand = Game_Interpreter.prototype.pluginCommand;
  1170.     STV_BeastBook_Create = DataManager.createGameObjects;
  1171.     STV_BeastBook_Save = DataManager.makeSaveContents;
  1172.     STV_BeastBook_Load = DataManager.extractSaveContents;
  1173.     STV_BeastBook_BattleBack = Spriteset_Battle.prototype.createBattleback;
  1174.     STV_BeastBook_DropItems = Game_Enemy.prototype.makeDropItems;
  1175.  
  1176. // ----------------------------------------------------------------------------------------------------------------------------
  1177. // DataManager
  1178. // ----------------------------------------------------------------------------------------------------------------------------
  1179.     var $beastBook = null;
  1180.  
  1181.     DataManager.makeSaveContents = function() {
  1182.         contents = STV_BeastBook_Save.call(this);
  1183.         contents.enemybook = $beastBook;
  1184.         return contents;
  1185.     };
  1186.  
  1187.     DataManager.extractSaveContents = function(contents) {
  1188.         STV_BeastBook_Load.call(this, contents);
  1189.         $beastBook = contents.enemybook;
  1190.     };
  1191.  
  1192.     DataManager.createGameObjects = function() {
  1193.         STV_BeastBook_Create.call(this);
  1194.         $beastBook = new Beast_Book();
  1195.     };
  1196.  
  1197. // ----------------------------------------------------------------------------------------------------------------------------
  1198. // Get EnemyTroop Info
  1199. // ----------------------------------------------------------------------------------------------------------------------------
  1200.     Game_Troop.prototype.updateInterpreter = function() {
  1201.         this._interpreter.update();
  1202.  
  1203.             for (var i = 0; i < $gameTroop.members().length; i++) {
  1204.             var stv_beastID = $gameTroop.members()[i]._enemyId;
  1205.             var stv_beastIsAlive = $gameTroop.members()[i].isAlive();
  1206.  
  1207.             switch (stv_BeastBook_fillBehavior) {
  1208.                 case '1':
  1209.                     $beastBook.addBeast(stv_beastID);
  1210.                     $beastBook.setBattleBacks(stv_beastID);
  1211.                 break;
  1212.                 case '2':
  1213.                     if (!stv_beastIsAlive){
  1214.                         $beastBook.addBeast(stv_beastID);
  1215.                         $beastBook.setBattleBacks(stv_beastID);
  1216.                     }
  1217.                 break;
  1218.                 case '3':
  1219.                 break;
  1220.             }
  1221.         }
  1222.     };
  1223.  
  1224. // ----------------------------------------------------------------------------------------------------------------------------
  1225. // Get BattleBack Info
  1226. // ----------------------------------------------------------------------------------------------------------------------------   
  1227.     Spriteset_Battle.prototype.createBattleback = function() {
  1228.         STV_BeastBook_BattleBack.call(this);
  1229.         $beastBook.battleBack1 = this._back1Sprite.bitmap._url;
  1230.         $beastBook.battleBack2 = this._back2Sprite.bitmap._url;
  1231.     };
  1232.  
  1233. // ----------------------------------------------------------------------------------------------------------------------------
  1234. // Item Discover // Kill Counter
  1235. // ----------------------------------------------------------------------------------------------------------------------------
  1236.     Game_Enemy.prototype.makeDropItems = function() {
  1237.         var rewards = STV_BeastBook_DropItems.call(this);
  1238.         var beastId = this._enemyId;
  1239.         var list = $beastBook.beasts[beastId];
  1240.  
  1241.         if(list.kills < list.maxKills) list.kills += 1;
  1242.         $beastBook.killAchievmentCheck(beastId);
  1243.         rewards.forEach(function(item) {
  1244.             $beastBook.discoverItem(beastId, item);
  1245.         });
  1246.         return rewards;
  1247.     };
  1248.  
  1249. // ----------------------------------------------------------------------------------------------------------------------------
  1250. // Beast_Book
  1251. // ----------------------------------------------------------------------------------------------------------------------------
  1252.  
  1253.     function Beast_Book() {
  1254.         this.initialize.apply(this, arguments);
  1255.     }
  1256.  
  1257.     Beast_Book.prototype.initialize = function() {
  1258.         this.clear();
  1259.     };
  1260.  
  1261.     // Set BattleBacks
  1262.     Beast_Book.prototype.setBattleBacks = function(beastId) {
  1263.         $beastBook.beasts[beastId]._battleBack1 = $beastBook.battleBack1;
  1264.         $beastBook.beasts[beastId]._battleBack2 = $beastBook.battleBack2;
  1265.     };
  1266.  
  1267.     // Clear Book
  1268.     Beast_Book.prototype.clear = function() {
  1269.         this.beasts = [0];
  1270.         var maxBeasts = $dataEnemies.length;
  1271.         if (stv_BeastBook_maxBeasts && stv_BeastBook_maxBeasts < maxBeasts) maxBeasts = stv_BeastBook_maxBeasts + 1;
  1272.  
  1273.         for (var i = 1; i < maxBeasts; ++i) {
  1274.  
  1275.             var enemy = $dataEnemies[i];
  1276.             if (!this.beasts[i]) this.beasts[i] = {};
  1277.  
  1278.             if (!this.beasts[i].show) {
  1279.                 this.beasts[i].show = true;
  1280.                 if (enemy.meta.BeastBook == 'hide') this.beasts[i].show = false;
  1281.             }
  1282.             if (!this.beasts[i].discovered) this.beasts[i].discovered = false;
  1283.             if (!this.beasts[i].discoveredItems) this.beasts[i].discoveredItems = [false,false,false];
  1284.             if (!this.beasts[i].kills) this.beasts[i].kills = 0;
  1285.             if (!this.beasts[i]._battleBack1) this.beasts[i]._battleBack1 = stv_BeastBook_defaultBattleBack;
  1286.             if (!this.beasts[i]._battleBack2) this.beasts[i]._battleBack2 = stv_BeastBook_defaultBattleBack;
  1287.  
  1288.             if (!this.beasts[i].maxKills) {
  1289.                 if (!enemy.meta.BeastBookMaxKills) {
  1290.                     this.beasts[i].maxKills = stv_BeastBook_maxKills;
  1291.                 } else {
  1292.                     this.beasts[i].maxKills = enemy.meta.BeastBookMaxKills;
  1293.                 }
  1294.             }  
  1295.         }
  1296.     };
  1297.  
  1298.     // Complete All
  1299.     Beast_Book.prototype.complete = function() {
  1300.         this.completeBeasts();
  1301.         this.completeItems();
  1302.         this.completeKills();
  1303.     };  
  1304.  
  1305.     // Complete Enemies
  1306.     Beast_Book.prototype.completeBeasts = function() {
  1307.         for (var i = 1; i < this.beasts.length; i++) {
  1308.             this.beasts[i].discovered = true;
  1309.         }
  1310.         this.getRevealed();
  1311.     };
  1312.  
  1313.     // Complete Items
  1314.     Beast_Book.prototype.completeItems = function() {
  1315.         for (var i = 1; i < this.beasts.length; i++) {
  1316.             this.beasts[i].discoveredItems = [true,true,true];
  1317.         }
  1318.     };
  1319.  
  1320.     // Complete Kills
  1321.     Beast_Book.prototype.completeKills = function() {
  1322.         for (var i = 1; i < this.beasts.length; i++) {
  1323.             this.beasts[i].kills = this.beasts[i].maxKills;
  1324.             this.killAchievmentCheck(i);
  1325.         }
  1326.     };
  1327.  
  1328.     // Clear Items
  1329.     Beast_Book.prototype.clearItems = function() {
  1330.         for (var i = 1; i < this.beasts.length; i++) {
  1331.             this.beasts[i].discoveredItems = [false,false,false];
  1332.         }
  1333.     };
  1334.  
  1335.     // Hide Beast
  1336.     Beast_Book.prototype.hideBeast = function(beastId) {
  1337.         if (!this.beasts) this.clear();
  1338.         if (this.beasts[beastId]) this.beasts[beastId].show = false;
  1339.         this.getRevealed();
  1340.     };
  1341.  
  1342.     // Show Beast
  1343.     Beast_Book.prototype.showBeast = function(beastId) {
  1344.         if (!this.beasts) this.clear();
  1345.         if (this.beasts[beastId]) this.beasts[beastId].show = true;
  1346.         this.getRevealed();
  1347.     };
  1348.  
  1349.     // Add Beast
  1350.     Beast_Book.prototype.addBeast = function(beastId) {
  1351.         if (!this.beasts) this.clear();
  1352.         this.beasts[beastId].discovered = true;
  1353.         this.getRevealed();
  1354.     };
  1355.  
  1356.     // Remove Beast
  1357.     Beast_Book.prototype.removeBeast = function(beastId) {
  1358.         if (this.beasts) {
  1359.             this.beasts[beastId].discovered = false;
  1360.         }
  1361.     };
  1362.  
  1363.     // Check if Enemy is revealed
  1364.     Beast_Book.prototype.isRevealed = function(beast) {
  1365.         if (this.beasts && beast) {
  1366.             return this.beasts[beast].discovered;
  1367.         } else {
  1368.             return false;
  1369.         }
  1370.     };
  1371.  
  1372.     // Add Kill
  1373.     Beast_Book.prototype.addKill = function(beastId, value) {
  1374.         if (this.beasts[beastId]) {
  1375.             this.beasts[beastId].kills += value;
  1376.         }
  1377.     };
  1378.  
  1379.     // Set Max Kills
  1380.     Beast_Book.prototype.setMaxKills = function(beastId, value) {
  1381.         if (this.beasts[beastId]) {
  1382.             this.beasts[beastId].maxKills = value;
  1383.         }
  1384.     };
  1385.  
  1386.     // Check Kill Achievment
  1387.     Beast_Book.prototype.killAchievmentCheck = function(beastID) {
  1388.             var beast = this.beasts[beastID];
  1389.             if(beast.kills == beast.maxKills) {
  1390.                 var achievmentSwitch = stv_BeastBook_killAchievmentSwitch + beastID;
  1391.             if (stv_BeastBook_killAchievmentSwitch) $gameSwitches.setValue(achievmentSwitch, true);
  1392.             }
  1393.     };  
  1394.  
  1395.     // Get Revealed Beasts
  1396.     Beast_Book.prototype.getRevealed = function() {
  1397.         var discoveredLength = 0;
  1398.         for (var i = 1; i < this.beasts.length; i++) {
  1399.             if(this.beasts[i].discovered) discoveredLength += 1;
  1400.         }
  1401.         $gameVariables.setValue(stv_BeastBook_countDiscovered, discoveredLength);
  1402.         if(discoveredLength >= ($dataEnemies.length-1)) $gameSwitches.setValue(stv_BeastBook_bookFullSwitch, true);
  1403.     };
  1404.  
  1405.     // Discover Item
  1406.     Beast_Book.prototype.discoverItem = function(E_Id, item) {
  1407.         var itemKind;
  1408.         if (DataManager.isItem(item)) itemKind = 1;
  1409.         if (DataManager.isWeapon(item)) itemKind = 2;
  1410.         if (DataManager.isArmor(item)) itemKind = 3;   
  1411.         for (var i = 0; i < 3; i++) {
  1412.             if ($dataEnemies[E_Id].dropItems[i].kind == itemKind && $dataEnemies[E_Id].dropItems[i].dataId == item.id) {
  1413.                 var items = this.beasts[E_Id].discoveredItems;
  1414.                 items[i] = true;
  1415.             }
  1416.         }  
  1417.     };
  1418.  
  1419. function dhjl() {
  1420. var b = $beastBook.beasts.length;
  1421.  
  1422.         for(var i = 1;i<b;i++){
  1423.         if($beastBook.beasts[i].maxKills <=$beastBook.beasts[i].kills){
  1424.         if(i == 1){
  1425.                 //1号敌人击杀值满时,检测开关10判断有没有获取过奖励,如果开关10打开就不给奖励
  1426.                 if($gameSwitches.value(10) == false){
  1427.                 for(var i = 1;i<$gameParty.members().length;i++){
  1428.         $gameActors.actor(i).addParam(0,100);//所有角色最大hp增加100
  1429.                 $gameSwitches.setValue(10,true);
  1430.                 }
  1431.         }
  1432.  
  1433.         }else if(i == 2){
  1434.                 //2号敌人击杀值满时,检测开关11判断有没有获取过奖励,如果开关11打开就不给奖励(以此类推)
  1435.                                 if($gameSwitches.value(11) == false){
  1436.                 $gameParty.gainItem($dataItems[1], 1, true); //获取1号物品
  1437.                 $gameSwitches.setValue(11,true);
  1438.         }
  1439.  
  1440.         }else if(i == 3){
  1441.  
  1442.         }else if(i == 4){
  1443.  
  1444.         }else if(i == 5){
  1445.  
  1446.         }else if(i == 6){
  1447.  
  1448.                 }
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.         }
  1455.         }
  1456.  
  1457.  
  1458.         };
  1459. // ----------------------------------------------------------------------------------------------------------------------------
  1460. // Draw Skill Name Function
  1461. // ----------------------------------------------------------------------------------------------------------------------------  
  1462.     Window_Base.prototype.drawSkillName = function(skill, x, y, width) {
  1463.         if (skill) {
  1464.             if (this.textWidth(skill.name) > width) {
  1465.                 this.drawText(skill.name, x + this.textWidth(skill.name) - width, y, width);  
  1466.             } else{
  1467.                 this.drawText(skill.name, x, y, width);  
  1468.             }
  1469.             this.drawIcon(skill.iconIndex, x + this.textWidth(skill.name) + 4, y + 2);
  1470.         }
  1471.     };
  1472.  
  1473. // ----------------------------------------------------------------------------------------------------------------------------
  1474. // Plugin Commands
  1475. // ----------------------------------------------------------------------------------------------------------------------------
  1476.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  1477.         STV_BeastBook_PluginCommand.call(this, command, args);
  1478.  
  1479.         if (command === 'BeastBook') {
  1480.             switch (args[0]) {
  1481.                 case 'open':
  1482.                     SceneManager.push(Scene_BeastBook);
  1483.                 break;
  1484.                 case 'hide':
  1485.                     $beastBook.hideBeast(Number(args[1]));
  1486.                 break;
  1487.                 case 'show':
  1488.                     $beastBook.showBeast(Number(args[1]));
  1489.                 break;
  1490.                 case 'add':
  1491.                     $beastBook.addBeast(Number(args[1]));
  1492.                 break;
  1493.                 case 'addvar':
  1494.                     $beastBook.addBeast(Number($gameVariables.value(args[1])));
  1495.                 break;
  1496.                 case 'addkill':
  1497.                     $beastBook.addKill(Number(args[1]), Number(args[2]));
  1498.                 break;
  1499.                 case 'maxkills':
  1500.                     $beastBook.setMaxKills(Number(args[1]), Number(args[2]));
  1501.                 break;
  1502.                 case 'remove':
  1503.                     $beastBook.removeBeast(Number(args[1]));
  1504.                 break;
  1505.                 case 'clear':
  1506.                     $beastBook.clear();
  1507.                 break;
  1508.                 case 'complete':
  1509.                     $beastBook.complete();
  1510.                 break;
  1511.                 case 'completebeasts':
  1512.                     $beastBook.completeBeasts();
  1513.                 break;
  1514.                 case 'completeitems':
  1515.                     $beastBook.completeItems();
  1516.                 break;
  1517.                 case 'completekills':
  1518.                     $beastBook.completeKills();
  1519.                 break;
  1520.                 case 'clearitems':
  1521.                     $beastBook.clearItems();
  1522.                 break;
  1523.             }
  1524.         }
  1525.     };
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9238
在线时间
1833 小时
注册时间
2020-1-2
帖子
1082
7
 楼主| 发表于 2021-4-16 00:40:41 | 只看该作者
347780682 发表于 2021-4-16 00:13
改好了 使用方法是这样,需要自己设置满击杀值后的奖励,与判定开关,具体看说明

辛苦了  虽然和我想的略有点不同

QQ图片20210416003738.png (267.9 KB, 下载次数: 21)

QQ图片20210416003738.png
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2122
在线时间
124 小时
注册时间
2019-8-12
帖子
38
8
发表于 2021-4-16 00:44:29 | 只看该作者
347780682 发表于 2021-4-16 00:13
改好了 使用方法是这样,需要自己设置满击杀值后的奖励,与判定开关,具体看说明

大佬,我的QQ是905995884,关于这个插件有个问题是,我用的YEP的掉落物插件给怪物添加的掉落物不会在图鉴中显示,你看能不能帮我整合一下。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2122
在线时间
124 小时
注册时间
2019-8-12
帖子
38
9
发表于 2021-4-16 00:45:27 | 只看该作者
347780682 发表于 2021-4-16 00:13
改好了 使用方法是这样,需要自己设置满击杀值后的奖励,与判定开关,具体看说明


我的QQ号,请大佬加一下我,我给你发插件
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5692
在线时间
1556 小时
注册时间
2011-6-14
帖子
520
10
发表于 2021-4-16 01:32:31 | 只看该作者
xiamumomo 发表于 2021-4-16 00:40
辛苦了  虽然和我想的略有点不同

可以自己写插件关联  就换在判定哪里就行
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-25 22:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表