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

Project1

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

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

[复制链接]

Lv4.逐梦者

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

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

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

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

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

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

Lv4.逐梦者

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

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9329
在线时间
1842 小时
注册时间
2020-1-2
帖子
1082
3
 楼主| 发表于 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
星屑
9329
在线时间
1842 小时
注册时间
2020-1-2
帖子
1082
4
 楼主| 发表于 2021-4-16 00:40:41 | 显示全部楼层
347780682 发表于 2021-4-16 00:13
改好了 使用方法是这样,需要自己设置满击杀值后的奖励,与判定开关,具体看说明

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

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

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9329
在线时间
1842 小时
注册时间
2020-1-2
帖子
1082
5
 楼主| 发表于 2021-4-16 10:16:34 | 显示全部楼层
347780682 发表于 2021-4-16 01:32
可以自己写插件关联  就换在判定哪里就行

  关键就是不知道怎么写代码只知道var是变量 if是判断
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-18 06:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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