├── README.md ├── MrTS_MinimumDamage.js ├── MrTS_ItemColors.js ├── MrTS_CommonEventOnMenuLeave.js ├── MrTS_SetCharacterFrame.js ├── MrTS_HideQuantities.js ├── MrTS_SimpleItemPrice.js ├── MrTS_RareEnemies.js ├── MrTS_SimpleReplaceSkill.js ├── MrTS_HpEqualsMaxHp.js ├── MrTS_VehicleMusicFix.js ├── MrTS_CurrencyName.js ├── MrTS_PassiveSkills.js ├── MrTS_ErrorStackOnScreen.js ├── MrTS_BattleCharacterLimit.js ├── MrTS_SceneBackgrounds.js ├── MrTS_DamagePostfix.js ├── MrTS_RandomSkillPosition.js ├── MrTS_HurtSounds.js ├── MrTS_RegionTransfer.js ├── MrTS_ItemsSkillsDiffReactions.js ├── MrTS_DeathSounds.js ├── MrTS_SimpleShopTax.js ├── MrTS_ChangeEquipmentOnLevelUp.js ├── MrTS_UseWeaponsArmorInBattle.js ├── MrTS_PercentEquipmentStats.js ├── MrTS_MapDestinationImage.js ├── MrTS_NoItemCategories.js ├── MrTS_StaticExp.js ├── MrTS_ConjureWeapons.js ├── MrTS_EmptyMenu.js ├── MrTS_ProgressTitleScreen.js ├── MrTS_ColorShiftingEnemies.js ├── MrTS_RestoreHpMpTp.js ├── MrTS_EnemyExpChange.js ├── MrTS_InvisibleEventsInRange.js ├── MrTS_EnemyPositions.js ├── MrTS_CriticalDamage.js ├── MrTS_GainStatsOnLevelUp.js ├── MrTS_MenuMusic.js ├── MrTS_SimpleSkillLeveling.js ├── MrTS_GlobalSavesData.js ├── MrTS_EmergeAnimations.js ├── MrTS_DamageEfficiency.js ├── MrTS_MaxLevelRestriction.js ├── MrTS_SimpleMercenaries.js ├── MrTS_StatesEX.js ├── MrTS_DarkRoomCovers.js ├── MrTS_StealSkill.js ├── MrTS_HPMPTPMulticolorGauges.js ├── MrTS_CommonEventDebug.js ├── MrTS_SimpleSaveLoadMenu.js └── MrTS_SimpleItemTracking.js /README.md: -------------------------------------------------------------------------------- 1 | # RMMV 2 | -------------------------------------------------------------------------------- /MrTS_MinimumDamage.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_MinimumDamage.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Changes minimum damage from 0. 7 | * @author Mr. Trivel 8 | * 9 | * @param Minimum Damage 10 | * @desc Minimum Damage possible. 11 | * @default 1 12 | * 13 | * @help 14 | * -------------------------------------------------------------------------------- 15 | * Terms of Use 16 | * -------------------------------------------------------------------------------- 17 | * Don't remove the header or claim that you wrote this plugin. 18 | * Credit Mr. Trivel if using this plugin in your project. 19 | * Free for commercial and non-commercial projects. 20 | * -------------------------------------------------------------------------------- 21 | * Version 1.1 22 | * -------------------------------------------------------------------------------- 23 | */ 24 | 25 | (function() { 26 | var parameters = PluginManager.parameters('MrTS_DamagePostfix'); 27 | var minDamage = Number(parameters['Minimum Damage'] || 1); 28 | 29 | var _Game_Action_makeDamageValue = Game_Action.prototype.makeDamageValue; 30 | 31 | Game_Action.prototype.makeDamageValue = function(target, critical) { 32 | var value = _Game_Action_makeDamageValue.call(this, target, critical); 33 | return (value >= 0 ? Math.max(value, minDamage) : value); 34 | }; 35 | })(); 36 | -------------------------------------------------------------------------------- /MrTS_ItemColors.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_ItemColors.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Adds color coding to items. 7 | * @author Mr. Trivel 8 | * 9 | * @param Item Colors 10 | * @desc HEX codes for item colors. 11 | * @default #9d9d9d #FFFFFF #1eff00 #0070dd #a335ee #ff8000 #e6cc80 12 | * 13 | * @help This plugin does not provide plugin commands. 14 | * Version 1.0 15 | * 16 | * Use the following tag in Item note fields: 17 | * - X being index of color in the plugin Item Colors parameter. 18 | * 19 | * E.g. 20 | * - If using default settings, it'd be #9d9d9d color. 21 | */ 22 | 23 | (function() { 24 | var parameters = PluginManager.parameters('MrTS_StaticExp'); 25 | 26 | var itemColorsDefault = String(parameters['Item Colors'] || "#9d9d9d #FFFFFF #1eff00 #0070dd #a335ee #ff8000 #e6cc80") 27 | var itemColors = itemColorsDefault.split(" "); 28 | Window_Base.prototype.drawItemName = function(item, x, y, width) { 29 | width = width || 312; 30 | if (item) { 31 | var iconBoxWidth = Window_Base._iconWidth + 4; 32 | 33 | this.resetTextColor(); 34 | if (item.meta.color) 35 | this.changeTextColor(itemColors[item.meta.color-1]); 36 | this.drawIcon(item.iconIndex, x + 2, y + 2); 37 | this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth); 38 | } 39 | }; 40 | 41 | 42 | })(); 43 | -------------------------------------------------------------------------------- /MrTS_CommonEventOnMenuLeave.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_CommonEventOnMenuLeave.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Calls common event when user leaves menu. 7 | * @author Mr. Trivel 8 | * 9 | * @param CE ID 10 | * @desc Common Event ID to call. 11 | * @default 8 12 | * 13 | * @help 14 | * -------------------------------------------------------------------------------- 15 | * Terms of Use 16 | * -------------------------------------------------------------------------------- 17 | * Don't remove the header or claim that you wrote this plugin. 18 | * Credit Mr. Trivel if using this plugin in your project. 19 | * Free for commercial non-commercial projects. 20 | * -------------------------------------------------------------------------------- 21 | * Version 1.0 22 | * -------------------------------------------------------------------------------- 23 | * 24 | * -------------------------------------------------------------------------------- 25 | * Version History 26 | * -------------------------------------------------------------------------------- 27 | * 1.0 - Release 28 | */ 29 | 30 | (function() { 31 | var parameters = PluginManager.parameters('MrTS_CommonEventOnMenuLeave'); 32 | var paramCeId = Number(parameters['CE ID'] || 8); 33 | 34 | var _Scene_Menu_popScene = Scene_Menu.prototype.popScene 35 | Scene_Menu.prototype.popScene = function() { 36 | _Scene_Menu_popScene.call(this); 37 | $gameTemp.reserveCommonEvent(paramCeId); 38 | }; 39 | })(); 40 | -------------------------------------------------------------------------------- /MrTS_SetCharacterFrame.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SetCharacterFrame.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Adds extra method to Game_CharacterBase: setCharacterFrame(index) 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Version History 22 | * -------------------------------------------------------------------------------- 23 | * 1.0 - Release 24 | */ 25 | 26 | (function() { 27 | var _Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers; 28 | Game_CharacterBase.prototype.initMembers = function() { 29 | _Game_CharacterBase_initMembers.call(this); 30 | this._frame = 0; 31 | }; 32 | 33 | Game_CharacterBase.prototype.setCharacterFrame = function(index) { 34 | var pattern = index % 3; 35 | var dir = ((index - pattern) / 3 + 1) * 2; 36 | this._frame = index; 37 | this._pattern = pattern; 38 | this._direction = dir; 39 | }; 40 | })(); 41 | -------------------------------------------------------------------------------- /MrTS_HideQuantities.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_HideQuantities.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows to hide item quantities of specific items. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Item/Armor/Weapon Tag 22 | * -------------------------------------------------------------------------------- 23 | * Add tag to note fields of items which should not display their quantity. 24 | * -------------------------------------------------------------------------------- 25 | * 26 | * -------------------------------------------------------------------------------- 27 | * Version History 28 | * -------------------------------------------------------------------------------- 29 | * 1.0 - Release 30 | */ 31 | 32 | (function() { 33 | var _Window_ItemList_drawItemNumber = Window_ItemList.prototype.drawItemNumber; 34 | Window_ItemList.prototype.drawItemNumber = function(item, x, y, width) { 35 | if (item.meta.noq) return; 36 | _Window_ItemList_drawItemNumber.call(this, item, x, y, width); 37 | }; 38 | })(); 39 | -------------------------------------------------------------------------------- /MrTS_SimpleItemPrice.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SimpleItemPrice.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows to set default sell price in note tags. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Item/Weapon/Armor Tags 22 | * -------------------------------------------------------------------------------- 23 | * 24 | * [PRICE] - default sell price. 25 | * 26 | * E.g.: 27 | * 28 | * 29 | * -------------------------------------------------------------------------------- 30 | * 31 | * -------------------------------------------------------------------------------- 32 | * Version History 33 | * -------------------------------------------------------------------------------- 34 | * 1.0 - Release 35 | */ 36 | 37 | (function() { 38 | var _SceneShop_sellingPrice = Scene_Shop.prototype.sellingPrice; 39 | Scene_Shop.prototype.sellingPrice = function() { 40 | if (this._item.meta.SellPrice) 41 | return Number(this._item.meta.SellPrice) 42 | else 43 | return _SceneShop_sellingPrice.call(this); 44 | }; 45 | })(); 46 | -------------------------------------------------------------------------------- /MrTS_RareEnemies.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_RareEnemies.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Adds a chance of encountering rare versions of enemies. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.1 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * It requires two commands used in enemies note fields: 21 | * - ID of rare enemy 22 | * - Chance of appearing - 0.01 - 1%, 1.00 - 100%, 0.5 - 50% 23 | * -------------------------------------------------------------------------------- 24 | * 25 | * -------------------------------------------------------------------------------- 26 | * Version History 27 | * -------------------------------------------------------------------------------- 28 | * 1.1 - Fixed rare enemy retaining old id's HP. 29 | * 1.0 - Release 30 | */ 31 | 32 | (function() { 33 | var _Game_Enemy_setup = Game_Enemy.prototype.setup; 34 | 35 | Game_Enemy.prototype.setup = function(enemyId, x, y) { 36 | if ($dataEnemies[enemyId].meta.re_chc) 37 | { 38 | var chance = Number($dataEnemies[enemyId].meta.re_chc); 39 | if (Math.random() < chance) 40 | { 41 | enemyId = Number($dataEnemies[enemyId].meta.re_id); 42 | } 43 | } 44 | _Game_Enemy_setup.call(this, enemyId, x, y); 45 | 46 | 47 | }; 48 | })(); 49 | -------------------------------------------------------------------------------- /MrTS_SimpleReplaceSkill.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SimpleReplaceSkill.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Replace some skill when another skill is learned. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Skill Tags 22 | * -------------------------------------------------------------------------------- 23 | * To replace a skill when it's learned use the following tag: 24 | * 25 | * Any amount of IDs work. 26 | * 27 | * Example: 28 | * 29 | * 30 | * 31 | * First example would remove skills 5, 7 and 9 after learning. 32 | * Second example would remove skill 5 after learning. 33 | * -------------------------------------------------------------------------------- 34 | * 35 | * -------------------------------------------------------------------------------- 36 | * Version History 37 | * -------------------------------------------------------------------------------- 38 | * 1.0 - Release 39 | */ 40 | 41 | (function() { 42 | var _Game_Actor_learnSkill = Game_Actor.prototype.learnSkill; 43 | Game_Actor.prototype.learnSkill = function(skillId) { 44 | if (!this.isLearnedSkill(skillId) && $dataSkills[skillId].meta.ReplaceSkill) { 45 | var a = $dataSkills[skillId].meta.ReplaceSkill.split(","); 46 | for (var i = 0; i < a.length; i++) { 47 | this.forgetSkill(Number(a[i])); 48 | } 49 | } 50 | _Game_Actor_learnSkill.call(this, skillId); 51 | }; 52 | })(); 53 | -------------------------------------------------------------------------------- /MrTS_HpEqualsMaxHp.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_HpEqualsMaxHp.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows specific states to make actor's Max HP equal to HP. 7 | * @author Mr. Trivel 8 | * 9 | * @param State List 10 | * @desc List all State IDs separated by space that make actor's Max HP to be equal to HP. 11 | * @default 12 12 | * 13 | * @help 14 | * -------------------------------------------------------------------------------- 15 | * Terms of Use 16 | * -------------------------------------------------------------------------------- 17 | * Don't remove the header or claim that you wrote this plugin. 18 | * Credit Mr. Trivel if using this plugin in your project. 19 | * Free for commercial and non-commercial projects. 20 | * -------------------------------------------------------------------------------- 21 | * Version 1.0 22 | * -------------------------------------------------------------------------------- 23 | * 24 | * -------------------------------------------------------------------------------- 25 | * Version History 26 | * -------------------------------------------------------------------------------- 27 | * 1.0 - Release 28 | */ 29 | 30 | (function() { 31 | var parameters = PluginManager.parameters('MrTS_HpEqualsMaxHp'); 32 | var paramStateList = String(parameters['State List'] || "12"); 33 | var paramStateList = paramStateList.split(' '); 34 | var paramStateIdList = []; 35 | for (var i = 0; i < paramStateList.length; i++) { 36 | paramStateIdList.push(Number(paramStateList[i])); 37 | }; 38 | 39 | var _GameBattlerBase_param = Game_BattlerBase.prototype.param; 40 | Game_BattlerBase.prototype.param = function(paramId) { 41 | var value = _GameBattlerBase_param.call(this, paramId); 42 | if (paramId === 0 && this.isHpEqualsMaxHpStateInflicted()) 43 | value = value.clamp(this.paramMin(paramId), this.hp <= 0 ? 1 : this.hp); 44 | return value; 45 | }; 46 | 47 | Game_BattlerBase.prototype.isHpEqualsMaxHpStateInflicted = function() { 48 | for (var i = 0; i < paramStateIdList.length; i++) { 49 | if (this.isStateAffected(paramStateIdList[i])) return true; 50 | }; 51 | return false; 52 | }; 53 | })(); 54 | -------------------------------------------------------------------------------- /MrTS_VehicleMusicFix.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_VehicleMusicFix.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Changes how music and vehicles work. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * After boarding onto a vehicle and going to a new map, it'd play the autoplay 22 | * BGM there. Now it keeps vehicle BGM playing. 23 | * 24 | * After boaring onto a vehicle in one map and leaving it in another, it'd play the 25 | * BGM from previous map. Now it plays the BGM of the map which you left vehicle. 26 | * -------------------------------------------------------------------------------- 27 | * 28 | * -------------------------------------------------------------------------------- 29 | * Version History 30 | * -------------------------------------------------------------------------------- 31 | * 1.0 - Release 32 | */ 33 | 34 | (function() { 35 | 36 | var _GameMap_autoplay = Game_Map.prototype.autoplay; 37 | Game_Map.prototype.autoplay = function() { 38 | if (!$gamePlayer.isInVehicle()) 39 | _GameMap_autoplay.call(this); 40 | }; 41 | 42 | var _GameVehicle_getOn = Game_Vehicle.prototype.getOn; 43 | Game_Vehicle.prototype.getOn = function() { 44 | _GameVehicle_getOn.call(this); 45 | this._boardedOnMapId = $gameMap.mapId(); 46 | }; 47 | 48 | var _GameVehicle_getOff = Game_Vehicle.prototype.getOff; 49 | Game_Vehicle.prototype.getOff = function() { 50 | _GameVehicle_getOff.call(this); 51 | if (this._boardedOnMapId !== $gameMap.mapId()) 52 | _GameMap_autoplay.call($gameMap); 53 | }; 54 | })(); 55 | -------------------------------------------------------------------------------- /MrTS_CurrencyName.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_CurrencyName.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows to change how currency is called midgame. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Plugin Commands 22 | * -------------------------------------------------------------------------------- 23 | * SetCurrency [NAME] - sets currency to [NAME] 24 | * Example: 25 | * SetCurrency Glasses 26 | * -------------------------------------------------------------------------------- 27 | * 28 | * -------------------------------------------------------------------------------- 29 | * Version History 30 | * -------------------------------------------------------------------------------- 31 | * 1.0 - Release 32 | */ 33 | 34 | (function() { 35 | //-------------------------------------------------------------------------- 36 | // Game_Interpreter 37 | // 38 | 39 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 40 | Game_Interpreter.prototype.pluginCommand = function(command, args) { 41 | _Game_Interpreter_pluginCommand.call(this, command, args); 42 | if (command.toLowerCase() === "setcurrency") { 43 | $gameSystem.setCurrencyUnit(args[0]); 44 | } 45 | }; 46 | 47 | Object.defineProperty(TextManager, 'currencyUnit', { 48 | get: function() { return $gameSystem.getCurrencyUnit(); }, 49 | configurable: true 50 | }); 51 | 52 | Game_System.prototype.getCurrencyUnit = function() { 53 | if (!this._currencyUnit) return $dataSystem.currencyUnit; 54 | return this._currencyUnit; 55 | }; 56 | 57 | Game_System.prototype.setCurrencyUnit = function(currency) { 58 | this._currencyUnit = currency; 59 | }; 60 | })(); 61 | -------------------------------------------------------------------------------- /MrTS_PassiveSkills.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_PassiveSkills.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows skills to give passive bonuses to actors. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Skill Tags 22 | * -------------------------------------------------------------------------------- 23 | * Use the following tag: 24 | * 25 | * This means skill will give all bonuses state with that ID gives. 26 | * 27 | * Example: 28 | * 29 | * -------------------------------------------------------------------------------- 30 | * 31 | * -------------------------------------------------------------------------------- 32 | * Version History 33 | * -------------------------------------------------------------------------------- 34 | * 1.0 - Release 35 | */ 36 | 37 | (function() { 38 | 39 | var _Game_Actor_initMembers = Game_Actor.prototype.initMembers; 40 | Game_Actor.prototype.initMembers = function() { 41 | _Game_Actor_initMembers.call(this); 42 | this._skipPassives = false; 43 | }; 44 | var _Game_Actor_traitObjects = Game_Actor.prototype.traitObjects; 45 | Game_Actor.prototype.traitObjects = function() { 46 | var objects = _Game_Actor_traitObjects.call(this); 47 | if (!this._skipPassives) 48 | objects = objects.concat(this.getPassiveSkills()); 49 | return objects; 50 | }; 51 | 52 | Game_Actor.prototype.getPassiveSkills = function() { 53 | var passives = []; 54 | this._skipPassives = true; 55 | var skills = this.skills(); 56 | for (var i = 0; i < skills.length; i++) { 57 | var skill = skills[i]; 58 | if (skill.meta.Passive) { 59 | passives.push($dataStates[Number(skill.meta.Passive)]); 60 | } 61 | } 62 | this._skipPassives = false; 63 | return passives; 64 | }; 65 | })(); 66 | -------------------------------------------------------------------------------- /MrTS_ErrorStackOnScreen.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_ErrorStackOnScreen.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Shows whole error stack on screen for easier reporting. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Version History 22 | * -------------------------------------------------------------------------------- 23 | * 1.0 - Release 24 | */ 25 | 26 | (function() { 27 | SceneManager.catchException = function(e) { 28 | if (e instanceof Error) { 29 | Graphics.printError(e.name, e.message, e.stack); 30 | console.error(e.stack); 31 | } else { 32 | Graphics.printError('UnknownError', e); 33 | } 34 | AudioManager.stopAll(); 35 | this.stop(); 36 | }; 37 | 38 | Graphics.printError = function(name, message, stack) { 39 | stack = this.changeErrorStack(stack); 40 | if (this._errorPrinter) { 41 | this._errorPrinter.innerHTML = this._makeErrorHtml(name, message, stack); 42 | } 43 | this._applyCanvasFilter(); 44 | this._clearUpperCanvas(); 45 | }; 46 | 47 | Graphics._makeErrorHtml = function(name, message, stack) { 48 | var ret = ''; 49 | for (var i = 1; i < stack.length; i++) { 50 | ret += '' + stack[i] + '
'; 51 | } 52 | return ('' + stack[0] + '
' + ret); 53 | }; 54 | 55 | Graphics.changeErrorStack = function(stack) { 56 | var lines = stack.split(/(?:\r\n|\r|\n)/); 57 | for (var i = 1; i < lines.length; i++) { 58 | lines[i] = lines[i].replace(/[\(](.*[\/])/, '('); 59 | } 60 | return lines; 61 | }; 62 | 63 | Graphics._updateErrorPrinter = function() { 64 | this._errorPrinter.width = this._width * 0.9; 65 | this._errorPrinter.height = this._height * 0.9; 66 | this._errorPrinter.style.textAlign = 'left'; 67 | this._errorPrinter.style.textShadow = '1px 1px 3px #000'; 68 | this._errorPrinter.style.fontSize = '20px'; 69 | this._errorPrinter.style.zIndex = 99; 70 | this._centerElement(this._errorPrinter); 71 | }; 72 | })(); 73 | -------------------------------------------------------------------------------- /MrTS_BattleCharacterLimit.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_BattleCharacterLimit.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Changes character placement for battles. 7 | * @author Mr. Trivel 8 | * 9 | * @param Max Characters 10 | * @desc Max characters in battle 11 | * @default 5 12 | * 13 | * @param Characters Per Row 14 | * @desc Characters per row in battle 15 | * @default 3 16 | * 17 | * @param Offset 18 | * @desc Starting horizontal offset of characters 19 | * @default 120 20 | * 21 | * @param Vertical Offset 22 | * @desc Starting vertical offset of characters 23 | * @default 360 24 | * 25 | * @param Lower Index 26 | * @desc How further each character below is 27 | * @default 48 28 | * 29 | * @param Forward Offset 30 | * @desc Move the rows by an offset for each row in battle 31 | * @default 100 32 | * 33 | * @param Row Spacing 34 | * @desc Space between rows 35 | * @default 100 36 | * 37 | * @param Vertical Chara Spacing 38 | * @desc Space between rows 39 | * @default 54 40 | * 41 | * @help 42 | * -------------------------------------------------------------------------------- 43 | * Terms of Use 44 | * -------------------------------------------------------------------------------- 45 | * Don't remove the header or claim that you wrote this plugin. 46 | * Credit Mr. Trivel if using this plugin in your project. 47 | * Free for commercial and non-commercial projects. 48 | * -------------------------------------------------------------------------------- 49 | * Version 1.1 50 | * -------------------------------------------------------------------------------- 51 | */ 52 | 53 | (function() { 54 | var parameters = PluginManager.parameters('MrTS_BattleCharacterLimit'); 55 | 56 | var maxCharacters = Number(parameters['Max Characters'] || 5); 57 | var charasPerRow = Number(parameters['Characters Per Row'] || 3); 58 | var rightOffset = Number(parameters['Offset'] || 120); 59 | var topOffset = Number(parameters['Vertical Offset'] || 360); 60 | var lowerCharaIndex = Number(parameters['Lower Index'] || 48); 61 | var forwardIndex = Number(parameters['Forward Offset'] || 100); 62 | var rowSpacing = Number(parameters['Row Spacing'] || 100); 63 | var charaVerticalSpacing = Number(parameters['Vertical Chara Spacing'] || 54); 64 | 65 | Game_Party.prototype.maxBattleMembers = function() { 66 | return maxCharacters; 67 | }; 68 | 69 | Sprite_Actor.prototype.setActorHome = function(index) { 70 | var c = Math.floor(index/charasPerRow); 71 | var x = (Graphics.boxWidth - rightOffset) - forwardIndex * Math.floor($gameParty.battleMembers().length/charasPerRow) + lowerCharaIndex * (index % charasPerRow) + rowSpacing * c; 72 | var y = topOffset + (index%charasPerRow) * charaVerticalSpacing; 73 | this.setHome(x, y); 74 | }; 75 | 76 | })(); 77 | -------------------------------------------------------------------------------- /MrTS_SceneBackgrounds.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SceneBackgrounds.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows to set specific backgrounds to each scene instead of using map screenshot. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.1 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * How to use 22 | * -------------------------------------------------------------------------------- 23 | * Open this plugin in your favorite text editor and scroll down to EDIT LIST HERE. 24 | * Then edit it as follows: 25 | * SceneName: "BackgroundName", 26 | * All images go to img\system 27 | * 28 | * NOTE: Only works for scenes based on Scene_MenuBase. 29 | * -------------------------------------------------------------------------------- 30 | * 31 | * -------------------------------------------------------------------------------- 32 | * Version History 33 | * -------------------------------------------------------------------------------- 34 | * 1.1 - Compatibility with Yanfly 35 | * 1.0 - Release 36 | */ 37 | 38 | (function() { 39 | sceneBackgroundList = { 40 | // -------------------------------------------------------------------------------- 41 | // EDIT LIST HERE v 42 | // -------------------------------------------------------------------------------- 43 | Scene_Shop: "pick_Background", 44 | Scene_Menu: "pick_Background2", 45 | Scene_Item: "Meadow" 46 | // -------------------------------------------------------------------------------- 47 | // EDIT LIST THERE ^ 48 | // -------------------------------------------------------------------------------- 49 | } 50 | 51 | var _Scene_MenuBase_createBackground = Scene_MenuBase.prototype.createBackground; 52 | Scene_MenuBase.prototype.createBackground = function() { 53 | _Scene_MenuBase_createBackground.call(this); 54 | if (this._backgroundSprite) 55 | { 56 | for (var key in sceneBackgroundList) { 57 | if (sceneBackgroundList.hasOwnProperty(key)) { 58 | if (this.constructor === eval(key)) 59 | { 60 | this._backgroundSprite.bitmap = ImageManager.loadSystem(sceneBackgroundList[key]); 61 | break; 62 | } 63 | } 64 | } 65 | } 66 | }; 67 | })(); 68 | -------------------------------------------------------------------------------- /MrTS_DamagePostfix.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_DamagePostfix.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Adds postfixes to damage dealt. 7 | * @author Mr. Trivel 8 | * 9 | * @param Show B 10 | * @desc When should B postfix be shown. 11 | * @default 1000000000 12 | * 13 | * @param Show M 14 | * @desc When should B postfix be shown. 15 | * @default 1000000 16 | * 17 | * @param Show K 18 | * @desc When should B postfix be shown. 19 | * @default 1000 20 | * 21 | * @param Decimal Points 22 | * @desc How many decimal points should be used 23 | * @default 2 24 | * 25 | * @help Version 1.0 26 | * B should be the highest, followed by M and K. 27 | */ 28 | 29 | (function() { 30 | var parameters = PluginManager.parameters('MrTS_DamagePostfix'); 31 | 32 | var showB = Number(parameters['Show B'] || 1000000000); 33 | var showM = Number(parameters['Show M'] || 1000000); 34 | var showK = Number(parameters['Show K'] || 1000); 35 | var decimalPoints = Number(parameters['Decimal Points'] || 2); 36 | 37 | Sprite_Damage.prototype.digitHeight = function() { 38 | return this._damageBitmap ? this._damageBitmap.height / 6 : 0; 39 | }; 40 | 41 | Sprite_Damage.prototype.createDigits = function(baseRow, value) { 42 | var string = Math.abs(value).toString(); 43 | 44 | var abs = Math.abs(value); 45 | if (value > showB) 46 | { 47 | abs = (abs/showB).toFixed(decimalPoints); 48 | string = abs.toString() + "B"; 49 | } 50 | else if (value > showM) 51 | { 52 | abs = (abs/showM).toFixed(decimalPoints); 53 | string = abs.toString() + "M"; 54 | } 55 | else if (value > showK) 56 | { 57 | abs = (abs/showK).toFixed(decimalPoints); 58 | string = abs.toString() + "K"; 59 | } 60 | 61 | var row = baseRow + (value < 0 ? 1 : 0); 62 | var w = this.digitWidth(); 63 | var h = this.digitHeight(); 64 | var d = false; 65 | var l = false; 66 | for (var i = 0; i < string.length; i++) { 67 | var sprite = this.createChildSprite(); 68 | switch(string[i]){ 69 | case "K": 70 | sprite.setFrame(0, 5*h, 32, h); 71 | l = true; 72 | break; 73 | 74 | case "M": 75 | sprite.setFrame(32, 5*h, 32, h); 76 | l = true; 77 | break; 78 | 79 | case "B": 80 | sprite.setFrame(64, 5*h, 32, h); 81 | l = true; 82 | break; 83 | 84 | case ".": 85 | sprite.setFrame(96, 5*h, 32, h); 86 | break; 87 | 88 | default: 89 | var n = Number(string[i]); 90 | sprite.setFrame(n * w, row * h, w, h); 91 | break; 92 | } 93 | 94 | sprite.x = (i - (string.length - 1) / 2) * w - (d ? 18 : 0) + (l ? 4 : 0); 95 | if (string[i] === ".") d = true; 96 | sprite.dy = -i; 97 | } 98 | }; 99 | 100 | })(); 101 | -------------------------------------------------------------------------------- /MrTS_RandomSkillPosition.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_RandomSkillPosition.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Makes skill to be in a random offset instead of always striking the same place. 7 | * @author Mr. Trivel 8 | * 9 | * @param Vertical Bounds 10 | * @desc Default: 1.0 11 | * @default 1.0 12 | * 13 | * @param Horizontal Bounds 14 | * @desc Default: 1.0 15 | * @default 1.0 16 | * 17 | * @help 18 | * -------------------------------------------------------------------------------- 19 | * Free for non commercial use. 20 | * Version 1.0 21 | * -------------------------------------------------------------------------------- 22 | ** 23 | * -------------------------------------------------------------------------------- 24 | * Skill Tags 25 | * -------------------------------------------------------------------------------- 26 | * 27 | * Place it in skill note field of skills you want to have random position. 28 | * 29 | * -------------------------------------------------------------------------------- 30 | * Version History 31 | * -------------------------------------------------------------------------------- 32 | * 1.0 - Release 33 | */ 34 | 35 | (function() { 36 | 37 | var parameters = PluginManager.parameters('MrTS_RandomSkillPosition'); 38 | var paramHBounds = Number(parameters['Horizontal Bounds'] || 1.0); 39 | var paramVBounds = Number(parameters['Vertical Bounds'] || 1.0); 40 | 41 | 42 | var _SpriteAnimation_setup = Sprite_Animation.prototype.setup; 43 | Sprite_Animation.prototype.setup = function(target, animation, mirror, delay) { 44 | _SpriteAnimation_setup.call(this, target, animation, mirror, delay); 45 | if ((target._battler && target._battler._randomSkillPos) || 46 | (target.parent._battler && target.parent._battler._randomSkillPos)) 47 | { 48 | var w_bounds = paramHBounds; 49 | var h_bounds = paramVBounds; 50 | var tw = target.width * w_bounds; 51 | var th = target.height * h_bounds; 52 | this._offset.x = Math.randomInt(tw) - tw/2; 53 | this._offset.y = Math.randomInt(th) - th/2; 54 | } 55 | }; 56 | 57 | var _SpriteAnimation_updatePosition = Sprite_Animation.prototype.updatePosition; 58 | Sprite_Animation.prototype.updatePosition = function() { 59 | _SpriteAnimation_updatePosition.call(this); 60 | if (this._animation.position !== 3) 61 | { 62 | this.y += this._offset.y; 63 | this.x += this._offset.x; 64 | } 65 | }; 66 | 67 | var _WindowBattleLog_startAction = Window_BattleLog.prototype.startAction; 68 | Window_BattleLog.prototype.startAction = function(subject, action, targets) { 69 | var item = action.item(); 70 | if (item.meta.RandomPos) 71 | for (var i = 0; i < targets.length; i++) 72 | targets[i]._randomSkillPos = true; 73 | _WindowBattleLog_startAction.call(this, subject, action, targets); 74 | 75 | }; 76 | 77 | var _GameBattler_performResultEffects = Game_Battler.prototype.performResultEffects; 78 | Game_Battler.prototype.performResultEffects = function() { 79 | _GameBattler_performResultEffects.call(this); 80 | this._randomSkillPos = false; 81 | }; 82 | 83 | })(); 84 | -------------------------------------------------------------------------------- /MrTS_HurtSounds.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_HurtSounds.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Makes players and enemies play a sound when they get hit. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.2 18 | * -------------------------------------------------------------------------------- 19 | ** 20 | * -------------------------------------------------------------------------------- 21 | * Actor/Enemy Tags 22 | * -------------------------------------------------------------------------------- 23 | * Place the following tag into Actor or Enemy note field. You can place multiple 24 | * tags on same enemy - in that case a random sound from those will be picked. 25 | * 26 | * [SFX] - SFX name 27 | * [VOL] - Volume 28 | * [PITCH] - Pitch 29 | * 30 | * -------------------------------------------------------------------------------- 31 | * Version History 32 | * -------------------------------------------------------------------------------- 33 | * 1.0 - Release 34 | * 1.1 - Picking a random sound if multiple tags are on the same enemy. 35 | * 1.2 - Crash fix when attacking enemies/actors without hurt notes 36 | */ 37 | 38 | (function() { 39 | var _GameActor_setup = Game_Actor.prototype.setup; 40 | Game_Actor.prototype.setup = function(actorId) { 41 | _GameActor_setup.call(this, actorId); 42 | this._hurtSounds = this.parseHurtSounds(this.actor().note); 43 | }; 44 | 45 | var _GameEnemy_setup = Game_Enemy.prototype.setup; 46 | Game_Enemy.prototype.setup = function(enemyId, x, y) { 47 | _GameEnemy_setup.call(this, enemyId, x, y); 48 | this._hurtSounds = this.parseHurtSounds(this.enemy().note); 49 | }; 50 | 51 | Game_Battler.prototype.parseHurtSounds = function(note) { 52 | var lines = note.split(/[\r\n]/); 53 | var regex = //i; 54 | var results = []; 55 | 56 | for (var i = 0; i < lines.length; i++) { 57 | var regexMatch = regex.exec(lines[i]); 58 | if (regexMatch) 59 | { 60 | results.push([regexMatch[1], Number(regexMatch[2]), Number(regexMatch[3])]); 61 | } 62 | }; 63 | 64 | return results; 65 | }; 66 | 67 | var _GameAction_executeDamage = Game_Action.prototype.executeDamage; 68 | Game_Action.prototype.executeDamage = function(target, value) { 69 | _GameAction_executeDamage.call(this, target, value); 70 | if (value > 0 && target._hurtSounds.length > 0) 71 | { 72 | var sound = AudioManager.makeEmptyAudioObject(); 73 | var randomHurtSound = target._hurtSounds[Math.floor(Math.random()*target._hurtSounds.length)]; 74 | sound.name = randomHurtSound[0]; 75 | sound.volume = randomHurtSound[1]; 76 | sound.pitch = randomHurtSound[2]; 77 | AudioManager.loadStaticSe(sound); 78 | AudioManager.playStaticSe(sound); 79 | } 80 | }; 81 | })(); 82 | -------------------------------------------------------------------------------- /MrTS_RegionTransfer.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_RegionTransfer.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Transfers player when stepping on a region. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Map Note Field 22 | * -------------------------------------------------------------------------------- 23 | * Use the following tag in map properties note field: 24 | * 25 | * 26 | * RegionTransfer transfers player to specific map with X and Y positions. 27 | * 28 | * [RegionId] - ID of the region that will be affected.* 29 | * [MapId] - ID of map 30 | * [X] - X position 31 | * [Y] - Y position 32 | * [Direction] - which direction does player face after the transfer? 33 | * - 2 - up, 4 - left, 6 - right, 8 - up, 0 - same as pre-transfer 34 | * 35 | * Example: 36 | * 37 | * -------------------------------------------------------------------------------- 38 | * Version History 39 | * -------------------------------------------------------------------------------- 40 | * 1.0 - Release 41 | */ 42 | 43 | (function() { 44 | var _GameMap_setup = Game_Map.prototype.setup; 45 | Game_Map.prototype.setup = function(mapId) { 46 | _GameMap_setup.call(this, mapId); 47 | this._regionTransferData = {}; 48 | this.parseRegionTransfers(); 49 | }; 50 | 51 | Game_Map.prototype.parseRegionTransfers = function() { 52 | var note = $dataMap.note.split(/[\r\n]/); 53 | var regexTransfer = //i; 54 | 55 | for (var i = 0; i < note.length; i++) { 56 | var regionTransferMatch = regexTransfer.exec(note[i]) 57 | if (regionTransferMatch) 58 | { 59 | var regionId = Number(regionTransferMatch[1]); 60 | var mapId = Number(regionTransferMatch[2]); 61 | var newX = Number(regionTransferMatch[3]); 62 | var newY = Number(regionTransferMatch[4]); 63 | var direction = Number(regionTransferMatch[5]); 64 | this._regionTransferData[regionId] = [mapId, newX, newY, direction]; 65 | } 66 | } 67 | }; 68 | 69 | Game_Map.prototype.validTransferRegionExistsAt = function(id) { 70 | return this._regionTransferData[id]; 71 | }; 72 | 73 | var _GamePlayer_moveStraight = Game_Player.prototype.moveStraight; 74 | Game_Player.prototype.moveStraight = function(d) { 75 | _GamePlayer_moveStraight.call(this, d); 76 | var data = $gameMap.validTransferRegionExistsAt(this.regionId()); 77 | if (data) 78 | { 79 | this.reserveTransfer(data[0], data[1], data[2], data[3] === 0 ? d : data[3], 0); 80 | } 81 | }; 82 | })(); 83 | -------------------------------------------------------------------------------- /MrTS_ItemsSkillsDiffReactions.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_ItemsSkillsDiffReactions.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Skills and items react differently depending on target. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Item/Skill tags 22 | * -------------------------------------------------------------------------------- 23 | * Place the following tag into item or skill note field to make it use different 24 | * skill depending on target. 25 | * Note: Works with single target spells only. 26 | * 27 | * 28 | * 29 | * If target is [ActorID] replace the skill or item with skill of ID [SkillID]. 30 | * Examples: 31 | * 32 | * 33 | * -------------------------------------------------------------------------------- 34 | * 35 | * -------------------------------------------------------------------------------- 36 | * Version History 37 | * -------------------------------------------------------------------------------- 38 | * 1.0 - Release 39 | */ 40 | 41 | (function() { 42 | 43 | var _GameAction_apply = Game_Action.prototype.apply; 44 | Game_Action.prototype.apply = function(target) { 45 | if ((target.isActor() && this.item().meta.DependsActor ) || 46 | (target.isEnemy() && this.item().meta.DependsEnemy)) 47 | { 48 | this.tryChangeSkillTemporary(this.item(), target); 49 | } 50 | _GameAction_apply.call(this, target); 51 | if (this._tempItem) 52 | { 53 | this._item = this._tempItem; 54 | this._tempItem = null; 55 | } 56 | }; 57 | 58 | Game_Action.prototype.tryChangeSkillTemporary = function(item, target) { 59 | var isTargetActor = target.isActor(); 60 | var noteList = item.note.split(/[\r\n]/); 61 | if (isTargetActor) 62 | { 63 | var regex = //i; 64 | for (var i = 0; i < noteList.length; i++) { 65 | var regexMatch = regex.exec(noteList[i]); 66 | if (regexMatch) 67 | { 68 | if (Number(regexMatch[1]) === target.actorId()) 69 | { 70 | this._tempItem = this._item; 71 | this.setSkill(Number(regexMatch[2])); 72 | break; 73 | } 74 | } 75 | } 76 | } 77 | else 78 | { 79 | var regex = //i; 80 | for (var i = 0; i < noteList.length; i++) { 81 | var regexMatch = regex.exec(noteList[i]); 82 | if (regexMatch) 83 | { 84 | if (Number(regexMatch[1]) === target.enemyId()) 85 | { 86 | this._tempItem = this._item; 87 | this.setSkill(Number(regexMatch[2])); 88 | break; 89 | } 90 | } 91 | } 92 | } 93 | }; 94 | })(); 95 | -------------------------------------------------------------------------------- /MrTS_DeathSounds.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_DeathSounds.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Makes players and enemies play a different sound on death. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Actor/Enemy Tags 22 | * -------------------------------------------------------------------------------- 23 | * Place the following tag into Actor or Enemy note fields. You can place multiple 24 | * tags on same character - in that case a random sound will be picked to play. 25 | * 26 | * [SFX] - SFX name 27 | * [VOL] - Volume 28 | * [PITCH] - Pitch 29 | * 30 | * -------------------------------------------------------------------------------- 31 | * Version History 32 | * -------------------------------------------------------------------------------- 33 | * 1.0 - Release 34 | */ 35 | 36 | (function() { 37 | var _GameActor_setup = Game_Actor.prototype.setup; 38 | Game_Actor.prototype.setup = function(actorId) { 39 | _GameActor_setup.call(this, actorId); 40 | this._deathSounds = this.parseDeathSounds(this.actor().note); 41 | }; 42 | 43 | var _GameEnemy_setup = Game_Enemy.prototype.setup; 44 | Game_Enemy.prototype.setup = function(enemyId, x, y) { 45 | _GameEnemy_setup.call(this, enemyId, x, y); 46 | this._deathSounds = this.parseDeathSounds(this.enemy().note); 47 | }; 48 | 49 | Game_Battler.prototype.parseDeathSounds = function(note) { 50 | var lines = note.split(/[\r\n]/); 51 | var regex = //i; 52 | var results = []; 53 | 54 | for (var i = 0; i < lines.length; i++) { 55 | var regexMatch = regex.exec(lines[i]); 56 | if (regexMatch) 57 | { 58 | results.push([regexMatch[1], Number(regexMatch[2]), Number(regexMatch[3])]); 59 | } 60 | }; 61 | 62 | return results; 63 | }; 64 | 65 | var _GameBattler_performCollapse = Game_Battler.prototype.performCollapse; 66 | Game_Battler.prototype.performCollapse = function() { 67 | _GameBattler_performCollapse.call(this); 68 | if (this._deathSounds.length > 0) 69 | { 70 | var sound = AudioManager.makeEmptyAudioObject(); 71 | var randomDeathSound = this._deathSounds[Math.floor(Math.random()*this._deathSounds.length)]; 72 | sound.name = randomDeathSound[0]; 73 | sound.volume = randomDeathSound[1]; 74 | sound.pitch = randomDeathSound[2]; 75 | AudioManager.loadStaticSe(sound); 76 | AudioManager.playStaticSe(sound); 77 | } 78 | }; 79 | 80 | SoundManager.playEnemyCollapse = function() { 81 | }; 82 | 83 | SoundManager.playBossCollapse1 = function() { 84 | }; 85 | 86 | SoundManager.playBossCollapse2 = function() { 87 | }; 88 | 89 | SoundManager.playActorCollapse = function() { 90 | }; 91 | })(); 92 | -------------------------------------------------------------------------------- /MrTS_SimpleShopTax.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SimpleShopTax.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows easy way to change prices for whole shop items at once. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.1 18 | * -------------------------------------------------------------------------------- 19 | ** 20 | * -------------------------------------------------------------------------------- 21 | * Plugin Commands 22 | * -------------------------------------------------------------------------------- 23 | * SetTaxTo Buy [TAX] 24 | * SetTaxTo Sell [TAX] 25 | * 26 | * Examples: 27 | * SetTaxTo Buy 50 28 | * SetTaxTo Buy -75 29 | * SetTaxTo Sell 25 30 | * SeTtAxTo Sell -50 31 | * -------------------------------------------------------------------------------- 32 | * Version History 33 | * -------------------------------------------------------------------------------- 34 | * 1.1 - Added sell tax. 35 | * 1.0 - Release 36 | */ 37 | 38 | (function() { 39 | 40 | //-------------------------------------------------------------------------- 41 | // Game_Interpreter 42 | // 43 | 44 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 45 | Game_Interpreter.prototype.pluginCommand = function(command, args) { 46 | _Game_Interpreter_pluginCommand.call(this, command, args); 47 | if (command.toLowerCase() === 'settaxto') { 48 | switch(args[0].toUpperCase()) 49 | { 50 | case 'BUY': 51 | { 52 | $gameSystem.setBuyTaxTo(Number(args[1])); 53 | } break; 54 | case 'SELL': 55 | { 56 | $gameSystem.setSellTaxTo(Number(args[1])); 57 | } 58 | } 59 | } 60 | }; 61 | 62 | //-------------------------------------------------------------------------- 63 | // Window_ShopBuy 64 | // 65 | 66 | var _WindowShopBuy_price = Window_ShopBuy.prototype.price; 67 | Window_ShopBuy.prototype.price = function(item) { 68 | var price = _WindowShopBuy_price.call(this, item); 69 | price += Math.floor(price * $gameSystem.getBuyTax()); 70 | return price; 71 | }; 72 | 73 | //-------------------------------------------------------------------------- 74 | // Scene_Shop 75 | // 76 | 77 | var _Scene_Shop_sellingPrice = Scene_Shop.prototype.sellingPrice; 78 | Scene_Shop.prototype.sellingPrice = function() { 79 | var sellingPrice = _Scene_Shop_sellingPrice.call(this); 80 | return Math.max(0, sellingPrice - Math.floor(sellingPrice * $gameSystem.getSellTax())); 81 | }; 82 | 83 | //-------------------------------------------------------------------------- 84 | // Game_System 85 | // 86 | 87 | Game_System.prototype.setBuyTaxTo = function(tax) { 88 | this._shopBuyTax = tax; 89 | }; 90 | 91 | Game_System.prototype.setSellTaxTo = function(tax) { 92 | this._shopSellTax = tax; 93 | }; 94 | 95 | Game_System.prototype.getBuyTax = function() { 96 | return this._shopBuyTax/100 || 0; 97 | }; 98 | 99 | Game_System.prototype.getSellTax = function() { 100 | return this._shopSellTax/100 || 0; 101 | }; 102 | })(); 103 | -------------------------------------------------------------------------------- /MrTS_ChangeEquipmentOnLevelUp.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_ChangeEquipmentOnLevelUp.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Changes actor's equipment on specific levels when leveling up. 7 | * @author Mr. Trivel 8 | * 9 | * @param Destroy 10 | * @desc Destroy previous item on level up? True/False 11 | * Default: True 12 | * @default True 13 | * 14 | * @help 15 | * -------------------------------------------------------------------------------- 16 | * Terms of Use 17 | * -------------------------------------------------------------------------------- 18 | * Don't remove the header or claim that you wrote this plugin. 19 | * Credit Mr. Trivel if using this plugin in your project. 20 | * Free for commercial and non-commercial projects. 21 | * -------------------------------------------------------------------------------- 22 | * Version 1.0 23 | * -------------------------------------------------------------------------------- 24 | * 25 | * -------------------------------------------------------------------------------- 26 | * How to set up 27 | * -------------------------------------------------------------------------------- 28 | * Open the plugin in your favorite text editor, scroll down to EQUIPMENT SETUP 29 | * and follow the structure there. 30 | * -------------------------------------------------------------------------------- 31 | * 32 | * -------------------------------------------------------------------------------- 33 | * Version History 34 | * -------------------------------------------------------------------------------- 35 | * 1.0 - Release 36 | */ 37 | 38 | (function() { 39 | var parameters = PluginManager.parameters('MrTS_ChangeEquipmentOnLevelUp'); 40 | var paramDestroy = (parameters['Destroy'] || "True").toLowerCase() === "true"; 41 | 42 | /* -------------------------------------------------------------------------------- 43 | * -------- EQUIPMENT SETUP HERE v 44 | * -------------------------------------------------------------------------------- */ 45 | /* -------------------------------------------------------------------------------- 46 | * --- Structure is as follows: 47 | * Actor ID : { 48 | * LEVEL: [[Equipment Type, id, slot], [itemType, id, slot]...] 49 | * } 50 | * 51 | * Equipment type: 'w' - weapon, 'a' - armor 52 | * Examples below 53 | * -------------------------------------------------------------------------------- */ 54 | 55 | var equipmentSetup = { 56 | 1: { 57 | 5: [['w', 5, 0], ['a', 5, 2]], 58 | 10: [['w', 6, 0]], 59 | 16: [['a', 6, 3]] 60 | }, 61 | 62 | 4: { 63 | 5: [['a', 6, 3]] 64 | } 65 | }; 66 | /* -------------------------------------------------------------------------------- 67 | * -------- EQUIPMENT SETUP THERE ^ 68 | * -------------------------------------------------------------------------------- */ 69 | 70 | var _GameActor_levelUp = Game_Actor.prototype.levelUp; 71 | Game_Actor.prototype.levelUp = function() { 72 | _GameActor_levelUp.call(this); 73 | if (equipmentSetup[this._actorId] && equipmentSetup[this._actorId][this._level]) 74 | { 75 | var list = equipmentSetup[this._actorId][this._level]; 76 | for (var i = 0; i < list.length; i++) { 77 | var item = null; 78 | switch(list[i][0]) 79 | { 80 | case 'a': 81 | { 82 | item = $dataArmors[list[i][1]]; 83 | } break; 84 | case 'w': 85 | { 86 | item = $dataWeapons[list[i][1]]; 87 | } break; 88 | } 89 | if (item) 90 | { 91 | if (!paramDestroy) this.changeEquip(list[i][2], null); 92 | this.forceChangeEquip(list[i][2], item); 93 | } 94 | } 95 | } 96 | }; 97 | })(); 98 | -------------------------------------------------------------------------------- /MrTS_UseWeaponsArmorInBattle.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_UseWeaponsArmorInBattle.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows to use Weapons and Armor to invoke skills in battle. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Weapon/Armor tags 22 | * -------------------------------------------------------------------------------- 23 | * Use the following tag for weapon or armor note fields: 24 | * 25 | * Weapon or Armor will be treated as skill of [ID]. 26 | * [CONSUMES] - 0 - no, 1 - yes. Does it consume the item on use. 27 | * -------------------------------------------------------------------------------- 28 | * Version History 29 | * -------------------------------------------------------------------------------- 30 | * 1.0 - Release 31 | */ 32 | 33 | (function() { 34 | var parameters = PluginManager.parameters('MrTS_UseWeaponsArmorInBattle'); 35 | 36 | var _SceneBattle_onItemOk = Scene_Battle.prototype.onItemOk; 37 | Scene_Battle.prototype.onItemOk = function() { 38 | var item = this._itemWindow.item(); 39 | if (item.meta.BattleSkill) 40 | { 41 | var action = BattleManager.inputtingAction(); 42 | var meta = item.meta.BattleSkill.split(','); 43 | 44 | action.setSkill(Number(meta[0])); 45 | action.setFree(); 46 | action.setConsume(Number(meta[1]) === 1 ? item : null); 47 | $gameParty.setLastItem(item); 48 | this.onSelectAction(); 49 | } 50 | else 51 | { 52 | _SceneBattle_onItemOk.call(this); 53 | } 54 | }; 55 | 56 | var _WindowBattleItem_includes = Window_BattleItem.prototype.includes; 57 | Window_BattleItem.prototype.includes = function(item) { 58 | return _WindowBattleItem_includes.call(this, item) || (item && item.meta.BattleSkill); 59 | }; 60 | 61 | var _WindowBattleItem_isEnabled = Window_BattleItem.prototype.isEnabled; 62 | Window_BattleItem.prototype.isEnabled = function(item) { 63 | return _WindowBattleItem_isEnabled(item) || (item && item.meta.BattleSkill); 64 | }; 65 | 66 | Game_Action.prototype.setFree = function() { 67 | this._freeSkill = true; 68 | }; 69 | 70 | Game_Action.prototype.setConsume = function(item) { 71 | this._consumeItem = item; 72 | }; 73 | 74 | Game_Action.prototype.isFree = function() { 75 | return this._freeSkill; 76 | }; 77 | 78 | Game_Action.prototype.isConsumed = function() { 79 | return this._consumeItem; 80 | }; 81 | 82 | var _GameAction_clear = Game_Action.prototype.clear; 83 | Game_Action.prototype.clear = function() { 84 | _GameAction_clear.call(this); 85 | this._freeSkill = false; 86 | this._consumeItem = null; 87 | }; 88 | 89 | var _Game_BattlerBase_paySkillCost = Game_BattlerBase.prototype.paySkillCost; 90 | Game_BattlerBase.prototype.paySkillCost = function(skill) { 91 | if (!this.currentAction().isFree()) 92 | _Game_BattlerBase_paySkillCost.call(this, skill); 93 | if (this.currentAction().isConsumed()) 94 | $gameParty.loseItem(this.currentAction().isConsumed(), 1); 95 | }; 96 | })(); 97 | -------------------------------------------------------------------------------- /MrTS_PercentEquipmentStats.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_PercentEquipmentStats.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows for items to have percentage stat increases. 7 | * @author Mr. Trivel 8 | * 9 | * @param Stacking 10 | * @desc How will percent stats stack? Additive or Multiplicative? 11 | * Default: Additive 12 | * @default Additive 13 | * 14 | * @help 15 | * -------------------------------------------------------------------------------- 16 | * Terms of Use 17 | * -------------------------------------------------------------------------------- 18 | * Don't remove the header or claim that you wrote this plugin. 19 | * Credit Mr. Trivel if using this plugin in your project. 20 | * Free for commercial and non-commercial projects. 21 | * -------------------------------------------------------------------------------- 22 | * Version 1.0 23 | * -------------------------------------------------------------------------------- 24 | * 25 | * -------------------------------------------------------------------------------- 26 | * Weapon/Armor Note Tags 27 | * -------------------------------------------------------------------------------- 28 | * Following tags influence stats item give when put into weapon or armor notefield 29 | * 30 | * 31 | * 32 | * 33 | * 34 | * 35 | * 36 | * 37 | * 38 | * [TYPE] - p, v 39 | * p - percentage, [VALUE] - 1, -0.2, 0.505 |1 - +100%, -0.2 - -20%, 0.505 - +50.5% 40 | * v - variable, [VALUE] - 1, 5, 10 41 | * 42 | * How to set decimals in variables? 43 | * Simply choose Script in Operand in Control Variables and you can type 1.0 there. 44 | * -------------------------------------------------------------------------------- 45 | * Version History 46 | * -------------------------------------------------------------------------------- 47 | * 1.0 - Release 48 | */ 49 | 50 | (function() { 51 | var parameters = PluginManager.parameters('MrTS_PercentEquipmentStats'); 52 | var paramStacking = String(parameters['Stacking'] || "Additive").toLowerCase(); 53 | 54 | var _GameActor_paramPlus = Game_Actor.prototype.paramPlus; 55 | Game_Actor.prototype.paramPlus = function(paramId) { 56 | var params = ["mhp", "mmp", "atk", "def", "matk", "mdef", "agi", "luk"]; 57 | var value = _GameActor_paramPlus.call(this, paramId); 58 | var equips = this.equips(); 59 | var multiplier = 0.0; 60 | for (var i = 0; i < equips.length; i++) { 61 | var item = equips[i]; 62 | if (item && item.meta[params[paramId]]) { 63 | var meta = item.meta[params[paramId]]; 64 | if (meta[0] === " ") meta = meta.substring(1); 65 | meta = meta.split(' '); 66 | switch (meta[0]) 67 | { 68 | case "p": 69 | { 70 | if (paramStacking === "additive") 71 | multiplier += Number(meta[1]); 72 | else 73 | { 74 | var add = this.getMultipliedValue(Number(meta[1]), this.paramBase(paramId), value); 75 | value += add; 76 | } 77 | } break; 78 | case "v": 79 | { 80 | if (paramStacking === "additive") 81 | multiplier += $gameVariables.value(Number(meta[1])); 82 | else 83 | { 84 | var add = this.getMultipliedValue($gameVariables.value(Number(meta[1])), this.paramBase(paramId), value); 85 | value += add; 86 | } 87 | } break; 88 | } 89 | } 90 | } 91 | value += this.getMultipliedValue(multiplier, this.paramBase(paramId), value); 92 | return value; 93 | }; 94 | 95 | Game_Actor.prototype.getMultipliedValue = function(mult, base, plus) { 96 | return Math.round((base + plus) * mult); 97 | }; 98 | })(); 99 | -------------------------------------------------------------------------------- /MrTS_MapDestinationImage.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_MapDestinationImage.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Changes map destination graphic and can disable it's effect. Can be animated. 7 | * @author Mr. Trivel 8 | * 9 | * @param Disable Effect 10 | * @desc Should default effect be disabled? (true/false) 11 | * Default: True 12 | * @default True 13 | * 14 | * @param Animated Destination 15 | * @desc Do you want destination image animated? (true/false) 16 | * Default: False 17 | * @default False 18 | * 19 | * @param Frames 20 | * @desc If animated. How many frames in the image? 21 | * Default: 4 22 | * @default 4 23 | * 24 | * @param Speed 25 | * @desc If animated. How fast is the animation? Every.. frames 26 | * Default: 10 27 | * @default 10 28 | * 29 | * @help 30 | * -------------------------------------------------------------------------------- 31 | * Terms of Use 32 | * -------------------------------------------------------------------------------- 33 | * Don't remove the header or claim that you wrote this plugin. 34 | * Credit Mr. Trivel if using this plugin in your project. 35 | * Free for commercial and non-commercial projects. 36 | * -------------------------------------------------------------------------------- 37 | * Version 1.1 38 | * -------------------------------------------------------------------------------- 39 | * 40 | * -------------------------------------------------------------------------------- 41 | * Image Data 42 | * -------------------------------------------------------------------------------- 43 | * All images go to img\system. 44 | * 45 | * img\system\mapDestination.png - image to replace the destination square 46 | * -------------------------------------------------------------------------------- 47 | * 48 | * -------------------------------------------------------------------------------- 49 | * Version History 50 | * -------------------------------------------------------------------------------- 51 | * 1.1 - Destination image can be animated. 52 | * 1.0 - Release 53 | */ 54 | 55 | (function() { 56 | var parameters = PluginManager.parameters('MrTS_MapDestinationImage'); 57 | var paramDisableEff = (parameters['Disable Effect'] || "true").toLowerCase() === "true"; 58 | var paramAnimated = (parameters['Animated Destination'] || "False").toLowerCase() === "true"; 59 | var paramAnimFrames = Number(parameters['Frames'] || 4); 60 | var paramAnimSpeed = Number(parameters['Speed'] || 10); 61 | 62 | var _SpriteDestination_initialize = Sprite_Destination.prototype.initialize; 63 | Sprite_Destination.prototype.initialize = function() { 64 | _SpriteDestination_initialize.call(this); 65 | this._frameNumber = 0; 66 | this._frameWidth = 48; 67 | this._loadedImage = false; 68 | }; 69 | 70 | Sprite_Destination.prototype.createBitmap = function() { 71 | this.bitmap = ImageManager.loadSystem('mapDestination'); 72 | this.anchor.x = 0.5; 73 | this.anchor.y = 0.5; 74 | }; 75 | 76 | var _SpriteDestination_updateAnimation = Sprite_Destination.prototype.updateAnimation; 77 | Sprite_Destination.prototype.updateAnimation = function() { 78 | if (!this._loadedImage && paramAnimated && this.bitmap.isReady()) 79 | { 80 | this._frameWidth = this.bitmap.width/paramAnimFrames; 81 | this.setFrame(this._frameWidth*this._frameNumber, 0, this._frameWidth, this.bitmap.height); 82 | this._loadedImage = true; 83 | } 84 | 85 | if (paramAnimated && this._loadedImage) 86 | { 87 | this._frameCount++; 88 | if (this._frameCount >= paramAnimSpeed) 89 | { 90 | this._frameCount = 0; 91 | this._frameNumber++; 92 | if (this._frameNumber >= paramAnimFrames) this._frameNumber = 0; 93 | this.setFrame(this._frameWidth*this._frameNumber, 0, this._frameWidth, this.bitmap.height); 94 | } 95 | } 96 | 97 | if (!paramDisableEff) _SpriteDestination_updateAnimation.call(this); 98 | }; 99 | })(); 100 | -------------------------------------------------------------------------------- /MrTS_NoItemCategories.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_NoItemCategories.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Removes item categories from item menu scene and from shop scene. 7 | * @author Mr. Trivel 8 | * 9 | * @param Hide Menu 10 | * @desc Hide item categories in menu scene? True/False 11 | * Default: True 12 | * @default True 13 | * 14 | * @param Hide Shop 15 | * @desc Hide item categories in shop scene? True/False 16 | * Default: True 17 | * @default True 18 | * 19 | * @help 20 | * -------------------------------------------------------------------------------- 21 | * Terms of Use 22 | * -------------------------------------------------------------------------------- 23 | * Don't remove the header or claim that you wrote this plugin. 24 | * Credit Mr. Trivel if using this plugin in your project. 25 | * Free for commercial and non-commercial projects. 26 | * -------------------------------------------------------------------------------- 27 | * Version 1.1 28 | * -------------------------------------------------------------------------------- 29 | * 30 | * -------------------------------------------------------------------------------- 31 | * Version History 32 | * -------------------------------------------------------------------------------- 33 | * 1.1 - Removed item categories from shop scene. 34 | * 1.0 - Release 35 | */ 36 | 37 | (function() { 38 | var parameters = PluginManager.parameters('MrTS_NoItemCategories'); 39 | var paramHideMenu = (parameters['Hide Menu'] || "True").toLowerCase() === "true"; 40 | var paramHideShop = (parameters['Hide Shop'] || "True").toLowerCase() === "true"; 41 | 42 | // Categories 43 | var _Window_ItemList_includes = Window_ItemList.prototype.includes; 44 | Window_ItemList.prototype.includes = function(item) { 45 | if (this._category == 'all') 46 | return true; 47 | else 48 | return _Window_ItemList_includes.call(this, item); 49 | }; 50 | 51 | // Scene_Item 52 | if (paramHideMenu) 53 | { 54 | 55 | Scene_Item.prototype.createCategoryWindow = function() { 56 | }; 57 | 58 | Scene_Item.prototype.createItemWindow = function() { 59 | var wy = this._helpWindow.height; 60 | var wh = Graphics.boxHeight - wy; 61 | this._itemWindow = new Window_ItemList(0, wy, Graphics.boxWidth, wh); 62 | this._itemWindow.setHelpWindow(this._helpWindow); 63 | this._itemWindow.setHandler('ok', this.onItemOk.bind(this)); 64 | this._itemWindow.setHandler('cancel', this.popScene.bind(this)); 65 | this._itemWindow.setCategory('all'); 66 | this.addWindow(this._itemWindow); 67 | this._itemWindow.activate(); 68 | this._itemWindow.select(0); 69 | }; 70 | } 71 | 72 | // Scene_Shop 73 | if (paramHideShop) 74 | { 75 | var _Scene_Shop_createCategoryWindow = Scene_Shop.prototype.createCategoryWindow; 76 | Scene_Shop.prototype.createCategoryWindow = function() { 77 | _Scene_Shop_createCategoryWindow.call(this); 78 | this._categoryWindow.y = -1000; 79 | }; 80 | 81 | Scene_Shop.prototype.createSellWindow = function() { 82 | var wy = this._dummyWindow.y; 83 | var wh = Graphics.boxHeight - wy; 84 | this._sellWindow = new Window_ShopSell(0, wy, Graphics.boxWidth, wh); 85 | this._sellWindow.setHelpWindow(this._helpWindow); 86 | this._sellWindow.hide(); 87 | this._sellWindow.setHandler('ok', this.onSellOk.bind(this)); 88 | this._sellWindow.setHandler('cancel', this.onCategoryCancel.bind(this)); 89 | this._sellWindow.setCategory('all'); 90 | this.addWindow(this._sellWindow); 91 | }; 92 | 93 | var _Scene_Shop_commandSell = Scene_Shop.prototype.commandSell; 94 | Scene_Shop.prototype.commandSell = function() { 95 | _Scene_Shop_commandSell.call(this); 96 | this._categoryWindow.deactivate(); 97 | this._sellWindow.activate(); 98 | this._sellWindow.select(0); 99 | }; 100 | } 101 | 102 | })(); 103 | -------------------------------------------------------------------------------- /MrTS_StaticExp.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_StaticExp.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Makes every level require same amount of EXP. Enemies give exp depending on actor level. 7 | * @author Mr. Trivel 8 | * 9 | * @param EXP Needed 10 | * @desc EXP Needed for each level. 11 | * @default 200 12 | * 13 | * @param Overflow 14 | * @desc Does EXP Overflow to next level? (Y/N) 15 | * @default N 16 | * 17 | * @param EXP Reward 18 | * @desc EXP rewarded for killing same level enemy 19 | * @default 15 20 | * 21 | * @param EXP Bonus 22 | * @desc EXP bonus for killing higher level enemy per it's level 23 | * @default 7 24 | * 25 | * @param EXP Loss 26 | * @desc EXP Loss for killing lower level enemy per it's level 27 | * @default 3 28 | * 29 | * @param Obtained Exp Message 30 | * @desc Message display after victory 31 | * @default %1 received %2 %3! 32 | * 33 | * @help 34 | * -------------------------------------------------------------------------------- 35 | * Terms of Use 36 | * -------------------------------------------------------------------------------- 37 | * Don't remove the header or claim that you wrote this plugin. 38 | * Credit Mr. Trivel if using this plugin in your project. 39 | * Free for commercial and non-commercial projects. 40 | * -------------------------------------------------------------------------------- 41 | * Version 1.0 42 | * -------------------------------------------------------------------------------- 43 | * 44 | * Enemies give EXP according to Actor level. 45 | * Enemies that have lower level will give less EXP while enemies higher level than 46 | * Actor give more EXP. 47 | * 48 | * Tags for enemy note fields: 49 | * - Level of enemy. If no level noted assumes level 1. 50 | * - instead of using default base EXP, 51 | * use the number in enemy database EXP field for it. 52 | */ 53 | 54 | (function(){ 55 | var parameters = PluginManager.parameters('MrTS_StaticExp'); 56 | 57 | var overflow = String(parameters['Overflow'] || "N"); 58 | var expNeeded = Number(parameters['EXP Needed'] || 200); 59 | var expReward = Number(parameters['EXP Reward'] || 15); 60 | var expBonus = Number(parameters['EXP Bonus'] || 7); 61 | var expLoss = Number(parameters['EXP Loss'] || 3); 62 | 63 | var expObtainedMessage = String(parameters['Obtained Exp Message'] || "%1 received %2 %3!"); 64 | 65 | Game_Actor.prototype.expForLevel = function(level) { 66 | return expNeeded*(level-1); 67 | }; 68 | 69 | var _Game_Actor_levelUp = Game_Actor.prototype.levelUp; 70 | Game_Actor.prototype.levelUp = function() { 71 | _Game_Actor_levelUp.call(this); 72 | if (overflow.toUpperCase() == "N") 73 | this._exp[this._classId] = this.expForLevel(this._level); 74 | } 75 | 76 | var _Game_Enemy_exp = Game_Enemy.prototype.exp; 77 | Game_Enemy.prototype.exp = function() { 78 | if (this.enemy().meta.custom_base_exp) 79 | return _Game_Enemy_exp.call(this); 80 | else 81 | return expReward; 82 | } 83 | 84 | Game_Troop.prototype.expTotal = function() { 85 | var t_exp = []; 86 | var i = 0; 87 | $gameParty.allMembers().forEach(function(member){ 88 | t_exp[i] = 0; 89 | $gameTroop.deadMembers().forEach(function(enemy){ 90 | var dif = (enemy.enemy().meta.level ? enemy.enemy().meta.level : 1) - member.level; 91 | var exp = enemy.exp(); 92 | if (dif > 0) 93 | exp += expBonus * dif; 94 | else if (dif < 0) 95 | exp += expLoss * dif; 96 | 97 | if (exp < 0) exp = 0; 98 | t_exp[i] += exp; 99 | 100 | }); 101 | i++; 102 | }); 103 | 104 | return t_exp; 105 | } 106 | 107 | BattleManager.gainExp = function() { 108 | var exp = this._rewards.exp; 109 | var i = 0; 110 | $gameParty.allMembers().forEach(function(actor) { 111 | actor.gainExp(exp[i]); 112 | i++; 113 | }); 114 | }; 115 | 116 | BattleManager.displayExp = function() { 117 | var exp = this._rewards.exp; 118 | 119 | $gameMessage.newPage(); 120 | 121 | var i = 0; 122 | $gameParty.battleMembers().forEach(function(member){ 123 | var t_exp = exp[i]; 124 | if (t_exp > 0) 125 | { 126 | var text = expObtainedMessage.format(member.name(), exp[i], TextManager.exp); 127 | $gameMessage.add('\\.' + text); 128 | } 129 | i++; 130 | }); 131 | }; 132 | 133 | 134 | })(); 135 | -------------------------------------------------------------------------------- /MrTS_ConjureWeapons.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_ConjureWeapons.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Skills can conjure weapons. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.1 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Skill Tags 22 | * -------------------------------------------------------------------------------- 23 | * To make skill conjure a weapon use the following tag: 24 | * 25 | * [WEAPON_ID] - ID of the weapon you're conjuring. 26 | * [DURATION] - How many turns will weapon last. If 0 - lasts whole battle. 27 | * 28 | * -------------------------------------------------------------------------------- 29 | * Version History 30 | * -------------------------------------------------------------------------------- 31 | * 1.1 - Bug fix. 32 | * 1.0 - Release 33 | */ 34 | 35 | (function() { 36 | var _GameActor_initMembers = Game_Actor.prototype.initMembers; 37 | Game_Actor.prototype.initMembers = function() { 38 | _GameActor_initMembers.call(this); 39 | this._originalWeapon = 0; 40 | this._conjureWeaponTimer = 0; 41 | this._conjuredWeapon = false; 42 | }; 43 | 44 | Game_Actor.prototype.conjureWeapon = function(item, timer) { 45 | if (this._equips[0]._itemId != item.id) 46 | { 47 | if (this._originalWeapon === 0) 48 | this._originalWeapon = this._equips[0]._itemId; 49 | 50 | this._conjureWeaponTimer = timer; 51 | this._conjuredWeapon = true; 52 | this._equips[0].setObject(item); 53 | } 54 | else 55 | { 56 | this._conjureWeaponTimer = timer; 57 | } 58 | }; 59 | 60 | _Game_Action_apply = Game_Action.prototype.apply; 61 | Game_Action.prototype.apply = function(target) { 62 | _Game_Action_apply.call(this, target); 63 | var result = target.result(); 64 | if (result.isHit() && this.item().meta.ConjureWeapon) 65 | { 66 | var data = this.item().meta.ConjureWeapon.split(","); 67 | var weapon = $dataWeapons[Number(data[0])]; 68 | var time = Number(data[1]); 69 | target.conjureWeapon(weapon, time === 0 ? -1 : time+1); 70 | } 71 | }; 72 | 73 | Game_Actor.prototype.releaseUnequippableItems = function(forcing) { 74 | for (;;) { 75 | var slots = this.equipSlots(); 76 | var equips = this.equips(); 77 | var changed = false; 78 | for (var i = 0; i < equips.length; i++) { 79 | var item = equips[i]; 80 | if (item && (!this.canEquip(item) || item.etypeId !== slots[i]) && 81 | (!this._conjuredWeapon && i != 0)) { 82 | if (!forcing) { 83 | this.tradeItemWithParty(null, item); 84 | } 85 | this._equips[i].setObject(null); 86 | changed = true; 87 | } 88 | } 89 | if (!changed) { 90 | break; 91 | } 92 | } 93 | }; 94 | 95 | var _GameActor_onBattleEnd = Game_Actor.prototype.onBattleEnd; 96 | Game_Actor.prototype.onBattleEnd = function() { 97 | _GameActor_onBattleEnd.call(this); 98 | if (this._originalWeapon > 0) 99 | { 100 | this.forceChangeEquip(0, $dataWeapons[this._originalWeapon]); 101 | this._originalWeapon = 0; 102 | this._conjuredWeapon = false; 103 | } 104 | }; 105 | 106 | var _GameActor_onTurnEnd = Game_Actor.prototype.onTurnEnd; 107 | Game_Actor.prototype.onTurnEnd = function() { 108 | _GameActor_onTurnEnd.call(this); 109 | if (this._conjureWeaponTimer > 0) 110 | this._conjureWeaponTimer--; 111 | 112 | if (this._conjuredWeapon && this._conjureWeaponTimer <= 0) 113 | { 114 | this.forceChangeEquip(0, $dataWeapons[this._originalWeapon]); 115 | this._originalWeapon = 0; 116 | this._conjuredWeapon = false; 117 | } 118 | }; 119 | })(); 120 | -------------------------------------------------------------------------------- /MrTS_EmptyMenu.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_EmptyMenu.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Removes actor data and moves command window. 7 | * @author Mr. Trivel 8 | * 9 | * @param Show Gold Window 10 | * @desc Show Gold Window? True/False 11 | * Default: True 12 | * @default True 13 | * 14 | * @param Command X 15 | * @desc Comannd Window's X position. Is evaluated. 16 | * Default: Graphics.boxWidth/2 - this._commandWindow.width/2 17 | * @default Graphics.boxWidth/2 - this._commandWindow.width/2 18 | * 19 | * @param Command Y 20 | * @desc Command Window's Y position. Is evaluated. 21 | * Default: Graphics.boxHeight/2 - this._commandWindow.height/2 22 | * @default Graphics.boxHeight/2 - this._commandWindow.height/2 23 | * 24 | * @param Gold X 25 | * @desc Gold Window's X position. Is evaluated. 26 | * Default: this._commandWindow.x 27 | * @default this._commandWindow.x 28 | * 29 | * @param Gold Y 30 | * @desc Gold Window's Y position. Is evaluated. 31 | * Default: this._commandWindow.y + this._commandWindow.height 32 | * @default this._commandWindow.y + this._commandWindow.height 33 | * 34 | * @help 35 | * -------------------------------------------------------------------------------- 36 | * Terms of Use 37 | * -------------------------------------------------------------------------------- 38 | * Don't remove the header or claim that you wrote this plugin. 39 | * Credit Mr. Trivel if using this plugin in your project. 40 | * Free for commercial and non-commercial projects. 41 | * -------------------------------------------------------------------------------- 42 | * Version 1.0 43 | * -------------------------------------------------------------------------------- 44 | * 45 | * -------------------------------------------------------------------------------- 46 | * Version History 47 | * -------------------------------------------------------------------------------- 48 | * 1.0 - Release 49 | */ 50 | 51 | (function() { 52 | var parameters = PluginManager.parameters('MrTS_EmptyMenu'); 53 | var paramShowGold = (parameters['Show Gold Window'] || "True").toLowerCase() === "true"; 54 | var paramCommandX = String(parameters['Command X'] || "Graphics.boxWidth/2 - this._commandWindow.width/2"); 55 | var paramCommandY = String(parameters['Command Y'] || "Graphics.boxHeight/2 - this._commandWindow.height/2"); 56 | var paramGoldX = String(parameters['Gold X'] || "this._commandWindow.x"); 57 | var paramGoldY = String(parameters['Gold Y'] || "this._commandWindow.y + this._commandWindow.height"); 58 | 59 | var _SceneMenu_createStatusWindow = Scene_Menu.prototype.createStatusWindow; 60 | Scene_Menu.prototype.createStatusWindow = function() { 61 | _SceneMenu_createStatusWindow.call(this); 62 | this._statusWindow.x = Graphics.boxWidth - this._statusWindow.width; 63 | this._statusWindow.visible = false; 64 | }; 65 | 66 | var _SceneMenu_createCommandWindow = Scene_Menu.prototype.createCommandWindow; 67 | Scene_Menu.prototype.createCommandWindow = function() { 68 | _SceneMenu_createCommandWindow.call(this); 69 | this._commandWindow.x = eval(paramCommandX); 70 | this._commandWindow.y = eval(paramCommandY); 71 | }; 72 | 73 | var _SceneMenu_createGoldWindow = Scene_Menu.prototype.createGoldWindow; 74 | Scene_Menu.prototype.createGoldWindow = function() { 75 | _SceneMenu_createGoldWindow.call(this); 76 | this._goldWindow.visible = paramShowGold; 77 | this._goldWindow.x = eval(paramGoldX); 78 | this._goldWindow.y = eval(paramGoldY); 79 | }; 80 | 81 | var _SceneMenu_commandPersonal = Scene_Menu.prototype.commandPersonal; 82 | Scene_Menu.prototype.commandPersonal = function() { 83 | _SceneMenu_commandPersonal.call(this); 84 | this._statusWindow.visible = true; 85 | }; 86 | 87 | var _SceneMenu_commandFormation = Scene_Menu.prototype.commandFormation; 88 | Scene_Menu.prototype.commandFormation = function() { 89 | _SceneMenu_commandFormation.call(this); 90 | this._statusWindow.visible = true; 91 | }; 92 | 93 | var _SceneMenu_onPersonalCancel = Scene_Menu.prototype.onPersonalCancel; 94 | Scene_Menu.prototype.onPersonalCancel = function() { 95 | _SceneMenu_onPersonalCancel.call(this); 96 | this._statusWindow.visible = false; 97 | }; 98 | 99 | var _SceneMenu_onFormationCancel = Scene_Menu.prototype.onFormationCancel; 100 | Scene_Menu.prototype.onFormationCancel = function() { 101 | _SceneMenu_onFormationCancel.call(this); 102 | this._statusWindow.visible = false; 103 | }; 104 | })(); 105 | -------------------------------------------------------------------------------- /MrTS_ProgressTitleScreen.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_ProgressTitleScreen.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Changes title screen picture according to game progress. 7 | * @author Mr. Trivel 8 | * 9 | * @param Image List 10 | * @desc Title screen image list. 11 | * (no space after ,) 12 | * @default Book,Castle,Crystal,Sword,Volcano 13 | * 14 | * @help 15 | * -------------------------------------------------------------------------------- 16 | * Terms of Use 17 | * -------------------------------------------------------------------------------- 18 | * Don't remove the header or claim that you wrote this plugin. 19 | * Credit Mr. Trivel if using this plugin in your project. 20 | * Free for commercial and non-commercial projects. 21 | * -------------------------------------------------------------------------------- 22 | * Version 1.0 23 | * -------------------------------------------------------------------------------- 24 | * 25 | * -------------------------------------------------------------------------------- 26 | * Infor 27 | * -------------------------------------------------------------------------------- 28 | * Save file with highest TitleScreen value will be used to display title screen. 29 | * 30 | * -------------------------------------------------------------------------------- 31 | * Plugin Commands 32 | * -------------------------------------------------------------------------------- 33 | * TitleScreen [PROGRESS] 34 | * E.g.: TitleScreen 3 35 | * That would set TitleScreen to 3rd item on the Image List. Using defaults it'd be 36 | * Crystal. 37 | * 38 | * -------------------------------------------------------------------------------- 39 | * Version History 40 | * -------------------------------------------------------------------------------- 41 | * 1.0 - Release 42 | */ 43 | 44 | (function() { 45 | 46 | //----------------------------------------------------------------------------- 47 | // Parameters 48 | // 49 | 50 | var parameters = PluginManager.parameters('MrTS_ProgressTitleScreen'); 51 | var paramTitleList = String(parameters['Image List'] || "Book,Castle,Crystal,Sword,Volcano"); 52 | var paramImageList = paramTitleList.split(","); 53 | 54 | //-------------------------------------------------------------------------- 55 | // Game_Interpreter 56 | // 57 | 58 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 59 | Game_Interpreter.prototype.pluginCommand = function(command, args) { 60 | _Game_Interpreter_pluginCommand.call(this, command, args); 61 | if (command === 'TitleScreen') { 62 | $gameSystem.setTitleScreenProgressTo(Number(args[0])); 63 | } 64 | }; 65 | 66 | //-------------------------------------------------------------------------- 67 | // Game_System 68 | // 69 | 70 | Game_System.prototype.setTitleScreenProgressTo = function(progress) { 71 | this._titleProgress = progress; 72 | }; 73 | 74 | Game_System.prototype.getTitleScreenProgress = function() { 75 | return this._titleProgress; 76 | }; 77 | 78 | //-------------------------------------------------------------------------- 79 | // DataManager 80 | // 81 | 82 | var _DataManager_makeSavefileInfo = DataManager.makeSavefileInfo; 83 | DataManager.makeSavefileInfo = function() { 84 | var info = _DataManager_makeSavefileInfo.call(this); 85 | info.titleProgress = $gameSystem.getTitleScreenProgress(); 86 | return info; 87 | }; 88 | 89 | DataManager.highestTitleProgress = function() { 90 | var progress = 0; 91 | var globalInfo = this.loadGlobalInfo(); 92 | if (globalInfo) { 93 | for (var i = 1; i < globalInfo.length; i++) { 94 | if (this.isThisGameFile(i)) { 95 | if (globalInfo[i].titleProgress && globalInfo[i].titleProgress > progress) 96 | progress = globalInfo[i].titleProgress; 97 | } 98 | } 99 | } 100 | return progress; 101 | }; 102 | 103 | //-------------------------------------------------------------------------- 104 | // Scene_Title 105 | // 106 | 107 | Scene_Title.prototype.createBackground = function() { 108 | var progress = DataManager.highestTitleProgress(); 109 | if (progress > 0) 110 | this._backSprite1 = new Sprite(ImageManager.loadTitle1(paramImageList[progress-1])); 111 | else 112 | this._backSprite1 = new Sprite(ImageManager.loadTitle1($dataSystem.title1Name)); 113 | this._backSprite2 = new Sprite(ImageManager.loadTitle2($dataSystem.title2Name)); 114 | this.addChild(this._backSprite1); 115 | this.addChild(this._backSprite2); 116 | }; 117 | })(); 118 | -------------------------------------------------------------------------------- /MrTS_ColorShiftingEnemies.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_ColorShiftingEnemies.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Makes enemies go disco disco in battles. 7 | * @author Mr. Trivel 8 | * 9 | * @param Change Time 10 | * @desc How long it takes -- in frames -- between each tone? 11 | * Default: 60 12 | * @default 60 13 | * 14 | * @param Tone Sequence 15 | * @desc [Red, Green, Blue, Gray] repeat as many times as needed. 16 | * @default [50, 50, 0, 0] [100, 0, 25, 0] [0, 0, 75, 0] [-50, 99, -10, 0] [90, 0, 0, 0] 17 | * 18 | * @help 19 | * -------------------------------------------------------------------------------- 20 | * Terms of Use 21 | * -------------------------------------------------------------------------------- 22 | * Don't remove the header or claim that you wrote this plugin. 23 | * Credit Mr. Trivel if using this plugin in your project. 24 | * Free for commercial and non-commercial projects. 25 | * -------------------------------------------------------------------------------- 26 | * Version 1.0 27 | * -------------------------------------------------------------------------------- 28 | * 29 | * -------------------------------------------------------------------------------- 30 | * Enemy Tags 31 | * -------------------------------------------------------------------------------- 32 | * Enemies tagged with will go in all colors in battle. 33 | * -------------------------------------------------------------------------------- 34 | * 35 | * -------------------------------------------------------------------------------- 36 | * Version History 37 | * -------------------------------------------------------------------------------- 38 | * 1.0 - Release 39 | */ 40 | 41 | (function() { 42 | var parameters = PluginManager.parameters('MrTS_ColorShiftingEnemies'); 43 | var paramChangeTime = Number(parameters['Change Time'] || 60); 44 | var paramToneSequence = String(parameters['Tone Sequence'] || "[50, 50, 0, 0] [100, 0, 25, 0] [0, 0, 75, 0] [-50, 99, -10, 0] [90, 0, 0, 0]"); 45 | 46 | _GameSystem_initialize = Game_System.prototype.initialize; 47 | Game_System.prototype.initialize = function() { 48 | _GameSystem_initialize.call(this); 49 | this.parseEnemyDiscoSequence(); 50 | }; 51 | 52 | Game_System.prototype.parseEnemyDiscoSequence = function() { 53 | this._discoSequence = []; 54 | var tmpSqn = paramToneSequence.split(']'); 55 | var regex = /[\[]([-]*\d+)[, ]*([-]*\d+)[, ]*([-]*\d+)[, ]*([-]*\d+)/i; 56 | for (var i = 0; i < tmpSqn.length; i++) { 57 | var regexMatch = regex.exec(tmpSqn[i]); 58 | if (regexMatch) 59 | { 60 | var r = Number(regexMatch[1]); 61 | var g = Number(regexMatch[2]); 62 | var b = Number(regexMatch[3]); 63 | var gray = Number(regexMatch[4]); 64 | var arr = [r, g, b, gray]; 65 | this._discoSequence.push(arr); 66 | } 67 | } 68 | }; 69 | 70 | Game_System.prototype.getDiscoStep = function(step) { 71 | return this._discoSequence[step]; 72 | }; 73 | 74 | var _SpriteEnemy_initialize = Sprite_Enemy.prototype.initialize; 75 | Sprite_Enemy.prototype.initialize = function(battler) { 76 | _SpriteEnemy_initialize.call(this, battler); 77 | if (battler.enemy().meta.DiscoDisco) 78 | { 79 | this._discoDisco = true; 80 | this._currentDiscoStep = 0; 81 | this._nextDiscoTone = 0; 82 | this._currentDiscoTone = this.getColorTone().clone(); 83 | } 84 | }; 85 | 86 | var _SpriteEnemy_update = Sprite_Enemy.prototype.update; 87 | Sprite_Enemy.prototype.update = function() { 88 | _SpriteEnemy_update.call(this); 89 | if (this._enemy && this._discoDisco) 90 | { 91 | this.updateDiscoSteps(); 92 | } 93 | }; 94 | 95 | Sprite_Enemy.prototype.updateDiscoSteps = function() { 96 | this._currentDiscoStep++; 97 | 98 | var cTone = this._currentDiscoTone; 99 | var nTone = $gameSystem.getDiscoStep(this._nextDiscoTone); 100 | 101 | if (this._currentDiscoStep >= paramChangeTime) 102 | { 103 | this._currentDiscoStep = 0; 104 | this.setColorTone(nTone); 105 | this._currentDiscoTone = nTone.clone(); 106 | this._nextDiscoTone++; 107 | if (this._nextDiscoTone >= $gameSystem._discoSequence.length) 108 | this._nextDiscoTone = 0; 109 | } 110 | else 111 | { 112 | var r = Math.floor(((nTone[0] - cTone[0])/paramChangeTime)*this._currentDiscoStep); 113 | var g = Math.floor(((nTone[1] - cTone[1])/paramChangeTime)*this._currentDiscoStep); 114 | var b = Math.floor(((nTone[2] - cTone[2])/paramChangeTime)*this._currentDiscoStep); 115 | var gray = Math.floor(((nTone[3] - cTone[3])/paramChangeTime)*this._currentDiscoStep); 116 | 117 | this.setColorTone([cTone[0] + r, cTone[1] + g, cTone[2] + b, cTone[3] + gray]); 118 | } 119 | }; 120 | })(); 121 | -------------------------------------------------------------------------------- /MrTS_RestoreHpMpTp.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_RestoreHpMpTp.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows to have equipment/states that restore HP/MP/TP after battles or level ups. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Trait Objects Tags (Actor/Class/Weapon/Armor/State) 22 | * -------------------------------------------------------------------------------- 23 | * HP: 24 | * 25 | * 26 | * 27 | * 28 | * 29 | * 30 | * MP: 31 | * 32 | * 33 | * 34 | * 35 | * 36 | * 37 | * TP: 38 | * 39 | * 40 | * 41 | * 42 | * 43 | * 44 | * RestoreAfterBattle - restores HP/MP/TP after a won battle. 45 | * RestoreAfterLevelUp - restores HP/MP/TP after a level up. 46 | * [AMOUNT] - flat amount E.g. 10, 100, 1000, 50, 37 47 | * [PERCENT AMOUNT] - uses floating point E.g. 0.53 being 53%, 1.0 being 100% 48 | * 49 | * Examples: 50 | * 51 | * 52 | * 53 | * 54 | * -------------------------------------------------------------------------------- 55 | * 56 | * -------------------------------------------------------------------------------- 57 | * Version History 58 | * -------------------------------------------------------------------------------- 59 | * 1.0 - Release 60 | */ 61 | 62 | (function() { 63 | Game_Actor.prototype.restoreAfterType = function(type) { 64 | var valueHp = 0; 65 | var valueHpP = 0.0; 66 | var valueMp = 0; 67 | var valueMpP = 0.0; 68 | var valueTp = 0; 69 | var valueTpP = 0.0; 70 | var traitObjects = this.traitObjects(); 71 | 72 | for (var i = 0; i < traitObjects.length; i++) { 73 | switch(type) 74 | { 75 | case 'battle': 76 | { 77 | valueHp += Number(traitObjects[i].meta.RestoreAfterBattleHP) || 0; 78 | valueHpP += Number(traitObjects[i].meta.RestoreAfterBattleHPPercent) || 0; 79 | 80 | valueMp += Number(traitObjects[i].meta.RestoreAfterBattleMP) || 0; 81 | valueMpP += Number(traitObjects[i].meta.RestoreAfterBattleMPPercent) || 0; 82 | 83 | valueTp += Number(traitObjects[i].meta.RestoreAfterBattleTP) || 0; 84 | valueTpP += Number(traitObjects[i].meta.RestoreAfterBattleTPPercent) || 0; 85 | } break; 86 | case 'levelup': 87 | { 88 | valueHp += Number(traitObjects[i].meta.RestoreAfterLevelUpHP) || 0; 89 | valueHpP += Number(traitObjects[i].meta.RestoreAfterLevelUpHPPercent) || 0; 90 | 91 | valueMp += Number(traitObjects[i].meta.RestoreAfterLevelUpMP) || 0; 92 | valueMpP += Number(traitObjects[i].meta.RestoreAfterLevelUpMPPercent) || 0; 93 | 94 | valueTp += Number(traitObjects[i].meta.RestoreAfterLevelUpTP) || 0; 95 | valueTpP += Number(traitObjects[i].meta.RestoreAfterLevelUpTPPercent) || 0; 96 | } break; 97 | } 98 | } 99 | 100 | var totalHp = valueHp + Math.floor(this.mhp * valueHpP); 101 | var totalMp = valueMp + Math.floor(this.mmp * valueMpP); 102 | var totalTp = valueTp + Math.floor(100 * valueTpP); 103 | console.log(valueHp, valueMp, valueTp); 104 | this.gainHp(totalHp); 105 | this.gainMp(totalMp); 106 | this.gainTp(totalTp); 107 | }; 108 | 109 | var _GameActor_levelUp = Game_Actor.prototype.levelUp; 110 | Game_Actor.prototype.levelUp = function() { 111 | _GameActor_levelUp.call(this); 112 | this.restoreAfterType('levelup'); 113 | }; 114 | 115 | var _BattleManager_processVictory = BattleManager.processVictory; 116 | BattleManager.processVictory = function() { 117 | _BattleManager_processVictory.call(this); 118 | for (var i = 0; i < $gameParty.battleMembers().length; i++) { 119 | $gameParty.battleMembers()[i].restoreAfterType('battle'); 120 | } 121 | }; 122 | })(); 123 | -------------------------------------------------------------------------------- /MrTS_EnemyExpChange.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_EnemyExpChange.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Changes how enemies give EXP. Now it's based on actor and enemy level. 7 | * @author Mr. Trivel 8 | * 9 | * @param Default Mode 10 | * @desc If no tags on enemy, by default should it be percent or flat change? 11 | * Default: percent 12 | * @default percent 13 | * 14 | * @param Default Change Up 15 | * @desc By how much should exp change per level difference when actor level > enemy level? 16 | * @default 10 17 | * 18 | * @param Default Change Down 19 | * @desc By how much should exp change per level difference when actor level < enemy level? 20 | * @default 5 21 | * 22 | * @param Obtained Exp Message 23 | * @desc Message display after victory 24 | * @default %1 received %2 %3! 25 | * 26 | * @help 27 | * -------------------------------------------------------------------------------- 28 | * Terms of Use 29 | * -------------------------------------------------------------------------------- 30 | * Don't remove the header or claim that you wrote this plugin. 31 | * Credit Mr. Trivel if using this plugin in your project. 32 | * Free for commercial and non-commercial projects. 33 | * -------------------------------------------------------------------------------- 34 | * Version 1.0 35 | * -------------------------------------------------------------------------------- 36 | * 37 | * -------------------------------------------------------------------------------- 38 | * Enemy Tags 39 | * -------------------------------------------------------------------------------- 40 | * - Set level for the enemy. All calculations are based on it. 41 | * If not set, it'll be assumed as Level 1. 42 | * - Set a specific change of exp instead of default when 44 | * Actor Level > Enemy Level 45 | * - Set a specific change of exp instead of default when 46 | * Actor Level < Enemy Level 47 | * Example: 48 | * 49 | * 50 | * 51 | * 52 | * -------------------------------------------------------------------------------- 53 | * Version History 54 | * -------------------------------------------------------------------------------- 55 | * 1.0 - Release 56 | */ 57 | 58 | (function(){ 59 | var parameters = PluginManager.parameters('MrTS_EnemyExpChange'); 60 | 61 | var paramDefaultMode = String(parameters['Default Mode'] || "percent"); 62 | var paramDefaultChangeUp = Number(parameters['Default Change Up'] || 10); 63 | var paramDefaultChangeDown = Number(parameters['Default Change Down'] || 5); 64 | var expObtainedMessage = String(parameters['Obtained Exp Message'] || "%1 received %2 %3!"); 65 | 66 | Game_Troop.prototype.expTotal = function() { 67 | var t_exp = []; 68 | var i = 0; 69 | $gameParty.allMembers().forEach(function(member){ 70 | t_exp[i] = 0; 71 | $gameTroop.deadMembers().forEach(function(enemy){ 72 | var dif = (enemy.enemy().meta.Level ? enemy.enemy().meta.Level : 1) - member.level; 73 | var exp = enemy.exp(); 74 | var mode = enemy.enemy().meta.ChangeMode ? String(enemy.enemy().meta.ChangeMode).toLowerCase() : paramDefaultMode; 75 | if (dif > 0) 76 | { 77 | var totalChange = (enemy.enemy().meta.ChangeDown ? enemy.enemy().meta.ChangeDown : paramDefaultChangeDown) * dif; 78 | if (mode === "flat" || mode === " flat") 79 | exp += totalChange; 80 | else 81 | exp += Math.floor(exp * (totalChange/100)); 82 | } 83 | else if (dif < 0) 84 | { 85 | 86 | var totalChange = (enemy.enemy().meta.ChangeUp ? enemy.enemy().meta.ChangeUp : paramDefaultChangeUp) * dif; 87 | if (mode === "flat" || mode === " flat") 88 | exp += totalChange; 89 | else 90 | exp += Math.floor(exp * (totalChange/100)); 91 | } 92 | 93 | if (exp < 0) exp = 0; 94 | t_exp[i] += exp; 95 | 96 | }); 97 | i++; 98 | }); 99 | 100 | return t_exp; 101 | } 102 | 103 | BattleManager.gainExp = function() { 104 | var exp = this._rewards.exp; 105 | var i = 0; 106 | $gameParty.allMembers().forEach(function(actor) { 107 | actor.gainExp(exp[i]); 108 | i++; 109 | }); 110 | }; 111 | 112 | BattleManager.displayExp = function() { 113 | var exp = this._rewards.exp; 114 | 115 | $gameMessage.newPage(); 116 | 117 | var i = 0; 118 | $gameParty.battleMembers().forEach(function(member){ 119 | var t_exp = exp[i]; 120 | if (t_exp > 0) 121 | { 122 | var text = expObtainedMessage.format(member.name(), exp[i], TextManager.exp); 123 | $gameMessage.add('\\.' + text); 124 | } 125 | i++; 126 | }); 127 | }; 128 | 129 | 130 | })(); 131 | -------------------------------------------------------------------------------- /MrTS_InvisibleEventsInRange.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_InvisibleEventsInRange.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Makes events invisible when within or outside the range. 7 | * @author Mr. Trivel 8 | * 9 | * @param Appear Gradually 10 | * @desc Should events fade in/out or just pop up/down. True/False 11 | * Default: True 12 | * @default true 13 | * 14 | * @param Appear Time 15 | * @desc If events appear gradually. How long does it take in frames? 16 | * Default: 20 17 | * @default 20 18 | * 19 | * @help 20 | * -------------------------------------------------------------------------------- 21 | * Terms of Use 22 | * -------------------------------------------------------------------------------- 23 | * Don't remove the header or claim that you wrote this plugin. 24 | * Credit Mr. Trivel if using this plugin in your project. 25 | * Free for commercial and non-commercial projects. 26 | * -------------------------------------------------------------------------------- 27 | * Version 1.0 28 | * -------------------------------------------------------------------------------- 29 | * 30 | * -------------------------------------------------------------------------------- 31 | * Event Comment Commands 32 | * -------------------------------------------------------------------------------- 33 | * - If tag is in comment, it'll display according to event's page. 34 | * Use "Comment..." command under Flow Control for those tags. 35 | * 36 | * 37 | * TYPE - in/out, if "in" - enemy will be hidden if player is within the RANGE. 38 | * if "out" - enemy will be hidden if player is out of the RANGE. 39 | * 40 | * RANGE - how far/close has player to be 41 | * 42 | * E.g. 43 | * 44 | * 45 | * 46 | * -------------------------------------------------------------------------------- 47 | * Version History 48 | * -------------------------------------------------------------------------------- 49 | * 1.0 - Release 50 | */ 51 | 52 | (function() { 53 | var parameters = PluginManager.parameters('MrTS_InvisibleEventsInRange'); 54 | var paramAppearGradually = String(parameters['Appear Gradually'] || "true").toLowerCase() === "true"; 55 | var paramAppearTime = Number(parameters['Appear Time'] || 20); 56 | 57 | var regexEventHidden = //i; 58 | 59 | var _GameEvent_initialize = Game_Event.prototype.initialize; 60 | Game_Event.prototype.initialize = function(mapId, eventId) { 61 | this._isVisible = true; 62 | this._hiddenMechanicOn = false; 63 | this._hiddenRange = 0; 64 | this._hiddenType = "out"; 65 | this._hiddenOpacity = 255.0; 66 | _GameEvent_initialize.call(this, mapId, eventId); 67 | this.updateHiddenData(); 68 | }; 69 | 70 | Game_Event.prototype.updateHiddenData = function() { 71 | this._hiddenPageIndex = this._pageIndex; 72 | if (!this.page()) return; 73 | 74 | var isVisible = true; 75 | var mechanicOn = false; 76 | 77 | if (this.list()) 78 | { 79 | for (action of this.list()) 80 | { 81 | if (action.code == "108") { 82 | var a = action.parameters[0]; 83 | var match = regexEventHidden.exec(a); 84 | if (match) 85 | { 86 | this._hiddenType = match[1].toLowerCase(); 87 | this._hiddenRange = Number(match[2]); 88 | mechanicOn = true; 89 | } 90 | } 91 | } 92 | 93 | } 94 | 95 | this._isVisible = isVisible; 96 | this._hiddenMechanicOn = mechanicOn; 97 | }; 98 | 99 | var _GameEvent_update = Game_Event.prototype.update; 100 | Game_Event.prototype.update = function() { 101 | _GameEvent_update.call(this); 102 | if (this._pageIndex !== this._hiddenPageIndex) 103 | this.updateHiddenData(); 104 | 105 | this.updateHidden(); 106 | }; 107 | 108 | Game_Event.prototype.updateHidden = function() { 109 | var x = $gamePlayer.x; 110 | var y = $gamePlayer.y; 111 | var range = Math.abs($gamePlayer.x - this.x) + Math.abs($gamePlayer.y - this.y); 112 | var withinRange = this._hiddenType === "out" ? 113 | range >= this._hiddenRange: 114 | range <= this._hiddenRange; 115 | 116 | this._isVisible = (!this._hiddenMechanicOn || !withinRange); 117 | 118 | if (this._isVisible && this._opacity !== 255) 119 | { 120 | if (paramAppearGradually) 121 | this._hiddenOpacity += 255/paramAppearTime; 122 | else 123 | this._hiddenOpacity = 255; 124 | 125 | this._hiddenOpacity = Math.min(this._hiddenOpacity, 255); 126 | this._opacity = Math.floor(this._hiddenOpacity); 127 | } 128 | else if (!this._isVisible && this._opacity !== 0) 129 | { 130 | if (paramAppearGradually) 131 | this._hiddenOpacity -= 255/paramAppearTime; 132 | else 133 | this._hiddenOpacity = 0; 134 | 135 | this._hiddenOpacity = Math.max(this._hiddenOpacity, 0); 136 | this._opacity = Math.floor(this._hiddenOpacity); 137 | } 138 | }; 139 | })(); 140 | -------------------------------------------------------------------------------- /MrTS_EnemyPositions.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_EnemyPositions.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows to change enemy positions through adding tags. 7 | * @author Mr. Trivel 8 | * 9 | * @param Spawn Rule 10 | * @desc Should enemies NOT spawn on same position if no other spots are available? True/False 11 | * @default True 12 | * 13 | * @help 14 | * -------------------------------------------------------------------------------- 15 | * Terms of Use 16 | * -------------------------------------------------------------------------------- 17 | * Don't remove the header or claim that you wrote this plugin. 18 | * Credit Mr. Trivel if using this plugin in your project. 19 | * Free for commercial and non-commercial projects. 20 | * -------------------------------------------------------------------------------- 21 | * Version 1.1 22 | * -------------------------------------------------------------------------------- 23 | * 24 | * -------------------------------------------------------------------------------- 25 | * Enemy Tags 26 | * -------------------------------------------------------------------------------- 27 | * Use following tags inside enemy note fields. In case of multiple tags - tag at 28 | * random will be picked. 29 | * 30 | * E.g.: 31 | * -------------------------------------------------------------------------------- 32 | * Version History 33 | * -------------------------------------------------------------------------------- 34 | * 1.0 - Release 35 | * 1.1 - Now compatible with Hime's Enemy Reinforcements. 36 | */ 37 | 38 | (function() { 39 | var parameters = PluginManager.parameters('MrTS_EnemyPositions'); 40 | var paramSpawnRule = String(parameters['Spawn Rule'] || "true"); 41 | paramSpawnRule = Boolean(paramSpawnRule.toLowerCase() === "true") 42 | 43 | var _GameTroop_setup = Game_Troop.prototype.setup; 44 | Game_Troop.prototype.setup = function(troopId) { 45 | _GameTroop_setup.call(this, troopId); 46 | this.reshuffleEnemies(); 47 | }; 48 | 49 | Game_Troop.prototype.randomiseEnemyPosition = function(index) { 50 | var enemy = this._enemies[index].enemy(); 51 | if (enemy.meta.Position) 52 | { 53 | this._enemies[index]._screenX = -100; 54 | this._enemies[index]._screenY = -100; 55 | var note = enemy.note.split(/[\r\n]/); 56 | var positions = []; 57 | var lastPosition = []; 58 | var regex = //; 59 | for (var j = 0; j < note.length; j++) 60 | { 61 | var regexMatch = regex.exec(note[j]); 62 | if (regexMatch) 63 | positions.push(regexMatch[1]); 64 | }; 65 | 66 | var l = positions.length; 67 | for (var j = 0; j < l; j++) 68 | { 69 | var newPosition = positions[Math.floor(Math.random()*positions.length)]; 70 | var newCoordinates = newPosition.split(' '); 71 | lastPosition = newCoordinates; 72 | var newX = Number(newCoordinates[0]); 73 | var newY = Number(newCoordinates[1]); 74 | if (this.enemyExistsAtPos(newX, newY)) 75 | { 76 | positions.splice(positions.indexOf(newPosition), 1); 77 | } 78 | else 79 | { 80 | this._enemies[index]._screenX = newX; 81 | this._enemies[index]._screenY = newY; 82 | break; 83 | } 84 | }; 85 | 86 | if (positions.length === 0) 87 | { 88 | if (paramSpawnRule) 89 | { 90 | this._enemies.splice(index, 1); 91 | index--; 92 | } 93 | else 94 | { 95 | var newX = Number(lastPosition[0]); 96 | var newY = Number(lastPosition[1]); 97 | this._enemies[index]._screenX = newX; 98 | this._enemies[index]._screenY = newY; 99 | } 100 | } 101 | } 102 | }; 103 | 104 | Game_Troop.prototype.reshuffleEnemies = function() { 105 | this.resetEnemyPositionsSpecial(); 106 | 107 | for (var i = this._enemies.length - 1; i >= 0; i--) { 108 | this.randomiseEnemyPosition(i); 109 | }; 110 | 111 | this.makeUniqueNames(); 112 | }; 113 | 114 | Game_Troop.prototype.enemyExistsAtPos = function(x, y) { 115 | for (var i = 0; i < this._enemies.length; i++) { 116 | if (this._enemies[i].screenX() === x && this._enemies[i].screenY() === y) 117 | return true; 118 | }; 119 | 120 | return false; 121 | }; 122 | 123 | Game_Troop.prototype.resetEnemyPositionsSpecial = function() { 124 | for (var i = 0; i < this._enemies.length; i++) { 125 | if (!this._enemies[i].enemy().meta.Position) continue; 126 | this._enemies[i]._screenX = -100; 127 | this._enemies[i]._screenY = -100; 128 | }; 129 | }; 130 | 131 | if (Imported.EnemyReinforcements) 132 | { 133 | var _GameTroop_addReinforcementMember = Game_Troop.prototype.addReinforcementMember; 134 | Game_Troop.prototype.addReinforcementMember = function(troopId, memberId, member) { 135 | _GameTroop_addReinforcementMember.call(this, troopId, memberId, member); 136 | this.randomiseEnemyPosition(this._enemies.length-1); 137 | } 138 | } 139 | })(); 140 | -------------------------------------------------------------------------------- /MrTS_CriticalDamage.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_CriticalDamage.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Changes how critical damage works. No more Damage * 3. 7 | * @author Mr. Trivel 8 | * 9 | * @param Base Multiplier 10 | * @desc Starting multiplier for critical hits. 2.0 = 200%, 1.5 = 150% 11 | * Default: 2.0 12 | * @default 2.0 13 | * 14 | * @help 15 | * -------------------------------------------------------------------------------- 16 | * Terms of Use 17 | * -------------------------------------------------------------------------------- 18 | * Don't remove the header or claim that you wrote this plugin. 19 | * Credit Mr. Trivel if using this plugin in your project. 20 | * Free for commercial and non-commercial projects. 21 | * -------------------------------------------------------------------------------- 22 | * Version 1.1 23 | * -------------------------------------------------------------------------------- 24 | * 25 | * -------------------------------------------------------------------------------- 26 | * Actor/Enemy Tags 27 | * -------------------------------------------------------------------------------- 28 | * For actors which have their base Critical Damage Multiplier different from 29 | * one defined in plugin parameter. 30 | * Can't be negative number. 31 | * 32 | * 33 | * Example: 34 | * 35 | * 36 | * -------------------------------------------------------------------------------- 37 | * 38 | * -------------------------------------------------------------------------------- 39 | * Class Tags 40 | * -------------------------------------------------------------------------------- 41 | * For classes which have their base Critical Damage Multiplier differenet from 42 | * one defined in plugin paramater or actor tags. 43 | * Can't be negative number. 44 | * 45 | * 46 | * Example: 47 | * 48 | * 49 | * -------------------------------------------------------------------------------- 50 | * 51 | * -------------------------------------------------------------------------------- 52 | * State Tags 53 | * -------------------------------------------------------------------------------- 54 | * While character has the state and it has the following tag in it, it'll increase 55 | * character's crit damage multiplier by that amount. 56 | * If number is negative, it'll decrease multiplier by that amount instead. 57 | * 58 | * 59 | * Example: 60 | * 61 | * 62 | * -------------------------------------------------------------------------------- 63 | * 64 | * -------------------------------------------------------------------------------- 65 | * Equipment Tags 66 | * -------------------------------------------------------------------------------- 67 | * While actor has item equipped and it has the following tag in it, it'll increase 68 | * character's crit damage multiplier by that amount. 69 | * If number is negative, it'll decrease multiplier by that amount instead. 70 | * 71 | * 72 | * Example: 73 | * 74 | * 75 | * -------------------------------------------------------------------------------- 76 | * 77 | * -------------------------------------------------------------------------------- 78 | * Version History 79 | * -------------------------------------------------------------------------------- 80 | * 1.1 - Critical damage won't go lower than normal damage anymore. 81 | * 1.0 - Release 82 | */ 83 | 84 | (function() { 85 | var parameters = PluginManager.parameters('MrTS_CriticalDamage'); 86 | var paramBaseMultiplier = Number(parameters['Base Multiplier'] || 2.0); 87 | 88 | Game_Enemy.prototype.critMultiplier = function() { 89 | var multiplier = this.enemy().meta.CritMultiplier ? 0.0 : paramBaseMultiplier; 90 | var traitObjects = this.traitObjects(); 91 | for (var i = 0; i < traitObjects.length; i++) { 92 | if (traitObjects[i].meta.CritMultiplier) 93 | multiplier += Number(traitObjects[i].meta.CritMultiplier); 94 | } 95 | return multiplier; 96 | }; 97 | 98 | Game_Actor.prototype.critMultiplier = function() { 99 | var multiplier = 0.0; 100 | if (this.currentClass().meta.CritMultiplier) 101 | multiplier = Number(this.currentClass().meta.CritMultiplier); 102 | else if (this.actor().meta.CritMultiplier) 103 | multiplier = Number(this.actor().meta.CritMultiplier); 104 | else 105 | multiplier = paramBaseMultiplier; 106 | 107 | var traitObjects = this.traitObjects(); 108 | for (var i = 0; i < traitObjects.length; i++) { 109 | if ( traitObjects[i].classId || 110 | traitObjects[i].expParams || 111 | !traitObjects[i].meta.CritMultiplier) continue; 112 | 113 | multiplier += Number(traitObjects[i].meta.CritMultiplier); 114 | } 115 | return multiplier; 116 | }; 117 | 118 | Game_Action.prototype.applyCritical = function(damage) { 119 | return damage * Math.max(1.0, this.subject().critMultiplier()); 120 | }; 121 | })(); 122 | -------------------------------------------------------------------------------- /MrTS_GainStatsOnLevelUp.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_GainStatsOnLevelUp.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Actors gain stats on level up. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.1 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Class Tags 22 | * -------------------------------------------------------------------------------- 23 | * 24 | * formula 25 | * 26 | * 27 | * Stats: 28 | * MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK 29 | * 30 | * v = variables 31 | * a = actor 32 | * 33 | * Examples: 34 | * 35 | * v[10]; 36 | * 37 | * 38 | * Math.randomInt(5); 39 | * 40 | * 41 | * -1 42 | * 43 | * -------------------------------------------------------------------------------- 44 | * 45 | * -------------------------------------------------------------------------------- 46 | * Version History 47 | * -------------------------------------------------------------------------------- 48 | * 1.1 - Crash fix with multi line stat evaluations. 49 | * 1.0 - Release 50 | */ 51 | 52 | (function() { 53 | 54 | var _GameActor_setup = Game_Actor.prototype.setup; 55 | Game_Actor.prototype.setup = function(actorId) { 56 | _GameActor_setup.call(this, actorId); 57 | this._classExtraParam = []; 58 | this._classExtraParamLevels = []; 59 | this._classExtraParamLevels[this._classId] = this._level; 60 | }; 61 | 62 | var _GameActor_levelUp = Game_Actor.prototype.levelUp; 63 | Game_Actor.prototype.levelUp = function() { 64 | _GameActor_levelUp.call(this); 65 | this.addClassExtraParams(); 66 | }; 67 | 68 | var _GameActor_paramPlus = Game_Actor.prototype.paramPlus; 69 | Game_Actor.prototype.paramPlus = function(paramId) { 70 | var value = _GameActor_paramPlus.call(this, paramId); 71 | if (this._classExtraParam && this._classExtraParam[this._classId] && this._classExtraParam[this._classId][paramId]) 72 | value += this._classExtraParam[this._classId][paramId]; 73 | return value; 74 | }; 75 | 76 | var _GameActor_changeClass = Game_Actor.prototype.changeClass; 77 | Game_Actor.prototype.changeClass = function(classId, keepExp) { 78 | _GameActor_changeClass.call(this, classId, keepExp); 79 | this.addClassExtraParams(); 80 | }; 81 | 82 | Game_Actor.prototype.addClassExtraParams = function() { 83 | if (!this._classExtraParamLevels[this._classId]) 84 | this._classExtraParamLevels[this._classId] = this.actor().initialLevel; 85 | 86 | var difference = this._level - this._classExtraParamLevels[this._classId]; 87 | var note = this.currentClass().note.split(/[\r\n]/); 88 | var statStarted = null 89 | var code = ""; 90 | var regexStart = /<(MHP|MMP|ATK|DEF|MAT|MDF|AGI|LUK)>/i; 91 | var regexEnd = /<(\/MHP|\/MMP|\/ATK|\/DEF|\/MAT|\/MDF|\/AGI|\/LUK)>/i; 92 | var paramCode = []; 93 | 94 | for (var i = 0; i < note.length; i++) { 95 | var regexStartMatch = regexStart.exec(note[i]); 96 | if (regexStartMatch) 97 | { 98 | statStarted = regexStartMatch[1].toLowerCase(); 99 | continue; 100 | } 101 | 102 | var regexEndMatch = regexEnd.exec(note[i]); 103 | if (regexEndMatch) 104 | { 105 | switch(statStarted) 106 | { 107 | case 'mhp': 108 | { 109 | paramCode[0] = code; 110 | } break; 111 | case 'mmp': 112 | { 113 | paramCode[1] = code; 114 | } break; 115 | case 'atk': 116 | { 117 | paramCode[2] = code; 118 | } break; 119 | case 'def': 120 | { 121 | paramCode[3] = code; 122 | } break; 123 | case 'mat': 124 | { 125 | paramCode[4] = code; 126 | } break; 127 | case 'mdf': 128 | { 129 | paramCode[5] = code; 130 | } break; 131 | case 'agi': 132 | { 133 | paramCode[6] = code; 134 | } break; 135 | case 'luk': 136 | { 137 | paramCode[7] = code; 138 | } break; 139 | 140 | } 141 | statStarted = null; 142 | code = ""; 143 | continue; 144 | } 145 | 146 | if (statStarted) 147 | { 148 | code += " " + note[i]; 149 | continue; 150 | } 151 | } // for 152 | 153 | for (var i = 0; i < difference; i++) { 154 | for (var j = 0; j < 8; j++) { 155 | if (!paramCode[j]) continue; 156 | 157 | var v = $gameVariables._data; 158 | var a = this; 159 | var increase = eval(paramCode[j]); 160 | if (!this._classExtraParam[this._classId]) 161 | this._classExtraParam[this._classId] = [0, 0, 0, 0, 0, 0, 0, 0]; 162 | this._classExtraParam[this._classId][j] += Number(increase); 163 | } 164 | } 165 | this._classExtraParamLevels[this._classId] = this._level; 166 | }; 167 | })(); 168 | -------------------------------------------------------------------------------- /MrTS_MenuMusic.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_MenuMusic.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Plays different music in menus. 7 | * @author Mr. Trivel 8 | * 9 | * @param Menu Music 10 | * @desc BGM name for Menu music. 11 | * Default: Ship1 12 | * @default Ship1 13 | * 14 | * @param Shop Music 15 | * @desc BGM name for Shop music. 16 | * Default: Town2 17 | * @default Town2 18 | * 19 | * @param Restart Music 20 | * @desc Restarted or resume music when exiting scenes? Restart/Resume 21 | * Default: Resume 22 | * @default Resume 23 | * 24 | * @help 25 | * -------------------------------------------------------------------------------- 26 | * Terms of Use 27 | * -------------------------------------------------------------------------------- 28 | * Don't remove the header or claim that you wrote this plugin. 29 | * Credit Mr. Trivel if using this plugin in your project. 30 | * Free for commercial and non-commercial projects. 31 | * -------------------------------------------------------------------------------- 32 | * Version 1.0 33 | * -------------------------------------------------------------------------------- 34 | * 35 | * -------------------------------------------------------------------------------- 36 | * About the Plugin 37 | * -------------------------------------------------------------------------------- 38 | * Don't want default map music playing in Menu? Shop? Crafting menu? This plugin 39 | * allows to change their music to something you'd like instead. Maybe some calming 40 | * music for menu so players can relax from a difficult dungeon or something 41 | * uplifting for shopping. 42 | * -------------------------------------------------------------------------------- 43 | * 44 | * -------------------------------------------------------------------------------- 45 | * Custom Scene Music Setup 46 | * -------------------------------------------------------------------------------- 47 | * Music for custom scenes (added by other plugins) will require editing the code. 48 | * Open up this plugin in your favorite text editor and scroll down to: *EDIT HERE* 49 | * It has a couple sample entries to look at. 50 | * -------------------------------------------------------------------------------- 51 | * 52 | * -------------------------------------------------------------------------------- 53 | * Version History 54 | * -------------------------------------------------------------------------------- 55 | * 1.0 - Release 56 | */ 57 | 58 | (function() { 59 | var parameters = PluginManager.parameters('MrTS_MenuMusic'); 60 | var paramMenuMusic = String(parameters['Menu Music'] || "Ship1"); 61 | var paramShopMusic = String(parameters['Shop Music'] || "Town2"); 62 | var paramRestartMusic = String(parameters['Restart Music'] || "Resume").toLowerCase(); 63 | 64 | var musicList = { 65 | /* -------------------------------------------------------------------------------- 66 | * -------- EDIT HERE v 67 | * -------------------------------------------------------------------------------- */ 68 | //Scene name: "BGM Name in quotes", 69 | 70 | // Scene_Save: "Dungeon1", 71 | // Scene_Load: "Dungeon1", 72 | /* -------------------------------------------------------------------------------- 73 | * -------- EDIT THERE ^ 74 | * -------------------------------------------------------------------------------- */ 75 | Scene_Menu: paramMenuMusic, 76 | Scene_Shop: paramShopMusic 77 | }; 78 | 79 | var _Scene_Base_initialize = Scene_Base.prototype.initialize; 80 | Scene_Base.prototype.initialize = function() { 81 | _Scene_Base_initialize.call(this); 82 | for (var key in musicList) { 83 | if (musicList.hasOwnProperty(key)) { 84 | if (this.constructor === eval(key)) 85 | { 86 | this._musicListKey = key; 87 | var bgm = { 88 | name: musicList[this._musicListKey], 89 | pan: 0, 90 | pitch: 100, 91 | volume: 90 92 | }; 93 | if (!AudioManager.isCurrentBgm(bgm)) { 94 | 95 | AudioManager.saveMenuBgm(key, AudioManager.saveBgm()); 96 | AudioManager.saveMenuBgs(key, AudioManager.saveBgs()); 97 | AudioManager.playBgm(bgm); 98 | } 99 | break; 100 | } 101 | } 102 | } 103 | }; 104 | 105 | var _Scene_Base_popScene = Scene_Base.prototype.popScene; 106 | Scene_Base.prototype.popScene = function() { 107 | 108 | if (this._musicListKey) 109 | { 110 | AudioManager.replayMenuBgmBgs(this._musicListKey); 111 | } 112 | _Scene_Base_popScene.call(this); 113 | }; 114 | 115 | AudioManager.saveMenuBgm = function(key, bgm) { 116 | if (!this._savedMenuBgm) this._savedMenuBgm = {}; 117 | this._savedMenuBgm[key] = bgm; 118 | }; 119 | 120 | AudioManager.saveMenuBgs = function(key, bgs) { 121 | if (!this._savedMenuBgs) this._savedMenuBgs = {}; 122 | this._savedMenuBgs[key] = bgs; 123 | }; 124 | 125 | AudioManager.replayMenuBgmBgs = function(key) { 126 | if (!this._savedMenuBgs) this._savedMenuBgs = {}; 127 | if (!this._savedMenuBgm) this._savedMenuBgm = {}; 128 | if (this._savedMenuBgs[key]) AudioManager.playBgs(this._savedMenuBgs[key], paramRestartMusic === "resume" ? this._savedMenuBgs[key].pos : 0); 129 | if (this._savedMenuBgm[key]) AudioManager.playBgm(this._savedMenuBgm[key], paramRestartMusic === "resume" ? this._savedMenuBgm[key].pos : 0); 130 | else AudioManager.stopBgm(); 131 | }; 132 | })(); 133 | -------------------------------------------------------------------------------- /MrTS_SimpleSkillLeveling.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SimpleSkillLeveling.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Skills change to stronger version of themselves after X uses. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.1 18 | * -------------------------------------------------------------------------------- 19 | ** 20 | * -------------------------------------------------------------------------------- 21 | * Skill Tags 22 | * -------------------------------------------------------------------------------- 23 | * To make skill change after some uses, use the following tag: 24 | * 25 | * 26 | * Will make skill require a specific other existing skill that was used. 27 | * 28 | * 29 | * [ID] - Skill ID to change to 30 | * [USES] - After how many uses change into that skill 31 | * [REMOVE] - 0 - keep skill after leveling up, 1 - remove skill after leveling up 32 | * (Remove is optional, by default it'll remove) 33 | * 34 | * Examples: 35 | * 36 | * 37 | * 38 | * 39 | * 40 | * 41 | * 42 | * 43 | * 44 | * 45 | * 46 | * 47 | * -------------------------------------------------------------------------------- 48 | * 49 | * -------------------------------------------------------------------------------- 50 | * Version History 51 | * -------------------------------------------------------------------------------- 52 | * 1.1 - Added multiple skill requirement for level up. 53 | * - Added ability to keep skills after they leveled up. 54 | * - Fixed a bug where it'd count as multiple uses for multiple target skill. 55 | * 1.0 - Release 56 | */ 57 | 58 | (function() { 59 | var _GameActor_initMembers = Game_Actor.prototype.initMembers; 60 | Game_Actor.prototype.initMembers = function() { 61 | _GameActor_initMembers.call(this); 62 | Game_Battler.prototype.initMembers.call(this); 63 | this._skillUsedTimes = {}; 64 | this._levelingSkillNeeds = []; 65 | }; 66 | 67 | var _GameActor_learnSkill = Game_Actor.prototype.learnSkill; 68 | Game_Actor.prototype.learnSkill = function(skillId) { 69 | if (!this.isLearnedSkill(skillId) && $dataSkills[skillId].meta.LevelUpTo) 70 | { 71 | this.grabSkillLevelingData(skillId); 72 | this._skillUsedTimes[skillId] = 0; 73 | } 74 | _GameActor_learnSkill.call(this, skillId); 75 | }; 76 | 77 | Game_Actor.prototype.grabSkillLevelingData = function(skillId) { 78 | var lines = $dataSkills[skillId].note.split(/[\r\n]/); 79 | var skillLearnObj = {result: 0, required: [], completed: false}; 80 | var regex1 = //i; 81 | var regex2 = //i; 82 | for (var i = 0; i < lines.length; i++) { 83 | var regex1Match = regex1.exec(lines[i]); 84 | if (regex1Match) 85 | { 86 | var goal = Number(regex1Match[1]); 87 | var reqId = skillId; 88 | var uses = Number(regex1Match[2]); 89 | var remove = regex1Match[3] ? regex1Match[3] === "1" : true; 90 | skillLearnObj.result = goal; 91 | skillLearnObj.required.push({id: reqId, uses: uses, remove: remove}); 92 | continue; 93 | } 94 | 95 | var regex2Match = regex2.exec(lines[i]); 96 | if (regex2Match) 97 | { 98 | var reqId = Number(regex2Match[1]); 99 | var uses = Number(regex2Match[2]); 100 | var remove = regex2Match[3] ? regex2Match[3] === "1" : true; 101 | skillLearnObj.required.push({id: reqId, uses: uses, remove: remove}); 102 | continue; 103 | } 104 | } 105 | this._levelingSkillNeeds.push(skillLearnObj); 106 | }; 107 | 108 | Game_Actor.prototype.checkSkillLevelUps = function() { 109 | for (var i = 0; i < this._levelingSkillNeeds.length; i++) { 110 | var skill = this._levelingSkillNeeds[i]; 111 | if (skill.completed) continue; 112 | var allDone = true; 113 | for (var j = 0; j < skill.required.length; j++) { 114 | var req = skill.required[j]; 115 | if (!this._skillUsedTimes[req.id]) allDone = false; 116 | if (this._skillUsedTimes[req.id] < req.uses) allDone = false; 117 | if (!allDone) break; 118 | } 119 | if (allDone) 120 | { 121 | this.learnSkill(skill.result); 122 | this._levelingSkillNeeds[i].completed = true; 123 | for (var j = 0; j < skill.required.length; j++) { 124 | if(skill.required[j].remove) this.forgetSkill(skill.required[j].id); 125 | } 126 | } 127 | } 128 | }; 129 | 130 | Game_Actor.prototype.increaseSkillUsage = function(skill) { 131 | if (!this._skillUsedTimes[skill.id]) this._skillUsedTimes[skill.id] = 0; 132 | this._skillUsedTimes[skill.id]++; 133 | this.checkSkillLevelUps(); 134 | }; 135 | 136 | var _Game_Actor_useItem = Game_Actor.prototype.useItem; 137 | Game_Actor.prototype.useItem = function(item) { 138 | _Game_Actor_useItem.call(this, item); 139 | if (DataManager.isSkill(item)) 140 | { 141 | this.increaseSkillUsage(item); 142 | } 143 | }; 144 | })(); 145 | -------------------------------------------------------------------------------- /MrTS_GlobalSavesData.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_GlobalSavesData.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows player to set and change variables that affect all saves. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Plugin Commands 22 | * -------------------------------------------------------------------------------- 23 | * GlobalVar Set [NAME] [VALUE] - Sets variable to [VALUE] 24 | * GlobalVar Add [NAME] [VALUE] - Adds [VALUE] to variable 25 | * GlobalVar Sub [NAME] [VALUE] - Subtracts [VALUE] from value 26 | * 27 | * [NAME] - Variable name, case sensitive 28 | * [VALUE] - Value of variable a number or true/false 29 | * 30 | * Examples: 31 | * GlobalVar Set Glasses true 32 | * 33 | * GlobalVar Set GameCompleted 1 34 | * GlobalVar Add GameCompleted 1 35 | * GlobalVar Sub GameCompleted 2 36 | * -------------------------------------------------------------------------------- 37 | * 38 | * -------------------------------------------------------------------------------- 39 | * Script Calls - for use in switches, variables, branches and script calls 40 | * -------------------------------------------------------------------------------- 41 | * DataManager.getGlobalVar(NAME) - returns global variable of NAME 42 | * 43 | * Example: 44 | * DataManager.getGlobalVar(Glasses) 45 | * -------------------------------------------------------------------------------- 46 | * 47 | * -------------------------------------------------------------------------------- 48 | * Version History 49 | * -------------------------------------------------------------------------------- 50 | * 1.0 - Release 51 | */ 52 | 53 | (function() { 54 | 55 | //-------------------------------------------------------------------------- 56 | // Game_Interpreter 57 | // 58 | 59 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 60 | Game_Interpreter.prototype.pluginCommand = function(command, args) { 61 | _Game_Interpreter_pluginCommand.call(this, command, args); 62 | if (command.toLowerCase() === "globalvar") { 63 | switch (args[0].toUpperCase()) 64 | { 65 | case 'SET': 66 | { 67 | DataManager.setGlobalVar(args[1], eval(args[2])) 68 | } break; 69 | case 'ADD': 70 | { 71 | DataManager.addGlobalVar(args[1], Number(args[2])) 72 | } break; 73 | case 'SUB': 74 | { 75 | DataManager.setGlobalVar(args[1], Number(args[2])) 76 | } break; 77 | 78 | } 79 | } 80 | }; 81 | 82 | //-------------------------------------------------------------------------- 83 | // StorageManager 84 | // 85 | 86 | var _StorageManager_localFilePath = StorageManager.localFilePath; 87 | StorageManager.localFilePath = function(key) { 88 | if (key === 'globalsavedata') return this.localFileDirectoryPath() + 'globalSaveData.rpgsave'; 89 | else return _StorageManager_localFilePath.call(this, key); 90 | }; 91 | 92 | var _StorageManager_webStorageKey = StorageManager.webStorageKey; 93 | StorageManager.webStorageKey = function(key) { 94 | if (key === 'globalsavedata') return 'RPG GlobalSaveData'; 95 | else return _StorageManager_webStorageKey.call(this, key); 96 | }; 97 | 98 | //-------------------------------------------------------------------------- 99 | // DataManager 100 | // 101 | 102 | var _DataManager_loadGameWithoutRescue = DataManager.loadGameWithoutRescue; 103 | DataManager.loadGameWithoutRescue = function(savefileId) { 104 | var success = _DataManager_loadGameWithoutRescue.call(this, savefileId); 105 | if (success) this._globalSaveData = this.loadGlobalSaveData(); 106 | return success; 107 | }; 108 | 109 | var _DataManager_setupNewgame = DataManager.setupNewGame; 110 | DataManager.setupNewGame = function() { 111 | _DataManager_setupNewgame.call(this); 112 | this._globalSaveData = this.loadGlobalSaveData(); 113 | }; 114 | 115 | DataManager.setGlobalVar = function(name, value) { 116 | this._globalSaveData[name] = value; 117 | }; 118 | 119 | DataManager.addGlobalVar = function(name, value) { 120 | if (!this._globalSaveData[name]) this._globalSaveData[name] = 0; 121 | this._globalSaveData[name] += value; 122 | }; 123 | 124 | DataManager.subGlobalVar = function(name, value) { 125 | this.addGlobalVar(name, -value); 126 | }; 127 | 128 | DataManager.getGlobalVar = function(name) { 129 | if (!this._globalSaveData[name]) this._globalSaveData[name] = 0; 130 | return this._globalSaveData[name]; 131 | }; 132 | 133 | DataManager.loadGlobalSaveData = function() { 134 | var data = StorageManager.load('globalsavedata'); 135 | if (data) 136 | { 137 | return JsonEx.parse(data); 138 | } 139 | else return {}; 140 | }; 141 | 142 | var _DataManager_saveGameWithoutRescue = DataManager.saveGameWithoutRescue; 143 | DataManager.saveGameWithoutRescue = function(savefileId) { 144 | var saved = _DataManager_saveGameWithoutRescue.call(this, savefileId); 145 | if (saved) { 146 | this.saveGlobalSaveData(this._globalSaveData); 147 | } 148 | return saved; 149 | }; 150 | 151 | DataManager.saveGlobalSaveData = function(data) { 152 | StorageManager.save('globalsavedata', JSON.stringify(data)); 153 | }; 154 | })(); 155 | -------------------------------------------------------------------------------- /MrTS_EmergeAnimations.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_EmergeAnimations.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Makes enemies emerge with animation playing into battle. 7 | * @author Mr. Trivel 8 | * 9 | * @param Appear Type 10 | * @desc In order by one or all at the same time? -- Order/Together 11 | * Default: Order 12 | * @default Order 13 | * 14 | * @help 15 | * -------------------------------------------------------------------------------- 16 | * Terms of Use 17 | * -------------------------------------------------------------------------------- 18 | * Don't remove the header or claim that you wrote this plugin. 19 | * Credit Mr. Trivel if using this plugin in your project. 20 | * Free for commercial and non-commercial projects. 21 | * -------------------------------------------------------------------------------- 22 | * Version 1.0 23 | * -------------------------------------------------------------------------------- 24 | * 25 | * -------------------------------------------------------------------------------- 26 | * Enemy Tags 27 | * -------------------------------------------------------------------------------- 28 | * Use the following in enemy note fields: 29 | * 30 | * [Animation ID] being ID of animation enemy uses before appearing. 31 | * [Visible Frame] From which animation frame enemy becomes visible. 32 | * 33 | * In case of multiple animations listed in the same note field, random one will 34 | * be picked. 35 | * 36 | * Example: 37 | * 38 | * -------------------------------------------------------------------------------- 39 | * 40 | * -------------------------------------------------------------------------------- 41 | * Version History 42 | * -------------------------------------------------------------------------------- 43 | * 1.0 - Release 44 | */ 45 | 46 | (function() { 47 | var parameters = PluginManager.parameters('MrTS_EmergeAnimations'); 48 | var paramAppear = String(parameters['Appear Type'] || "Order").toLowerCase(); 49 | 50 | var _GameEnemy_setup = Game_Enemy.prototype.setup; 51 | Game_Enemy.prototype.setup = function(enemyId, x, y) { 52 | _GameEnemy_setup.call(this, enemyId, x, y); 53 | this._emergeAnimationList = this.parseEmergeAnimations(this.enemy().note); 54 | }; 55 | 56 | Game_Enemy.prototype.parseEmergeAnimations = function(note) { 57 | var results = []; 58 | if (!this.enemy().meta.AppearAnimation) return results; 59 | 60 | var lines = note.split(/[\r\n]/); 61 | var regex = //i; 62 | 63 | for (var i = 0; i < lines.length; i++) { 64 | var regexMatch = regex.exec(lines[i]); 65 | if (regexMatch) 66 | results.push([Number(regexMatch[1]), Number(regexMatch[2])]); 67 | } 68 | 69 | return results; 70 | 71 | }; 72 | 73 | Game_Enemy.prototype.hasAppear = function() { 74 | return this._emergeAnimationList.length > 0; 75 | }; 76 | 77 | var _GameEnemy_appear = Game_BattlerBase.prototype.appear; 78 | Game_BattlerBase.prototype.appear = function() { 79 | _GameEnemy_appear.call(this); 80 | $gameTemp.appeared = false; 81 | }; 82 | 83 | Game_Enemy.prototype.startAppearAnimation = function(anim) { 84 | this._appearAnim = anim; 85 | this.startAnimation(anim[0], false, 0); 86 | }; 87 | 88 | var _SceneBattle_update = Scene_Battle.prototype.update; 89 | Scene_Battle.prototype.update = function() { 90 | _SceneBattle_update.call(this); 91 | var active = this.isActive(); 92 | if (active && !this.isBusy()) 93 | { 94 | if (!$gameTemp.appeared) { 95 | for (var i = 0; i < $gameTroop.members().length; i++) { 96 | if ($gameTroop.members()[i].isHidden()) continue; 97 | if (!$gameTroop.members()[i].hasAppear()) continue; 98 | if (this._appeared[i]) continue; 99 | 100 | var list = $gameTroop.members()[i]._emergeAnimationList; 101 | var rndAnim = list[Math.randomInt(list.length)]; 102 | $gameTroop.members()[i].startAppearAnimation(rndAnim); 103 | this._appeared[i] = true; 104 | BattleManager._logWindow.setWaitMode('animation'); 105 | if (paramAppear === "order") break; 106 | } 107 | $gameTemp.appeared = true; 108 | } else { 109 | 110 | } 111 | } 112 | }; 113 | 114 | var _SceneBattle_start = Scene_Battle.prototype.start; 115 | Scene_Battle.prototype.start = function() { 116 | _SceneBattle_start.call(this); 117 | this._appeared = []; 118 | $gameTemp.appeared = false; 119 | for (var i = 0; i < $gameTroop.members().length; i++) { 120 | if ($gameTroop.members()[i].hasAppear()) this._appeared.push(false); 121 | } 122 | }; 123 | 124 | var _SpriteEnemy_updateVisibility = Sprite_Enemy.prototype.updateVisibility; 125 | Sprite_Enemy.prototype.updateVisibility = function() { 126 | _SpriteEnemy_updateVisibility.call(this); 127 | if (this._enemy._appearAnim && this._animationSprites.length > 0) 128 | { 129 | for (var i = 0; i < this._animationSprites.length; i++) { 130 | if (this._animationSprites[i].currentFrameIndex() >= this._enemy._appearAnim[1]) 131 | { 132 | this.startEffect('appear'); 133 | this._enemy._appearAnim = null; 134 | $gameTemp.appeared = false; 135 | } 136 | } 137 | } 138 | }; 139 | 140 | var _SpriteEnemy_initVisibility = Sprite_Enemy.prototype.initVisibility; 141 | Sprite_Enemy.prototype.initVisibility = function() { 142 | _SpriteEnemy_initVisibility.call(this); 143 | if (this._enemy.hasAppear()) this.opacity = 0; 144 | }; 145 | 146 | var _SpriteEnemy_setupEffect = Sprite_Enemy.prototype.setupEffect; 147 | Sprite_Enemy.prototype.setupEffect = function() { 148 | if (!this._appeared && this._enemy.isAlive() && this._enemy.hasAppear()) { 149 | this._appeared = true; 150 | } 151 | _SpriteEnemy_setupEffect.call(this); 152 | }; 153 | })(); 154 | -------------------------------------------------------------------------------- /MrTS_DamageEfficiency.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_DamageEfficiency.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Adds notetags that allow battlers to deal more damage with skills depending on their efficiency. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Trait Object Note Tags (Actor, Class, Enemy, State, Armor, Weapon) 22 | * -------------------------------------------------------------------------------- 23 | * 24 | * 25 | * 26 | * 27 | * [PERCENT]: 0.01 - 1%, 0.5 - 50%, -0.25 - -25% 28 | * 29 | * Weapon Efficiency - battlers deal more damage while wielding that weapon type. 30 | * Element Efficiency - battlers deal more damage with skills of that element. 31 | * Skill Type Efficiency - battlers deal more damage with skills of that type. 32 | * Overall Efficiency - battlers just deal more damage 33 | * 34 | * Examples: 35 | * 36 | * 37 | * 38 | * 39 | * -------------------------------------------------------------------------------- 40 | * 41 | * -------------------------------------------------------------------------------- 42 | * Skill/Item Note Tags 43 | * -------------------------------------------------------------------------------- 44 | * By default all skills are affected by efficiency. For some skill/item to ignore 45 | * effiency bonus use the following note tags: 46 | * 47 | * 48 | * 49 | * 50 | * 51 | * 52 | * Examples: 53 | * 54 | * -------------------------------------------------------------------------------- 55 | * 56 | * -------------------------------------------------------------------------------- 57 | * Version History 58 | * -------------------------------------------------------------------------------- 59 | * 1.0 - Release 60 | */ 61 | 62 | (function() { 63 | Game_BattlerBase.prototype.getWeaponEfficiency = function(id) { 64 | var to = this.traitObjects(); 65 | var eff = 0.0; 66 | for (var i = 0; i < to.length; i++) { 67 | if (to[i].meta.WeaponEfficiency) { 68 | var val = to[i].meta.WeaponEfficiency.split(','); 69 | if (Number(val[0]) === id) { 70 | eff += Number(val[1]); 71 | } 72 | } 73 | } 74 | return eff; 75 | }; 76 | 77 | Game_BattlerBase.prototype.getElementEfficiency = function(id) { 78 | var to = this.traitObjects(); 79 | var eff = 0.0; 80 | for (var i = 0; i < to.length; i++) { 81 | if (to[i].meta.ElementEfficiency) { 82 | var val = to[i].meta.ElementEfficiency.split(','); 83 | if (Number(val[0]) === id) { 84 | eff += Number(val[1]); 85 | } 86 | } 87 | } 88 | return eff; 89 | }; 90 | 91 | Game_BattlerBase.prototype.getSkillTypeEfficiency = function(id) { 92 | var to = this.traitObjects(); 93 | var eff = 0.0; 94 | for (var i = 0; i < to.length; i++) { 95 | if (to[i].meta.SkillTypeEfficiency) { 96 | var val = to[i].meta.SkillTypeEfficiency.split(','); 97 | if (Number(val[0]) === id) { 98 | eff += Number(val[1]); 99 | } 100 | } 101 | } 102 | return eff; 103 | }; 104 | 105 | Game_BattlerBase.prototype.getOverallEfficiency = function() { 106 | var to = this.traitObjects(); 107 | var eff = 0.0; 108 | for (var i = 0; i < to.length; i++) { 109 | if (to[i].meta.OverallEfficiency) { 110 | eff += Number(to[i].meta.OverallEfficiency); 111 | } 112 | } 113 | return eff; 114 | }; 115 | 116 | var _Game_Action_applyVariance = Game_Action.prototype.applyVariance; 117 | Game_Action.prototype.applyVariance = function(damage, variance) { 118 | var value = damage; 119 | 120 | var item = this.item(); 121 | var a = this.subject(); 122 | 123 | if (!item.meta.IgnoreAllBonuses) 124 | { 125 | var ignoreWeaponBonus = false; 126 | if (item.meta.IgnoreWeaponBonus && a.isActor()) { 127 | var arr = item.meta.IgnoreWeaponBonus.split(','); 128 | for (var i = 0; i < arr.length; i++) { 129 | if (a.weapons()[0] && a.weapons()[0].wtypeId === Number(arr[i])) { 130 | ignoreWeaponBonus = true; 131 | break; 132 | } 133 | } 134 | } 135 | 136 | if (!ignoreWeaponBonus && a.isActor() && a.weapons()[0]) { 137 | var wb = 1 + a.getWeaponEfficiency(a.weapons()[0].wtypeId); 138 | if (wb < 0) wb = 0; 139 | value *= wb; 140 | } 141 | 142 | if (!item.meta.IgnoreElementBonus) { 143 | var eb = 1 + a.getElementEfficiency(item.damage.elementId); 144 | if (eb < 0) eb = 0; 145 | value *= eb; 146 | } 147 | 148 | if (!item.meta.IgnoreSkillTypeBonus && item.stypeId) { 149 | var stb = 1 + a.getSkillTypeEfficiency(item.stypeId); 150 | if (stb < 0) stb = 0; 151 | value *= stb; 152 | } 153 | 154 | if (!item.meta.IgnoreOverallBonus) { 155 | var ob = 1 + a.getOverallEfficiency(); 156 | if (ob < 0) ob = 0; 157 | value *= ob; 158 | } 159 | } 160 | 161 | return _Game_Action_applyVariance.call(this, value, variance); 162 | }; 163 | })(); 164 | -------------------------------------------------------------------------------- /MrTS_MaxLevelRestriction.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_MaxLevelRestriction.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows restricting and lifting actor, class and global max level. 7 | * @author Mr. Trivel 8 | * 9 | * @help 10 | * -------------------------------------------------------------------------------- 11 | * Terms of Use 12 | * -------------------------------------------------------------------------------- 13 | * Don't remove the header or claim that you wrote this plugin. 14 | * Credit Mr. Trivel if using this plugin in your project. 15 | * Free for commercial and non-commercial projects. 16 | * -------------------------------------------------------------------------------- 17 | * Version 1.0 18 | * -------------------------------------------------------------------------------- 19 | * 20 | * -------------------------------------------------------------------------------- 21 | * Plugin Commands 22 | * -------------------------------------------------------------------------------- 23 | * MaxLevel GlobalSet [LEVEL] - sets global max level restriction to [LEVEL] 24 | * MaxLevel GlobalLift - removes global max level restriction 25 | * 26 | * MaxLevel ActorSet [LEVEL] [ID] - sets max level restriction to [ID] of actor 27 | * MaxLevel ActorLift [ID] - removes actor max level restriction 28 | * 29 | * MaxLevel ClassSet [LEVEL] [ID] - sets max level restriction to [ID] of class 30 | * MaxLevel ClassLift [ID] - removes class max level restriction 31 | * 32 | * [LEVEL] - what is the new max level 33 | * [ID] - actor or class ID 34 | * 35 | * Examples: 36 | * MaxLevel GlobalSet 10 37 | * MaxLevel GlobalLift 38 | * 39 | * Maxlevel ActorSet 20 5 40 | * Maxlevel ActorLift 41 | * 42 | * MaxLevel ClassSet 30 7 43 | * Maxlevel ClassLift 44 | * 45 | * Priority: 46 | * In case of multiple restrictions (default, global, actor, class) the lowest 47 | * value one will be used. 48 | * -------------------------------------------------------------------------------- 49 | * 50 | * -------------------------------------------------------------------------------- 51 | * Version History 52 | * -------------------------------------------------------------------------------- 53 | * 1.0 - Release 54 | */ 55 | 56 | (function() { 57 | //-------------------------------------------------------------------------- 58 | // Game_Interpreter 59 | // 60 | 61 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 62 | Game_Interpreter.prototype.pluginCommand = function(command, args) { 63 | _Game_Interpreter_pluginCommand.call(this, command, args); 64 | if (command.toLowerCase() === "maxlevel") { 65 | switch (args[0].toUpperCase()) 66 | { 67 | case 'GLOBALSET': 68 | { 69 | $gameSystem.setGlobalMaxLevelRestriction(Number(args[1])); 70 | } break; 71 | case 'GLOBALLIFT': 72 | { 73 | $gameSystem.liftGlobalMaxLevelRestriction(); 74 | } break; 75 | case 'ACTORSET': 76 | { 77 | $gameSystem.setActorMaxLevelRestriction(Number(args[1]), Number(args[2])); 78 | } break; 79 | case 'ACTORLIFT': 80 | { 81 | $gameSystem.liftActorMaxLevelRestriction(Number(args[1])); 82 | } break; 83 | case 'CLASSSET': 84 | { 85 | $gameSystem.setClassMaxLevelRestriction(Number(args[1]), Number(args[2])); 86 | } break; 87 | case 'CLASSLIFT': 88 | { 89 | $gameSystem.liftClassMaxLevelRestriction(Number(args[1])); 90 | } break; 91 | 92 | } 93 | } 94 | }; 95 | 96 | //-------------------------------------------------------------------------- 97 | // Game_System 98 | // 99 | 100 | var _Game_System_initialize = Game_System.prototype.initialize; 101 | Game_System.prototype.initialize = function() { 102 | _Game_System_initialize.call(this); 103 | this._maxLevelRestrictGlobal = -1; 104 | this._maxLevelRestrictActor = {}; 105 | this._maxLevelRestrictClass = {}; 106 | }; 107 | 108 | Game_System.prototype.setGlobalMaxLevelRestriction = function(value) { 109 | this._maxLevelRestrictGlobal = value; 110 | }; 111 | 112 | Game_System.prototype.liftGlobalMaxLevelRestriction = function() { 113 | this._maxLevelRestrictGlobal = -1; 114 | }; 115 | 116 | Game_System.prototype.setActorMaxLevelRestriction = function(value, id) { 117 | this._maxLevelRestrictActor[id] = value; 118 | }; 119 | 120 | Game_System.prototype.liftActorMaxLevelRestriction = function(id) { 121 | delete this._maxLevelRestrictActor[id]; 122 | }; 123 | 124 | Game_System.prototype.setClassMaxLevelRestriction = function(value, id) { 125 | this._maxLevelRestrictClass[id] = value; 126 | }; 127 | 128 | Game_System.prototype.liftClassMaxLevelRestriction = function(id) { 129 | delete this._maxLevelRestrictClass[id]; 130 | }; 131 | 132 | Game_System.prototype.getGlobalMaxLevelRestriction = function() { 133 | return this._maxLevelRestrictGlobal; 134 | }; 135 | 136 | Game_System.prototype.getActorMaxLevelRestriction = function(id) { 137 | return this._maxLevelRestrictActor[id]; 138 | }; 139 | 140 | Game_System.prototype.getClassMaxLevelRestriction = function(id) { 141 | return this._maxLevelRestrictClass[id]; 142 | }; 143 | 144 | //-------------------------------------------------------------------------- 145 | // Game_Actor 146 | // 147 | 148 | var _Game_Actor_maxlevel = Game_Actor.prototype.maxLevel; 149 | Game_Actor.prototype.maxLevel = function() { 150 | var aId = this.actorId(); 151 | var cId = this._classId; 152 | var levelArray = []; 153 | 154 | var defaultLimit = _Game_Actor_maxlevel.call(this); 155 | var globalLimit = $gameSystem.getGlobalMaxLevelRestriction(); 156 | var actorLimit = $gameSystem.getActorMaxLevelRestriction(aId); 157 | var classLimit = $gameSystem.getClassMaxLevelRestriction(cId); 158 | 159 | levelArray.push(defaultLimit); 160 | if (globalLimit > -1) levelArray.push(globalLimit); 161 | if (actorLimit) levelArray.push(actorLimit); 162 | if (classLimit) levelArray.push(classLimit); 163 | return Math.min.apply(null, levelArray); 164 | }; 165 | })(); 166 | -------------------------------------------------------------------------------- /MrTS_SimpleMercenaries.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SimpleMercenaries.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Allows mercenary recruiting. They join for X batles. 7 | * @author Mr. Trivel 8 | * 9 | * @param Reduce Timer On Escape 10 | * @desc Should the timer be reduced for mercenaries when escaping? 11 | * (true/false) Default: false 12 | * @default false 13 | * 14 | * @help 15 | * -------------------------------------------------------------------------------- 16 | * Terms of Use 17 | * -------------------------------------------------------------------------------- 18 | * Don't remove the header or claim that you wrote this plugin. 19 | * Credit Mr. Trivel if using this plugin in your project. 20 | * Free for commercial and non-commercial projects. 21 | * -------------------------------------------------------------------------------- 22 | * Version 1.0 23 | * -------------------------------------------------------------------------------- 24 | ** 25 | * -------------------------------------------------------------------------------- 26 | * Actor Tags 27 | * -------------------------------------------------------------------------------- 28 | * To set up quicksand regions, use the following setup in Map Note Field: 29 | * 30 | * [J_CE] - common event to play when mercenary is recruited 31 | * [L_CE] - common event to play when mercenary leaves 32 | * [LD_CE]- common event to play when mercenary leaves after death (if enabled) 33 | * Set argument to 0 if you don't want Common Event to play. 34 | * 35 | * -------------------------------------------------------------------------------- 36 | * Plugin Commands 37 | * -------------------------------------------------------------------------------- 38 | * Mercenary Add [ID] [BATTLES_COUNT] [LEAVES_ON_DEATH?] 39 | * Mercenary Remove [ID] 40 | * 41 | * [ID] - Actor ID 42 | * [BATTLES_COUNT] - For how many battles will mercenary join 43 | * [LEAVES_ON_DEATH] - true/false - will he leave on death? 44 | * -------------------------------------------------------------------------------- 45 | * Version History 46 | * -------------------------------------------------------------------------------- 47 | * 1.0 - Release 48 | */ 49 | 50 | (function() { 51 | 52 | var parameters = PluginManager.parameters('MrTS_SimpleMercenaries'); 53 | var prmTimer = parameters['Reduce Timer On Escape']; 54 | var paramTimer = (prmTimer && (prmTimer.toLowerCase()) === "true") || false; 55 | 56 | //-------------------------------------------------------------------------- 57 | // Game_Interpreter 58 | // 59 | 60 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 61 | Game_Interpreter.prototype.pluginCommand = function(command, args) { 62 | _Game_Interpreter_pluginCommand.call(this, command, args); 63 | if (command.toUpperCase() === 'MERCENARY') { 64 | switch(args[0].toUpperCase()) 65 | { 66 | case 'ADD': 67 | { 68 | $gameParty.addMercenary(Number(args[1]), Number(args[2]), args[3].toLowerCase() === "true"); 69 | } break; 70 | case 'REMOVE': 71 | { 72 | $gameParty.removeMercenary(Number(args[1])); 73 | } break; 74 | } 75 | } 76 | }; 77 | 78 | //-------------------------------------------------------------------------- 79 | // Game_Actor 80 | // 81 | 82 | var _GameActor_setup = Game_Actor.prototype.setup; 83 | Game_Actor.prototype.setup = function(actorId) { 84 | _GameActor_setup.call(this, actorId); 85 | if (this.actor().meta.Mercenary) 86 | { 87 | var data = this.actor().meta.Mercenary.split(","); 88 | this._mercJoinCE = Number(data[0]); 89 | this._mercLeaveCE = Number(data[1]); 90 | this._mercDeathCE = Number(data[2]); 91 | } 92 | this._isMercenary = false; 93 | this._mercTimer = 0; 94 | this._mercLeaveOnDeath = false; 95 | }; 96 | 97 | Game_Actor.prototype.setMercenary = function(turns) { 98 | this._isMercenary = true; 99 | this._mercTimer = turns; 100 | }; 101 | 102 | //-------------------------------------------------------------------------- 103 | // Game_Party 104 | // 105 | 106 | Game_Party.prototype.reduceMercTimer = function() { 107 | for (var i = 0; i < this.battleMembers().length; i++) { 108 | if (this.battleMembers()[i]._isMercenary) 109 | { 110 | this.battleMembers()[i]._mercTimer--; 111 | if (this.battleMembers()[i]._mercTimer <= 0) 112 | this.removeMercenary(this.battleMembers()[i].actorId()); 113 | } 114 | 115 | }; 116 | }; 117 | 118 | Game_Party.prototype.removeMercenary = function(id, leaveEvent) { 119 | var leaveEvent = leaveEvent || true; 120 | var actor = $gameActors.actor(id); 121 | actor._isMercenary = false; 122 | 123 | if (leaveEvent && actor._mercLeaveCE > 0) 124 | $gameTemp.reserveCommonEvent(actor._mercLeaveCE); 125 | this.removeActor(id); 126 | }; 127 | 128 | Game_Party.prototype.addMercenary = function(id, battles, leavesOnDeath) { 129 | var actor = $gameActors.actor(id); 130 | actor._isMercenary = true; 131 | actor._mercTimer = battles; 132 | actor._mercLeaveOnDeath = leavesOnDeath; 133 | this.addActor(id); 134 | if (actor._mercJoinCE > 0) 135 | { 136 | $gameTemp.reserveCommonEvent(actor._mercJoinCE); 137 | } 138 | }; 139 | 140 | Game_Party.prototype.checkForDeadMercs = function() { 141 | for (var i = 0; i < this.battleMembers().length; i++) { 142 | if (this.battleMembers()[i]._isMercenary && this.battleMembers()[i].isDead()) 143 | { 144 | if (this.battleMembers()[i]._mercLeaveOnDeath) 145 | { 146 | if (this.battleMembers()[i]._mercDeathCE > 0) 147 | $gameTemp.reserveCommonEvent(this.battleMembers()[i]._mercDeathCE); 148 | this.removeMercenary(this.battleMembers()[i].actorId(), false) 149 | } 150 | } 151 | }; 152 | }; 153 | 154 | //-------------------------------------------------------------------------- 155 | // BattleManager 156 | // 157 | 158 | var _BattleManager_endBattle = BattleManager.endBattle; 159 | BattleManager.endBattle = function(result) { 160 | if ((result === 1 && paramTimer) || result !== 1) 161 | $gameParty.reduceMercTimer(); 162 | 163 | _BattleManager_endBattle.call(this, result); 164 | }; 165 | 166 | var _BattleManager_endAction = BattleManager.endAction; 167 | BattleManager.endAction = function() { 168 | _BattleManager_endAction.call(this); 169 | $gameParty.checkForDeadMercs(); 170 | }; 171 | })(); 172 | -------------------------------------------------------------------------------- /MrTS_StatesEX.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_StatesEX.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Adds more functionality to States. 7 | * @author Mr. Trivel 8 | * 9 | * @param State Stack Color 10 | * @desc HEX code for state stacks 11 | * @default #e6cc80 12 | * 13 | * @help This plugin does not provide plugin commands. 14 | * Version 1.0 15 | * Free for non-commercial use only. 16 | * 17 | * Use the following tag in State note fields: 18 | * 19 | * - X how many stacks needed, Y - to which state to transform 20 | * 21 | * - X being number of times state can stack. 22 | * --- 23 | * 24 | * Requires to use: 25 | * - Inflict X stacks of the state, instead of 1 26 | * - Inflict between X and Y stacks of the state 27 | * --- 28 | */ 29 | 30 | (function() { 31 | var parameters = PluginManager.parameters('MrTS_StatesEX'); 32 | 33 | var stateCountColor = String(parameters['State Stack Color'] || "#e6cc80"); 34 | 35 | var _Game_BattlerBase_clearStates = Game_BattlerBase.prototype.clearStates; 36 | 37 | Game_BattlerBase.prototype.clearStates = function() { 38 | _Game_BattlerBase_clearStates.call(this); 39 | this._stateTurnsEx = {}; 40 | }; 41 | 42 | Game_Battler.prototype.addState = function(stateId) { 43 | if (this.isStateAddable(stateId)) { 44 | var maxStacks = $dataStates[stateId].meta.max_stacks; 45 | if (maxStacks) 46 | { 47 | var inflict_stacks = $dataStates[stateId].meta.inflict_stacks || 1; 48 | if ($dataStates[stateId].meta.inflict_random_stacks) 49 | { 50 | var rand_stacks_arr = $dataStates[stateId].meta.inflict_random_stacks.split(','); 51 | rand_stacks_arr[0] = Number(rand_stacks_arr[0]); 52 | rand_stacks_arr[1] = Number(rand_stacks_arr[1]); 53 | inflict_stacks = Math.floor(Math.random() * (rand_stacks_arr[1] - rand_stacks_arr[0] + 1) + rand_stacks_arr[0]); 54 | } 55 | 56 | for (var i = 0; i < inflict_stacks; i++) 57 | { 58 | if (this.getStateCount(stateId) < maxStacks) 59 | { 60 | this.addNewState(stateId); 61 | this.refresh(); 62 | this.addStateCountsEx(stateId); 63 | var trs_at_stacks = $dataStates[stateId].meta.trs_at_stacks; 64 | if (trs_at_stacks) 65 | { 66 | var trs_vals = $dataStates[stateId].meta.trs_at_stacks.split(','); 67 | if (this.getStateCount(stateId) >= Number(trs_vals[0])) 68 | { 69 | for (var j = 0; j < Number(trs_vals[0]); j++) 70 | this.eraseState(stateId); 71 | 72 | this.addState(Number(trs_vals[1])); 73 | } 74 | } 75 | } 76 | } 77 | } 78 | else if (!this.isStateAffected(stateId)) { 79 | this.addNewState(stateId); 80 | this.refresh(); 81 | this.resetStateCounts(stateId); 82 | } 83 | 84 | this._result.pushAddedState(stateId); 85 | } 86 | }; 87 | 88 | Game_BattlerBase.prototype.addStateCountsEx = function(stateId) 89 | { 90 | var state = $dataStates[stateId]; 91 | var variance = 1 + Math.max(state.maxTurns - state.minTurns, 0); 92 | if (!this._stateTurnsEx[stateId]) this._stateTurnsEx[stateId] = []; 93 | this._stateTurnsEx[stateId].push(state.minTurns + Math.randomInt(variance)); 94 | } 95 | 96 | var _Game_BattlerBase_isStateExpired = Game_BattlerBase.prototype.isStateExpired; 97 | Game_BattlerBase.prototype.isStateExpired = function(stateId) { 98 | return (!$dataStates[stateId].meta.max_stacks ? _Game_BattlerBase_isStateExpired.call(this, stateId) : this._stateTurnsEx[stateId].contains(0)); 99 | }; 100 | 101 | var _Game_BattlerBase_updateStateTurns = Game_BattlerBase.prototype.updateStateTurns; 102 | Game_BattlerBase.prototype.updateStateTurns = function() { 103 | _Game_BattlerBase_updateStateTurns.call(this); 104 | this.uniqueStates().forEach(function(s) { 105 | if (this._stateTurnsEx[s.id] && this._stateTurnsEx[s.id].length > 0) { 106 | for (var i = 0; i < this._stateTurnsEx[s.id].length; i++) 107 | this._stateTurnsEx[s.id][i]--; 108 | } 109 | }, this); 110 | }; 111 | 112 | var _Game_BattlerBase_eraseState = Game_BattlerBase.prototype.eraseState; 113 | Game_BattlerBase.prototype.eraseState = function(stateId) { 114 | if ($dataStates[stateId].meta.max_stacks) 115 | { 116 | this._stateTurnsEx[stateId].splice(0, 1); 117 | } 118 | _Game_BattlerBase_eraseState.call(this, stateId); 119 | }; 120 | 121 | Game_Battler.prototype.getStateCount = function(stateId) { 122 | var count = 0; 123 | this._states.forEach(function(sId) { 124 | if (sId === stateId) count++; 125 | }); 126 | return count; 127 | }; 128 | 129 | Game_BattlerBase.prototype.uniqueStates = function() { 130 | var arr = this.states(); 131 | var newArr = []; 132 | arr.forEach(function(s){ 133 | if (!newArr.contains(s)) newArr.push(s); 134 | }); 135 | return newArr; 136 | }; 137 | 138 | Game_BattlerBase.prototype.uniqueStateIcons = function() { 139 | return this.uniqueStates().map(function(state) { 140 | return state.iconIndex; 141 | }).filter(function(iconIndex) { 142 | return iconIndex > 0; 143 | }); 144 | }; 145 | 146 | Game_BattlerBase.prototype.allUniqueIcons = function() { 147 | return this.uniqueStateIcons().concat(this.buffIcons()); 148 | }; 149 | 150 | Window_Base.prototype.drawActorIcons = function(actor, x, y, width) { 151 | width = width || 144; 152 | var states = actor.uniqueStates(); 153 | var icons = actor.allUniqueIcons().slice(0, Math.floor(width / Window_Base._iconWidth)); 154 | for (var i = 0; i < icons.length; i++) { 155 | this.drawIcon(icons[i], x + Window_Base._iconWidth * i, y + 2); 156 | if (i < states.length) 157 | { 158 | var count = actor.getStateCount(states[i].id); 159 | if (count > 1) 160 | { 161 | var lastFontSize = this.contents.fontSize; 162 | this.contents.fontSize -= 12; 163 | this.changeTextColor(stateCountColor); 164 | this.drawText(count, x + Window_Base._iconWidth * i, y + 2, Window_Base._iconWidth, 'center'); 165 | this.contents.fontSize = lastFontSize; 166 | } 167 | } 168 | } 169 | }; 170 | })(); 171 | -------------------------------------------------------------------------------- /MrTS_DarkRoomCovers.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_DarkRoomCovers.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Hides or reveals regions. 7 | * @author Mr. Trivel 8 | * 9 | * @param Tile Size 10 | * @desc How big are map tiles? X Y 11 | * Default: 48 48 12 | * @default 48 48 13 | * 14 | * @help 15 | * -------------------------------------------------------------------------------- 16 | * Terms of Use 17 | * -------------------------------------------------------------------------------- 18 | * Don't remove the header or claim that you wrote this plugin. 19 | * Credit Mr. Trivel if using this plugin in your project. 20 | * Free for commercial and non-commercial projects. 21 | * -------------------------------------------------------------------------------- 22 | * Version 1.1 23 | * -------------------------------------------------------------------------------- 24 | * 25 | * -------------------------------------------------------------------------------- 26 | * Map Property Tags 27 | * -------------------------------------------------------------------------------- 28 | * 29 | * -------------------------------------------------------------------------------- 30 | * 31 | * -------------------------------------------------------------------------------- 32 | * Plugin Commands 33 | * -------------------------------------------------------------------------------- 34 | * RegionReveal [ID] - Reveals tiles of specific region 35 | * RegionHide [ID] - Hides tiles of specific region 36 | * RegionReset - Resets all open regions 37 | * -------------------------------------------------------------------------------- 38 | * 39 | * -------------------------------------------------------------------------------- 40 | * Version History 41 | * -------------------------------------------------------------------------------- 42 | * 1.1 - Performance issues fixed, code cleanup 43 | * 1.0 - Release 44 | */ 45 | 46 | (function() { 47 | var parameters = PluginManager.parameters('MrTS_DarkRoomCovers'); 48 | var paramTileSize = String(parameters['Tile Size'] || "48 48").split(' '); 49 | var tileSizeX = Number(paramTileSize[0]); 50 | var tileSizeY = Number(paramTileSize[1]); 51 | 52 | //-------------------------------------------------------------------------- 53 | // Game_Interpreter 54 | // 55 | 56 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 57 | Game_Interpreter.prototype.pluginCommand = function(command, args) { 58 | _Game_Interpreter_pluginCommand.call(this, command, args); 59 | if (command.toLowerCase() === "regionreveal") { 60 | $gameMap.addToCurrentlyOpenRegions(Number(args[0])); 61 | } else if (command.toLowerCase() === "regionhide") { 62 | $gameMap.removeFromCurrentlyOpenRegions(Number(args[0])); 63 | } else if (command.toLowerCase() === "regionreset") { 64 | $gameMap.resetCurrentlyOpenRegions(); 65 | } 66 | }; 67 | 68 | //---------------------------------------------------------------------------- 69 | // Game_Map 70 | // 71 | 72 | // currentlyOpenRegions 73 | Game_Map.prototype.currentlyOpenRegions = function() { 74 | if (!this._openRegionIds) this._openRegionIds = [0]; 75 | return this._openRegionIds; 76 | }; 77 | 78 | Game_Map.prototype.addToCurrentlyOpenRegions = function(id) { 79 | if (!this._openRegionIds) this._openRegionIds = [0]; 80 | if (!this._openRegionIds.contains(id)) this._openRegionIds.push(id); 81 | }; 82 | 83 | Game_Map.prototype.removeFromCurrentlyOpenRegions = function(id) { 84 | if (!this._openRegionIds) return; 85 | this._openRegionIds.splice(this._openRegionIds.indexOf(id), 1); 86 | }; 87 | 88 | Game_Map.prototype.resetCurrentlyOpenRegions = function() { 89 | this._openRegionIds = [0]; 90 | }; 91 | 92 | //---------------------------------------------------------------------------- 93 | // Scene_Map 94 | // 95 | 96 | var _SceneMap_createDisplayObjects = Scene_Map.prototype.createDisplayObjects; 97 | Scene_Map.prototype.createDisplayObjects = function() { 98 | _SceneMap_createDisplayObjects.call(this); 99 | this.createDarkCover(); 100 | }; 101 | 102 | Scene_Map.prototype.createDarkCover = function() { 103 | this._darkCover = new Spriteset_DarkCover(); 104 | this._spriteset.addChild(this._darkCover); 105 | }; 106 | 107 | //-------------------------------------------------------------------------- 108 | // Spriteset_DarkCover 109 | // 110 | // Covers regions with dark dark darkness. 111 | 112 | function Spriteset_DarkCover() { 113 | this.initialize.apply(this, arguments); 114 | }; 115 | 116 | Spriteset_DarkCover.prototype = Object.create(Sprite.prototype); 117 | Spriteset_DarkCover.prototype.constructor = Spriteset_DarkCover; 118 | 119 | Spriteset_DarkCover.prototype.initialize = function() { 120 | Sprite.prototype.initialize.call(this); 121 | this.setFrame(0, 0, Graphics.width, Graphics.height); 122 | this._tone = [0, 0, 0, 0]; 123 | this.opaque = true; 124 | this._darkCovers = []; 125 | this._displayX = 0; 126 | this._displayY = 0; 127 | this._regions = $gameMap.currentlyOpenRegions().clone(); 128 | this.createDarkCovers(); 129 | this.update(); 130 | }; 131 | 132 | Spriteset_DarkCover.prototype.createDarkCovers = function() { 133 | var bitmap = new Bitmap(tileSizeX, tileSizeY); 134 | bitmap.fillAll('#000000'); 135 | for (var j = -1; j < Math.ceil(Graphics.boxHeight/tileSizeY)+2; j++) { 136 | this._darkCovers.push([]); 137 | for (var i = -1; i < Math.ceil(Graphics.boxWidth/tileSizeX)+2; i++) { 138 | var cover = new Sprite(bitmap); 139 | cover.x = i * tileSizeX; 140 | cover.y = j * tileSizeY; 141 | var regionId = $gameMap.regionId(i+this._displayX, j+this._displayY); 142 | cover.visible = !(this._regions.contains(regionId)); 143 | this._darkCovers[j+1].push(cover); 144 | this.addChild(cover); 145 | } 146 | } 147 | }; 148 | 149 | Spriteset_DarkCover.prototype.update = function() { 150 | Sprite.prototype.update.call(this); 151 | this.x = (-$gameMap.displayX() + Math.floor($gameMap.displayX())) * tileSizeX; 152 | this.y = (-$gameMap.displayY() + Math.floor($gameMap.displayY())) * tileSizeY; 153 | if (Math.floor($gameMap.displayX()) !== this._displayX || 154 | Math.floor($gameMap.displayY()) !== this._displayY || 155 | !$gameMap.currentlyOpenRegions().equals(this._regions)) 156 | { 157 | this._displayX = Math.floor($gameMap.displayX()); 158 | this._displayY = Math.floor($gameMap.displayY()); 159 | this._regions = $gameMap.currentlyOpenRegions().clone(); 160 | for (var j = -1; j < Math.ceil(Graphics.boxHeight/tileSizeY)+2; j++) { 161 | for (var i = -1; i < Math.ceil(Graphics.boxWidth/tileSizeX)+2; i++) { 162 | var regionId = $gameMap.regionId(i+this._displayX, j+this._displayY); 163 | this._darkCovers[j+1][i+1].visible = !(this._regions.contains(regionId)); 164 | } 165 | } 166 | } 167 | }; 168 | })(); 169 | -------------------------------------------------------------------------------- /MrTS_StealSkill.js: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // MrTS_StealSkill.js 3 | //============================================================================== 4 | 5 | /*: 6 | * @plugindesc Allows to steal items and skills from enemies. 7 | * @author Mr. Trivel 8 | * 9 | * 10 | * @param Steal Mode 11 | * @desc 1 - try to steal every item, 2 - try to steal 1 item. If 12 | * mode is 2, % of all items has to add up to 1.0 or less. 13 | * @default 1 14 | * 15 | * @param Steal Success Text 16 | * @desc Text shown on successful steal. 17 | * @default %1 stole %2 from %3! 18 | * 19 | * @param Steal Success Text 20 | * @desc Text shown on successful skill steal. 21 | * @default %1 stole skill %2 from %3! 22 | * 23 | * @param Steal Fail Text 24 | * @desc Text shown on failed steal. 25 | * @default %1 failed to steal from %2. 26 | * 27 | * @param Nothing Left Text 28 | * @desc Text shown on when there's no more items to steal. 29 | * @default %1 doesn't have anything left! 30 | * 31 | * @help Version 1.2 32 | * Free for non-commercial use only. 33 | * 34 | * ## Modes 35 | * Mode 1 - Attempts to steal every item at once, 36 | * So if enemy has 3 available items to steal, player has a chance 37 | * to steal them all. 38 | * 39 | * Mode 2 - Attemps to steal only 1 item. 40 | * So if enemy has 3 available items to steal, player has a chance 41 | * to steal only 1 of them. 42 | * E.g. Potion 30%, Sword 20%, Doom Skill 1%. 43 | * Player will have 30% chance to get potion, 20% to get sword 44 | * and 1% to get Doom Skill. 45 | * 46 | * ## Note Fields 47 | * 48 | * Skill note fields: 49 | * - Add this to a skill that allows to steal. 50 | * 51 | * Enemy note fields: 52 | * 53 | * X - item type: w - weapon, a - armour, i - item, s - skill 54 | * Y - item/skill ID 55 | * Z - steal chance. 0.00 - 0% , 0.33 - 33%, 1.00 - 100% 56 | * K - item amount (Use 1 for skill) 57 | * L - number of times steal can success on the enemy 58 | */ 59 | 60 | (function() { 61 | var parameters = PluginManager.parameters('MrTS_StealSkill'); 62 | var stealMode = Number(parameters['Steal Mode'] || 1); 63 | var stealSuccessText = String(parameters['Steal Success Text'] || "%1 stole %2 from %3!"); 64 | var stealSkillSuccessText = String(parameters['Skill Success Text'] || "%1 stole skill %2 from %3!"); 65 | var stealFailText = String(parameters['Steal Fail Text'] || "%1 failed to steal from %2."); 66 | var nothingLeftText = String(parameters['Nothing Left Text'] || "%1 doesn't have anything left!"); 67 | 68 | var _Game_Enemy_setup = Game_Enemy.prototype.setup; 69 | 70 | Game_Enemy.prototype.setup = function(enemyId, x, y) { 71 | _Game_Enemy_setup.call(this, enemyId, x, y); 72 | this.stealableItems = []; 73 | if (this.enemy().meta.steal) 74 | { 75 | var note = this.enemy().note.split(/[\r\n]+/); 76 | 77 | for (var i = 0; i < note.length; i++) 78 | { 79 | var regex = //i; 80 | var match = regex.exec(note[i]); 81 | if (!match) continue; 82 | this.stealableItems.push(match); 83 | } 84 | } 85 | }; 86 | 87 | 88 | _Game_ActionResult_clear = Game_ActionResult.prototype.clear; 89 | Game_ActionResult.prototype.clear = function() { 90 | _Game_ActionResult_clear.call(this); 91 | this.stolenItems = []; 92 | this.stolenSkills = []; 93 | this.noItemsToSteal = true; 94 | this.failedSteal = false; 95 | this.stealAttempt = false; 96 | }; 97 | 98 | _Game_Action_apply = Game_Action.prototype.apply; 99 | Game_Action.prototype.apply = function(target) { 100 | _Game_Action_apply.call(this, target); 101 | var result = target.result(); 102 | if (result.isHit() && this.item().meta.steal) { 103 | var stolenItems = this.stealSuccess(target, this.subject()); 104 | result.stealAttempt = true; 105 | if ( stolenItems.length > 0) 106 | { 107 | result.stolenItems = stolenItems; 108 | } 109 | else 110 | { 111 | result.failedSteal = true; 112 | } 113 | this.makeSuccess(target); 114 | } 115 | }; 116 | 117 | Game_Action.prototype.stealSuccess = function(target, subject){ 118 | var success = []; 119 | var modeRand = 0; 120 | var modeRandSum = 0; 121 | 122 | if (stealMode == 2) modeRand = Math.random(); 123 | 124 | if (target.stealableItems.length > 0) 125 | { 126 | for (var i = 0; i < target.stealableItems.length; i++) 127 | { 128 | if (stealMode == 2 && success.length > 0) break; 129 | 130 | var stealData = target.stealableItems[i]; 131 | var stealSucceeded = false; 132 | 133 | if (stealMode == 1) 134 | { 135 | if (Math.random() <= Number(stealData[3]) && Number(stealData[5]) > 0) 136 | stealSucceeded = true; 137 | } 138 | else if (stealMode == 2) 139 | { 140 | modeRandSum += Number(stealData[3]); 141 | if (modeRand <= modeRandSum) 142 | if (Number(stealData[5]) > 0) 143 | stealSucceeded = true; 144 | else 145 | break; 146 | } 147 | 148 | if (stealSucceeded) 149 | { 150 | target.stealableItems[i][5] = Number(target.stealableItems[i][5])-1; 151 | 152 | switch(stealData[1].toLowerCase()){ 153 | case "a": 154 | var item = $dataArmors[Number(stealData[2])]; 155 | $gameParty.gainItem(item, Number(stealData[4])); 156 | success.push(item); 157 | break; 158 | case "w": 159 | var item = $dataWeapons[Number(stealData[2])]; 160 | $gameParty.gainItem(item, Number(stealData[4])); 161 | success.push(item); 162 | break; 163 | case "i": 164 | var item = $dataItems[Number(stealData[2])]; 165 | $gameParty.gainItem(item, Number(stealData[4])); 166 | success.push(item); 167 | break; 168 | case "s": 169 | var skill = $dataSkills[Number(stealData[2])]; 170 | subject.learnSkill(skill.id); 171 | success.push(skill); 172 | break; 173 | } // switch 174 | } // if 175 | } // for 176 | 177 | for (var i = 0; i < target.stealableItems.length; i++) 178 | { 179 | if (Number(target.stealableItems[i][5]) > 0) target.result().noItemsToSteal = false; 180 | } 181 | } // if 182 | 183 | return success; 184 | }; 185 | 186 | _Window_BattleLog_displayActionResults = Window_BattleLog.prototype.displayActionResults; 187 | Window_BattleLog.prototype.displayActionResults = function(subject, target) { 188 | _Window_BattleLog_displayActionResults.call(this, subject, target); 189 | if (target.result().used) { 190 | if (target.result().stolenItems.length > 0) 191 | { 192 | var stolenItems = target.result().stolenItems; 193 | for (var i = 0; i < stolenItems.length; i++) 194 | { 195 | if (!DataManager.isSkill(stolenItems[i])) 196 | this.push('addText', stealSuccessText.format(subject.name(), stolenItems[i].name, target.name())); 197 | else 198 | this.push('addText', stealSkillSuccessText.format(subject.name(), stolenItems[i].name, target.name())); 199 | } 200 | } 201 | if (target.result().noItemsToSteal && target.result().stealAttempt) 202 | this.push('addText', nothingLeftText.format(target.name())); 203 | else if (target.result().failedSteal) 204 | this.push('addText', stealFailText.format(subject.name(), target.name())); 205 | } 206 | }; 207 | })(); 208 | -------------------------------------------------------------------------------- /MrTS_HPMPTPMulticolorGauges.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_HPMPTPMulticolorGauges.js 3 | //============================================================================= 4 | // 5 | var Imported = Imported || {}; 6 | Imported.MrTS_HPMPTPMulticolorGauges = true; 7 | 8 | /*: 9 | * @plugindesc Allows to set more than starting/ending color for HP/MP/TP gauges. 10 | * @author Mr. Trivel 11 | * 12 | * @param Use HP Gauge 13 | * @desc Use multicolored HP Gauge? True/False 14 | * Default: True 15 | * @default True 16 | * 17 | * @param Use MP Gauge 18 | * @desc Use multicolored MP Gauge? True/False 19 | * Default: True 20 | * @default True 21 | * 22 | * @param Use TP Gauge 23 | * @desc Use multicolored TP Gauge? True/False 24 | * Default: True 25 | * @default True 26 | * 27 | * @param HP Gauge 28 | * @desc Colors for HP gauge. Any amount. In Hex. 29 | * Default: #ff0000 #f1913c #dffc1d #3bbd48 #1f8304 30 | * @default #ff0000 #f1913c #dffc1d #3bbd48 #1f8304 31 | * 32 | * @param MP Gauge 33 | * @desc Colors for MP gauge. Any amount. In Hex 34 | * Default: #f19aea #dab5eb #7f85fe #3800a9 #021456 35 | * @default #f19aea #dab5eb #7f85fe #3800a9 #021456 36 | * 37 | * @param TP Gauge 38 | * @desc Colors for TP gauge. Any amount. In Hex. 39 | * Default: #ffffff #bababa #7a7a7a #393939 #000000 40 | * @default #ffffff #bababa #7a7a7a #393939 #000000 41 | * 42 | * @help 43 | * -------------------------------------------------------------------------------- 44 | * Terms of Use 45 | * -------------------------------------------------------------------------------- 46 | * Don't remove the header or claim that you wrote this plugin. 47 | * Credit Mr. Trivel if using this plugin in your project. 48 | * Free for commercial and non-commercial projects. 49 | * -------------------------------------------------------------------------------- 50 | * Version 1.2 51 | * -------------------------------------------------------------------------------- 52 | * 53 | * -------------------------------------------------------------------------------- 54 | * Version History 55 | * -------------------------------------------------------------------------------- 56 | * 1.2 - Compatibility with MrTS_DifferentMPColorsAndNames 57 | * - Crash fix with MP/TP bars 58 | * 1.1 - Crash fix, disabling multicolor bars from plugin parameters added. 59 | * 1.0 - Release 60 | */ 61 | 62 | (function() { 63 | var parameters = PluginManager.parameters('MrTS_HPMPTPMulticolorGauges'); 64 | var paramHPGauge = String(parameters['HP Gauge'] || "#ff0000 #f1913c #dffc1d #3bbd48 #1f8304"); 65 | var paramMPGauge = String(parameters['MP Gauge'] || "#f19aea #dab5eb #7f85fe #3800a9 #021456"); 66 | var paramTPGauge = String(parameters['TP Gauge'] || "#ffffff #bababa #7a7a7a #393939 #000000"); 67 | var paramUseHP = (parameters['Use HP Gauge'] || "True").toLowerCase() === "true"; 68 | var paramUseMP = (parameters['Use MP Gauge'] || "True").toLowerCase() === "true"; 69 | var paramUseTP = (parameters['Use TP Gauge'] || "True").toLowerCase() === "true"; 70 | 71 | var parArrHP = paramHPGauge.split(' '); 72 | var parArrMP = paramMPGauge.split(' '); 73 | var parArrTP = paramTPGauge.split(' '); 74 | 75 | var _WindowBase_drawActorHp = Window_Base.prototype.drawActorHp; 76 | Window_Base.prototype.drawActorHp = function(actor, x, y, width) { 77 | var hpColorArray = parArrHP; 78 | if (Imported.MrTS_DifferentHpMpTpColorsAndNames) 79 | { 80 | this.setHpGaugeColors(actor.actorId()); 81 | hpColorArray = this._hpGaugeColors; 82 | } 83 | 84 | if (hpColorArray.length > 0 && paramUseHP) 85 | { 86 | width = width || 186; 87 | var offset = Math.floor(width/(hpColorArray.length-1)); 88 | for (var i = 0; i < hpColorArray.length-1; i++) { 89 | var color1 = hpColorArray[i]; 90 | var color2 = hpColorArray[i+1]; 91 | this.drawGauge(x + offset*i - (i !== 0 && i !== hpColorArray.length-1 ? 1 : 0), y, offset + (i !== 0 && i !== hpColorArray.length-1 ? 1 : 0), 1.00, color1, color2); 92 | } 93 | var rate = 1.00 - actor.hpRate(); 94 | var amount = width * rate; 95 | var height = Imported.YEP_CoreEngine ? this.gaugeHeight() : 8; 96 | var yPos = Imported.YEP_CoreEngine ? y + this.lineHeight() - height - 2 : Math.floor(y + this.lineHeight() - 8); 97 | this.contents.fillRect(x+width-amount, yPos, amount, height, this.gaugeBackColor()); 98 | this.changeTextColor(this.systemColor()); 99 | this.drawText(TextManager.hpA, x, y, 44); 100 | this.drawCurrentAndMax(actor.hp, actor.mhp, x, y, width, 101 | this.hpColor(actor), this.normalColor()); 102 | } 103 | else 104 | _WindowBase_drawActorHp.call(this, actor, x, y, width); 105 | }; 106 | 107 | var _WindowBase_drawActorMp = Window_Base.prototype.drawActorMp; 108 | Window_Base.prototype.drawActorMp = function(actor, x, y, width) { 109 | var mpColorArray = parArrMP; 110 | if (Imported.MrTS_DifferentHpMpTpColorsAndNames) 111 | { 112 | this.setMpGaugeColors(actor.actorId()); 113 | mpColorArray = this._mpGaugeColors; 114 | } 115 | 116 | if (mpColorArray.length > 0 && paramUseMP) 117 | { 118 | width = width || 186; 119 | var offset = Math.floor(width/(mpColorArray.length-1)); 120 | for (var i = 0; i < mpColorArray.length-1; i++) { 121 | var color1 = mpColorArray[i]; 122 | var color2 = mpColorArray[i+1]; 123 | this.drawGauge(x + offset*i - (i !== 0 && i !== mpColorArray.length-1 ? 1 : 0), y, offset + (i !== 0 && i !== mpColorArray.length-1 ? 1 : 0), 1.00, color1, color2); 124 | } 125 | var rate = 1.00 - actor.mpRate(); 126 | var amount = width * rate; 127 | var height = Imported.YEP_CoreEngine ? this.gaugeHeight() : 8; 128 | var yPos = Imported.YEP_CoreEngine ? y + this.lineHeight() - height - 2 : y + this.lineHeight() - 9; 129 | this.contents.fillRect(x+width-amount, yPos, amount, height, this.gaugeBackColor()); 130 | this.changeTextColor(this.systemColor()); 131 | this.drawText(TextManager.mpA, x, y, 44); 132 | this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width, 133 | this.mpColor(actor), this.normalColor()); 134 | } 135 | else 136 | _WindowBase_drawActorMp.call(this, actor, x, y, width); 137 | }; 138 | 139 | var _WindowBase_drawActorTp = Window_Base.prototype.drawActorTp; 140 | Window_Base.prototype.drawActorTp = function(actor, x, y, width) { 141 | var tpColorArray = parArrTP; 142 | if (Imported.MrTS_DifferentHpMpTpColorsAndNames) 143 | { 144 | this.setTpGaugeColors(actor.actorId()); 145 | tpColorArray = this._tpGaugeColors; 146 | } 147 | 148 | if (tpColorArray.length > 0 && paramUseTP) 149 | { 150 | width = width || 186; 151 | var offset = Math.floor(width/(tpColorArray.length-1)); 152 | 153 | for (var i = 0; i < tpColorArray.length-1; i++) { 154 | var color1 = tpColorArray[i]; 155 | var color2 = tpColorArray[i+1]; 156 | this.drawGauge(x + offset*i - (i !== 0 && i !== tpColorArray.length-1 ? 1 : 0), y, offset + (i !== 0 && i !== tpColorArray.length-1 ? 1 : 0), 1.00, color1, color2); 157 | } 158 | var rate = 1.00 - actor.tpRate(); 159 | var amount = width * rate; 160 | var height = Imported.YEP_CoreEngine ? this.gaugeHeight() : 8; 161 | var yPos = Imported.YEP_CoreEngine ? y + this.lineHeight() - height - 2 : y + this.lineHeight() - 9; 162 | this.contents.fillRect(x+width-amount, yPos, amount, height, this.gaugeBackColor()); 163 | this.changeTextColor(this.systemColor()); 164 | this.drawText(TextManager.tpA, x, y, 44); 165 | this.changeTextColor(this.tpColor(actor)); 166 | this.drawText(actor.tp, x + width - 64, y, 64, 'right'); 167 | } 168 | else 169 | _WindowBase_drawActorTp.call(this, actor, x, y, width); 170 | }; 171 | })(); 172 | -------------------------------------------------------------------------------- /MrTS_CommonEventDebug.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_CommonEventDebug.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Logs all executing common events to console. 7 | * @author Mr. Trivel 8 | * 9 | * @param Console 10 | * @desc Show debug in console? 11 | * Default: True 12 | * @default True 13 | * 14 | * @param Window 15 | * @desc Show debug in game window? 16 | * Default: True 17 | * @default True 18 | * 19 | * @param Window Frames 20 | * @desc If showing in game window, how many frames will it last? 21 | * Default: 80 22 | * @default 80 23 | * 24 | * @param Notification Height 25 | * @desc How tall is the notification? 26 | * Default: 40 27 | * @default 40 28 | * 29 | * @help 30 | * -------------------------------------------------------------------------------- 31 | * Terms of Use 32 | * -------------------------------------------------------------------------------- 33 | * Don't remove the header or claim that you wrote this plugin. 34 | * Credit Mr. Trivel if using this plugin in your project. 35 | * Free for commercial and non-commercial projects. 36 | * -------------------------------------------------------------------------------- 37 | * Version 1.2 38 | * -------------------------------------------------------------------------------- 39 | * 40 | * -------------------------------------------------------------------------------- 41 | * Open console by pressing F8. 42 | * -------------------------------------------------------------------------------- 43 | * 44 | * -------------------------------------------------------------------------------- 45 | * Version History 46 | * -------------------------------------------------------------------------------- 47 | * 1.2 - Added plugin parameter to change height of notification. 48 | * 1.1 - Added Common Event notifications in window. 49 | * 1.0 - Release 50 | */ 51 | 52 | (function() { 53 | var parameters = PluginManager.parameters('MrTS_CommonEventDebug'); 54 | var paramConsole = Boolean((parameters['Console'] || "true").toLowerCase() === "true"); 55 | var paramWindow = Boolean((parameters['Window'] || "true").toLowerCase() === "true"); 56 | var paramWindowFrames = Number(parameters['Window Frames'] || 80); 57 | var paramNotificationHeight = Number(parameters['Notification Height'] || 40); 58 | 59 | var _GameInterpreter_setupChild = Game_Interpreter.prototype.setupChild; 60 | Game_Interpreter.prototype.setupChild = function(list, eventId) { 61 | _GameInterpreter_setupChild.call(this, list, eventId); 62 | if (paramConsole) 63 | console.log((eventId === 0 ? "Battle" : "EventID: " + eventId) + " executed CE ID #" + this._params[0] + " - " + $dataCommonEvents[this._params[0]].name); 64 | if (paramWindow) 65 | $gameTemp.addToEventDebugQueue(this._params[0]); 66 | }; 67 | 68 | var _GameAction_applyGlobal = Game_Action.prototype.applyGlobal; 69 | Game_Action.prototype.applyGlobal = function() { 70 | this.item().effects.forEach(function(effect) { 71 | if (effect.code === Game_Action.EFFECT_COMMON_EVENT) { 72 | if (paramConsole) console.log("ItemID: " + this.item().id + " executed CE ID #" + effect.dataId + " - " + $dataCommonEvents[effect.dataId].name); 73 | if (paramWindow) $gameTemp.addToEventDebugQueue(effect.dataId); 74 | } 75 | }, this); 76 | _GameAction_applyGlobal.call(this); 77 | }; 78 | 79 | if (paramWindow) 80 | { 81 | var _Scene_Map_createDisplayObjects = Scene_Map.prototype.createDisplayObjects; 82 | Scene_Map.prototype.createDisplayObjects = function() { 83 | _Scene_Map_createDisplayObjects.call(this); 84 | this.createEventDebugQueue(); 85 | }; 86 | 87 | var _Scene_Battle_createDisplayObjects = Scene_Battle.prototype.createDisplayObjects; 88 | Scene_Battle.prototype.createDisplayObjects = function() { 89 | _Scene_Battle_createDisplayObjects.call(this); 90 | this.createEventDebugQueue(); 91 | }; 92 | 93 | Scene_Base.prototype.createEventDebugQueue = function() { 94 | this._eventDebugQueue = []; 95 | }; 96 | 97 | var _Scene_Map_updateScene = Scene_Map.prototype.updateScene; 98 | Scene_Map.prototype.updateScene = function() { 99 | _Scene_Map_updateScene.call(this); 100 | if (!SceneManager.isSceneChanging()) 101 | this.updateEventDebugQueue(); 102 | }; 103 | 104 | var _Scene_Battle_updateWindowPositions = Scene_Battle.prototype.updateWindowPositions; 105 | Scene_Battle.prototype.updateWindowPositions = function() { 106 | _Scene_Battle_updateWindowPositions.call(this); 107 | this.updateEventDebugQueue(); 108 | }; 109 | 110 | Scene_Base.prototype.updateEventDebugQueue = function() { 111 | var queue = $gameTemp.getEventDebugQueue(); 112 | if (queue.length > 0) 113 | { 114 | for (var i = 0; i < queue.length; i++) { 115 | var ce = queue[i]; 116 | var name = $dataCommonEvents[ce].name; 117 | var sprite = new Sprite(); 118 | var bitmap = new Bitmap(1, 1); 119 | bitmap.fontSize = paramNotificationHeight - 4; 120 | var txt = "#" + ce + " " + name; 121 | var tw = Math.ceil(bitmap.measureTextWidth(txt)); 122 | bitmap.resize(tw + 4, paramNotificationHeight); 123 | sprite.bitmap = bitmap; 124 | bitmap.fillAll("#282828"); 125 | bitmap.drawText(txt, 2, 0, bitmap.width-4, paramNotificationHeight, 'left'); 126 | sprite.x = -sprite.width; 127 | sprite.y = this._eventDebugQueue.length*paramNotificationHeight; 128 | this.addChild(sprite); 129 | var obj = { 130 | timer: paramWindowFrames, 131 | image: sprite, 132 | xGoal: 0, 133 | yGoal: sprite.y, 134 | floatX: sprite.x, 135 | floatY: sprite.y, 136 | state: 'right' 137 | }; 138 | this._eventDebugQueue.push(obj); 139 | } 140 | $gameTemp.removeFromEventDebugQueue(); 141 | } 142 | if (this._eventDebugQueue.length > 0) 143 | { 144 | for (var i = this._eventDebugQueue.length - 1; i >= 0; i--) { 145 | var ced = this._eventDebugQueue[i]; 146 | switch(ced.state) 147 | { 148 | case 'left': 149 | { 150 | var dtX = ced.xGoal - ced.floatX; 151 | ced.floatX += dtX * 0.08; 152 | ced.image.x = Math.floor(ced.floatX); 153 | if (Math.abs(ced.xGoal - ced.floatX) < 1) ced.floatX = ced.xGoal; 154 | } break; 155 | case 'right': 156 | { 157 | var dtX = ced.xGoal - ced.floatX; 158 | ced.floatX += dtX * 0.05; 159 | ced.image.x = Math.floor(ced.floatX); 160 | if (Math.abs(ced.xGoal - ced.floatX) < 1) { 161 | ced.floatX = ced.xGoal; 162 | ced.state = 'timer'; 163 | } 164 | } break; 165 | case 'timer': 166 | { 167 | ced.timer--; 168 | if (ced.timer <= 0) { 169 | ced.state = 'left'; 170 | ced.xGoal = -ced.image.width; 171 | } 172 | } break; 173 | } 174 | ced.yGoal = this._eventDebugQueue.indexOf(ced) * paramNotificationHeight; 175 | var dtY = ced.yGoal - ced.floatY; 176 | ced.floatY += dtY * 0.05; 177 | ced.image.y = Math.floor(ced.floatY); 178 | if (Math.abs(ced.yGoal - ced.floatY) < 1) ced.floatY = ced.yGoal; 179 | if (ced.floatX === ced.xGoal && ced.state === 'left') 180 | { 181 | this.removeChild(ced.image); 182 | this._eventDebugQueue.splice(i, 1); 183 | } 184 | } 185 | } 186 | }; 187 | 188 | Game_Temp.prototype.addToEventDebugQueue = function(ceId) { 189 | if (!this._eventDebugQueue) this._eventDebugQueue = []; 190 | this._eventDebugQueue.push(ceId); 191 | }; 192 | 193 | Game_Temp.prototype.removeFromEventDebugQueue = function() { 194 | this._eventDebugQueue = []; 195 | }; 196 | 197 | Game_Temp.prototype.getEventDebugQueue = function() { 198 | if (!this._eventDebugQueue) this._eventDebugQueue = []; 199 | return this._eventDebugQueue; 200 | }; 201 | } 202 | })(); 203 | -------------------------------------------------------------------------------- /MrTS_SimpleSaveLoadMenu.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SimpleSaveLoadMenu.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Shows faces instead of character sprites and adds 4 lines of things. 7 | * @author Mr. Trivel 8 | * 9 | * @param Background Image 10 | * @desc Background image name for saving and loading. Leave blank for default. 11 | * Default: 12 | * @default 13 | * 14 | * @param Select Text 15 | * @desc Select savefile text. 16 | * Default: Select Savefile 17 | * @default Select Savelife 18 | * 19 | * @param Line 1 20 | * @desc What to display in line 1? 'gold' 'time' 'variable [ID]' 'none' 21 | * Default: time 22 | * @default time 23 | * 24 | * @param Line 2 25 | * @desc What to display in line 2? 'gold' 'time' 'variable [ID]' 'none' 26 | * Default: gold 27 | * @default gold 28 | * 29 | * @param Line 3 30 | * @desc What to display in line 3? 'gold' 'time' 'variable [ID]' 'none' 31 | * Default: none 32 | * @default none 33 | * 34 | * @param Line 4 35 | * @desc What to display in line 4? 'gold' 'time' 'variable [ID]' 'none' 36 | * Default: variable 4 37 | * @default variable 4 38 | * 39 | * @param Line 1 Icon 40 | * @desc Which icon to display before Line 1? 41 | * Default 220 42 | * @default 220 43 | * 44 | * @param Line 2 Icon 45 | * @desc Which icon to display before Line 2? 46 | * Default: 313 47 | * @default 313 48 | * 49 | * @param Line 3 Icon 50 | * @desc Which icon to display before Line 3? 51 | * Default: 0 52 | * @default 0 53 | * 54 | * @param Line 4 Icon 55 | * @desc Which icon to display before Line 4? 56 | * Default: 190 57 | * @default 190 58 | * 59 | * @param Max Saves 60 | * @desc Amount of Savefiles available. 61 | * Default: 99 62 | * @default 99 63 | * 64 | * @help 65 | * -------------------------------------------------------------------------------- 66 | * Terms of Use 67 | * -------------------------------------------------------------------------------- 68 | * Don't remove the header or claim that you wrote this plugin. 69 | * Credit Mr. Trivel if using this plugin in your project. 70 | * Free for commercial and for non-commercial projects. 71 | * -------------------------------------------------------------------------------- 72 | * Version 1.0 73 | * -------------------------------------------------------------------------------- 74 | * 75 | * Everything is in plugin parameters. 76 | * 77 | * -------------------------------------------------------------------------------- 78 | * Version History 79 | * -------------------------------------------------------------------------------- 80 | * 1.0 - Release 81 | */ 82 | 83 | (function() { 84 | var parameters = PluginManager.parameters('MrTS_SimpleSaveLoadMenu'); 85 | 86 | var paramBackgroundImage = String(parameters['Background Image'] || ""); 87 | var paramSelectText = String(parameters['Select Text'] || "Select Savefile"); 88 | var paramLine1 = String(parameters['Line 1'] || "time"); 89 | var paramLine2 = String(parameters['Line 2'] || "gold"); 90 | var paramLine3 = String(parameters['Line 3'] || "none"); 91 | var paramLine4 = String(parameters['Line 4'] || "variable 4"); 92 | var paramLine1Icon = Number(parameters['Line 1 Icon'] || 220); 93 | var paramLine2Icon = Number(parameters['Line 2 Icon'] || 313); 94 | var paramLine3Icon = Number(parameters['Line 3 Icon'] || 0); 95 | var paramLine4Icon = Number(parameters['Line 4 Icon'] || 190); 96 | var paramLineIcons = [paramLine1Icon, paramLine2Icon, paramLine3Icon, paramLine4Icon]; 97 | var paramMaxSaves = Number(parameters['Max Saves'] || 99); 98 | 99 | DataManager.maxSavefiles = function() { 100 | return paramMaxSaves; 101 | }; 102 | 103 | 104 | Scene_File.prototype.createBackground = function() { 105 | this._backgroundSprite = new Sprite(); 106 | this._backgroundSprite.bitmap = paramBackgroundImage.length > 0 ? ImageManager.loadSystem(paramBackgroundImage) : SceneManager.backgroundBitmap(); 107 | this.addChild(this._backgroundSprite); 108 | }; 109 | 110 | var _SceneFile_createListWindow = Scene_File.prototype.createListWindow; 111 | Scene_File.prototype.createListWindow = function() { 112 | _SceneFile_createListWindow.call(this); 113 | var rectH = this._listWindow.itemRect(0).height; 114 | var y = this._helpWindow.height; 115 | var occupiedSpace = this._listWindow.standardPadding() * 2 + y; 116 | var possibleItems = Math.floor((Graphics.boxHeight-occupiedSpace)/rectH); 117 | var height = possibleItems * rectH + this._listWindow.standardPadding() * 2; 118 | var width = 816; 119 | this._listWindow.width = width; 120 | this._listWindow.height = height; 121 | this._listWindow.refresh(); 122 | this._listWindow.y = y + (Graphics.boxHeight-y)/2 - height/2; 123 | this._listWindow.x = Graphics.boxWidth/2 - width/2; 124 | 125 | this.addWindow(this._listWindow); 126 | 127 | this._helpWindow.width = width; 128 | this._helpWindow.x = this._listWindow.x; 129 | this._helpWindow.y = this._listWindow.y/2 - this._helpWindow.height/2; 130 | }; 131 | 132 | Window_SavefileList.prototype.drawItem = function(index) { 133 | var id = index + 1; 134 | var valid = DataManager.isThisGameFile(id); 135 | var info = DataManager.loadSavefileInfo(id); 136 | var rect = this.itemRectForText(index); 137 | this.resetTextColor(); 138 | if (this._mode === 'load') { 139 | this.changePaintOpacity(valid); 140 | } 141 | if (info) { 142 | this.changePaintOpacity(valid); 143 | this.drawContents(info, rect, valid); 144 | this.changePaintOpacity(true); 145 | } 146 | }; 147 | 148 | Window_SavefileList.prototype.drawContents = function(info, rect, valid) { 149 | var bottom = rect.y + rect.height; 150 | if (rect.width >= 420) { 151 | if (valid) { 152 | this.drawPartyCharacters(info, rect.x, rect.y); 153 | } 154 | } 155 | var lineHeight = this.lineHeight(); 156 | var y2 = rect.y + this.padding/2; 157 | for (var i = 0; i < paramLineIcons.length; i++) { 158 | this.drawLine(info, rect.x, y2, rect.width, i+1); 159 | y2 += lineHeight; 160 | } 161 | }; 162 | 163 | Window_SavefileList.prototype.drawPartyCharacters = function(info, x, y) { 164 | if (info.characters) { 165 | for (var i = 0; i < info.faces.length; i++) { 166 | var data = info.faces[i]; 167 | this.drawFace(data[0], data[1], x + i * Window_Base._faceWidth, y+this.padding/2); 168 | } 169 | } 170 | }; 171 | 172 | Window_SavefileList.prototype.drawLine = function(info, x, y, width, line) { 173 | var txt = info["line"+line]; 174 | this.drawText(txt, x, y, width, 'right'); 175 | this.drawIcon(paramLineIcons[line-1], x + width - this.textWidth(txt)-Window_Base._iconWidth-4, y); 176 | }; 177 | 178 | Window_SavefileList.prototype.itemHeight = function() { 179 | return Window_Base._faceHeight + this.padding; 180 | }; 181 | 182 | var _DataManager_makeSavefileInfo = DataManager.makeSavefileInfo; 183 | DataManager.makeSavefileInfo = function() { 184 | var info = _DataManager_makeSavefileInfo(); 185 | var data = [paramLine1, paramLine2, paramLine3, paramLine4]; 186 | var parsedData = []; 187 | for (var i = 0; i < data.length; i++) { 188 | switch (data[i].split(' ')[0]) 189 | { 190 | case 'gold': 191 | { 192 | parsedData[i] = $gameParty.gold(); 193 | } break; 194 | case 'time': 195 | { 196 | parsedData[i] = $gameSystem.playtimeText(); 197 | } break; 198 | case 'variable': 199 | { 200 | parsedData[i] = $gameVariables.value(Number(data[i].split(' ')[1])); 201 | } break; 202 | default: 203 | { 204 | parsedData[i] = ''; 205 | } break; 206 | 207 | } 208 | } 209 | info.line1 = parsedData[0]; 210 | info.line2 = parsedData[1]; 211 | info.line3 = parsedData[2]; 212 | info.line4 = parsedData[3]; 213 | console.log(info); 214 | return info; 215 | }; 216 | })(); 217 | -------------------------------------------------------------------------------- /MrTS_SimpleItemTracking.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // MrTS_SimpleItemTracking.js 3 | //============================================================================= 4 | 5 | /*: 6 | * @plugindesc Show trackable items/variables in menu above gold window. 7 | * @author Mr. Trivel 8 | * 9 | * @param [Colors] 10 | * @default 11 | * 12 | * @param Item Text 13 | * @desc Color for item text. 14 | * Default: #FFFFB0 15 | * @default #FFFFB0 16 | * 17 | * @param Amount Text 18 | * @desc Color for item amount. 19 | * Default: #FFFFFF 20 | * @default #FFFFFF 21 | * 22 | * @param [Advanced] 23 | * @default 24 | * 25 | * @param Track Window X 26 | * @desc X position for track window, or use 'default' setting. 27 | * Default: default 28 | * @default default 29 | * 30 | * @param Track Window Y 31 | * @desc Y position for track window, or use 'default' setting. 32 | * Default: default 33 | * @default default 34 | * 35 | * @param Track Window Width 36 | * @desc Width for track window, or use 'default' setting. 37 | * Default: default 38 | * @default default 39 | * 40 | * @help 41 | * -------------------------------------------------------------------------------- 42 | * Terms of Use 43 | * -------------------------------------------------------------------------------- 44 | * Don't remove the header or claim that you wrote this plugin. 45 | * Credit Mr. Trivel if using this plugin in your project. 46 | * Free for commercial and non-commercial projects. 47 | * -------------------------------------------------------------------------------- 48 | * Version 1.0 49 | * -------------------------------------------------------------------------------- 50 | * 51 | * -------------------------------------------------------------------------------- 52 | * Plugin Commands 53 | * -------------------------------------------------------------------------------- 54 | * To add tracking use the following plugin calls. 55 | * For adding items to the tracker use this: 56 | * AddTracking [TYPE] [ID] 57 | * [TYPE] - item, armor, weapon 58 | * [ID] - ID of the item/armor/weapon 59 | * 60 | * Example: 61 | * AddTracking item 1 62 | * AddTracking weapon 3 63 | * 64 | * For adding variables to the tracker use this: 65 | * AddTracking Variable [VARIABLE_ID] [ICON_ID] [NAME] 66 | * [VARIABLE_ID] - ID of the variable to track 67 | * [ICON_ID] - Icon to show in the tracker 68 | * [NAME] - Name to show in the tracker 69 | * 70 | * Example: 71 | * AddTracking Variable 5 17 "Bosses" 72 | * 73 | * To remove items or variables from being tracked, use such plugin command: 74 | * RemoveTracking [TYPE] [ID] 75 | * [TYPE] - item, armor, weapon, variable 76 | * [ID] - ID of item/armor/weapon/variable 77 | * 78 | * Example: 79 | * RemoveTracking variable 5 80 | * RemoveTracking armor 7 81 | * -------------------------------------------------------------------------------- 82 | * 83 | * -------------------------------------------------------------------------------- 84 | * Version History 85 | * -------------------------------------------------------------------------------- 86 | * 1.0 - Release 87 | */ 88 | 89 | (function() { 90 | var parameters = PluginManager.parameters('MrTS_SimpleItemTracking'); 91 | var paramTrackX = (parameters['Track Window X'] || "default"); 92 | var paramTrackY = (parameters['Track Window Y'] || "default"); 93 | var paramTrackWidth = (parameters['Track Window Width'] || "default"); 94 | var paramTextColor = (parameters['Item Text'] || "#FFFFB0"); 95 | var paramAmountColor = (parameters['Amount Text'] || "#FFFFFF"); 96 | 97 | //-------------------------------------------------------------------------- 98 | // Game_Interpreter 99 | // 100 | 101 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 102 | Game_Interpreter.prototype.pluginCommand = function(command, args) { 103 | _Game_Interpreter_pluginCommand.call(this, command, args); 104 | if (command.toLowerCase() === "addtracking") { 105 | switch (args[0].toUpperCase()) 106 | { 107 | case 'VARIABLE': 108 | { 109 | console.log(args[0], args[1], args[2], args[3]); 110 | $gameSystem.createTrackingObject("variable", Number(args[1]), Number(args[2]), args[3]); 111 | } break; 112 | default : 113 | { 114 | $gameSystem.createTrackingObject(args[0].toLowerCase(), Number(args[1])); 115 | } break; 116 | } 117 | } else if (command.toLowerCase() === "removetracking") { 118 | $gameSystem.removeTrackingObject(args[0].toLowerCase(), Number(args[1])); 119 | } 120 | }; 121 | 122 | //----------------------------------------------------------------------------- 123 | // Game_System 124 | // 125 | 126 | var _Game_System_initialize = Game_System.prototype.initialize; 127 | Game_System.prototype.initialize = function() { 128 | _Game_System_initialize.call(this); 129 | this._trackingObjects = []; 130 | }; 131 | 132 | Game_System.prototype.createTrackingObject = function(type, id, icon, name) { 133 | var o = {}; 134 | o.type = type; 135 | o.id = id; 136 | switch(type) 137 | { 138 | case 'item': 139 | { 140 | o.icon = $dataItems[id].iconIndex; 141 | } break; 142 | case 'weapon': 143 | { 144 | o.icon = $dataWeapons[id].iconIndex; 145 | } break; 146 | case 'armor': 147 | { 148 | o.icon = $dataArmors[id].iconIndex; 149 | } break; 150 | case 'variable': 151 | { 152 | o.icon = icon; 153 | o.name = name; 154 | } break; 155 | } 156 | this._trackingObjects.push(o); 157 | }; 158 | 159 | Game_System.prototype.removeTrackingObject = function(type, id) { 160 | for (var i = 0; i < this._trackingObjects.length; i++) { 161 | var o = this._trackingObjects[i]; 162 | if (o.type === type && o.id === id) { 163 | this._trackingObjects.splice(i, 1); 164 | } 165 | } 166 | }; 167 | 168 | Game_System.prototype.getTrackedObjects = function() { 169 | return this._trackingObjects; 170 | }; 171 | 172 | //----------------------------------------------------------------------------- 173 | // Scene_Menu 174 | // 175 | 176 | var _Scene_Menu_create = Scene_Menu.prototype.create; 177 | Scene_Menu.prototype.create = function() { 178 | _Scene_Menu_create.call(this); 179 | this.createTrackerWindow(); 180 | }; 181 | 182 | Scene_Menu.prototype.createTrackerWindow = function() { 183 | var il = $gameSystem.getTrackedObjects().length; 184 | if (il < 1) return; 185 | this._trackerWindow = new Window_MenuTracking(); 186 | var wh = this._trackerWindow.fittingHeight(il); 187 | var wx = paramTrackX === "default" ? this._goldWindow.x : Number(paramTrackX); 188 | var wy = paramTrackY === "default" ? this._goldWindow.y - wh : Number(paramTrackY); 189 | var ww = paramTrackWidth === "default" ? this._goldWindow.width : Number(paramTrackWidth); 190 | this._trackerWindow.x = wx; 191 | this._trackerWindow.y = wy; 192 | this._trackerWindow.width = ww; 193 | this._trackerWindow.height = wh; 194 | this._trackerWindow.refresh(); 195 | this.addWindow(this._trackerWindow); 196 | }; 197 | 198 | //-------------------------------------------------------------------------- 199 | // Window_MenuTracking 200 | // 201 | // Tracks items and variables. 202 | 203 | function Window_MenuTracking() { 204 | this.initialize.apply(this, arguments); 205 | }; 206 | 207 | Window_MenuTracking.prototype = Object.create(Window_Base.prototype); 208 | Window_MenuTracking.prototype.constructor = Window_MenuTracking; 209 | 210 | Window_MenuTracking.prototype.initialize = function() { 211 | Window_Base.prototype.initialize.call(this, 0, 0, 100, 20); 212 | }; 213 | 214 | Window_MenuTracking.prototype.refresh = function() { 215 | this.createContents(); 216 | var objects = $gameSystem.getTrackedObjects(); 217 | for (var i = 0; i < objects.length; i++) { 218 | var o = objects[i]; 219 | var count = 0; 220 | var icon = o.icon; 221 | var name = ""; 222 | switch(o.type) 223 | { 224 | case 'item': 225 | { 226 | var item = $dataItems[o.id]; 227 | name = item.name; 228 | count = $gameParty.numItems(item); 229 | } break; 230 | case 'weapon': 231 | { 232 | var item = $dataWeapons[o.id]; 233 | name = item.name; 234 | count = $gameParty.numItems(item); 235 | } break; 236 | case 'armor': 237 | { 238 | var item = $dataArmors[o.id]; 239 | name = item.name; 240 | count = $gameParty.numItems(item); 241 | } break; 242 | case 'variable': 243 | { 244 | name = o.name; 245 | count = $gameVariables.value(o.id); 246 | } break; 247 | } 248 | this.drawIcon(icon, 2, 2 + this.lineHeight()*i); 249 | this.changeTextColor(paramTextColor); 250 | this.drawText(name, 4 + Window_Base._iconWidth, this.lineHeight()*i); 251 | this.changeTextColor(paramAmountColor); 252 | this.drawText(count, 0, this.lineHeight()*i, this.contentsWidth(), 'right'); 253 | this.resetTextColor(); 254 | } 255 | }; 256 | })(); 257 | --------------------------------------------------------------------------------