├── .gitignore ├── .npmrc ├── LICENSE ├── README.md ├── package.json ├── sample_code ├── js │ ├── AltMenuScreen.js │ ├── AltSaveScreen.js │ ├── EnemyBook.js │ ├── ItemBook.js │ ├── MadeWithMv.js │ ├── SimpleMsgSideView.js │ ├── TitleCommandPosition.js │ └── WeaponSkill.js └── ts │ ├── AltMenuScreen.ts │ ├── AltSaveScreen.ts │ ├── EnemyBook.ts │ ├── ItemBook.ts │ ├── MadeWithMv.ts │ ├── SimpleMsgSideView.ts │ ├── TitleCommandPosition.ts │ └── WeaponSkill.ts ├── tsconfig.json └── typings ├── lib └── lib.dom.d.ts └── rpgmakermv ├── data.d.ts ├── rpg_core.d.ts ├── rpg_managers.d.ts ├── rpg_objects.d.ts ├── rpg_scenes.d.ts ├── rpg_sprites.d.ts ├── rpg_windows.d.ts └── rpgmakermv.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016- BaroqueEngine 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rpgmakermv_typescript_dts 2 | 3 | RPGツクールMVに標準搭載されているJavaScriptを、TypeScriptで扱うための型定義ファイルです。 4 | 5 | ## 対象バージョン 6 | 1.5.2 7 | 8 | ## 利用方法 9 | 10 | ``` 11 | npm install rpgmakermv_typescript_dts 12 | ``` 13 | 14 | tsconfig.json 15 | ```json 16 | { 17 | "compilerOptions": { 18 | "target": "es5" 19 | } 20 | } 21 | ``` 22 | 23 | or ... 24 | ```json 25 | { 26 | "compilerOptions": { 27 | "target": "es5", 28 | "forceConsistentCasingInFileNames": true, 29 | "noImplicitAny": true, 30 | "noImplicitThis": true, 31 | "noImplicitReturns": true, 32 | "noImplicitUseStrict": true, 33 | "noUnusedLocals": true, 34 | "noUnusedParameters": true, 35 | "removeComments": false, 36 | "preserveConstEnums": true, 37 | "sourceMap": false, 38 | "strictNullChecks": true 39 | }, 40 | "exclude": [ 41 | "node_modules" 42 | ] 43 | } 44 | ``` 45 | 46 | then foo.ts 47 | ```typescript 48 | /// 49 | 50 | const params = PluginManager.parameters("fooplugin"); 51 | 52 | ... 53 | ``` 54 | 55 | ## License 56 | [MIT License](LICENSE) 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rpgmakermv_typescript_dts", 3 | "version": "1.5.2", 4 | "description": "RPGツクールMVに標準搭載されているJavaScriptを、TypeScriptで扱うための型定義ファイルです。", 5 | "main": "index.js", 6 | "types": "typings/rpgmakermv/rpgmakermv.d.ts", 7 | "files": [ 8 | "typings" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/Narazaka/rpgmakermv_typescript_dts.git" 13 | }, 14 | "author": "narazaka", 15 | "license": "MIT", 16 | "bugs": { 17 | "url": "https://github.com/Narazaka/rpgmakermv_typescript_dts/issues" 18 | }, 19 | "homepage": "https://github.com/Narazaka/rpgmakermv_typescript_dts#readme", 20 | "dependencies": { 21 | "@types/pixi.js": "4.5.4", 22 | "pixi-tilemap": "^1.2.3" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample_code/js/AltMenuScreen.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // AltMenuScreen.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Alternative menu screen layout. 6 | * @author Yoji Ojima 7 | * 8 | * @help This plugin does not provide plugin commands. 9 | */ 10 | /*:ja 11 | * @plugindesc メニュー画面のレイアウトを変更します。 12 | * @author Yoji Ojima 13 | * 14 | * @help このプラグインには、プラグインコマンドはありません。 15 | */ 16 | (function () { 17 | var _Scene_Menu_create = Scene_Menu.prototype.create; 18 | Scene_Menu.prototype.create = function () { 19 | _Scene_Menu_create.call(this); 20 | this._statusWindow.x = 0; 21 | this._statusWindow.y = this._commandWindow.height; 22 | this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width; 23 | }; 24 | Window_MenuCommand.prototype.windowWidth = function () { 25 | return Graphics.boxWidth; 26 | }; 27 | Window_MenuCommand.prototype.maxCols = function () { 28 | return 4; 29 | }; 30 | Window_MenuCommand.prototype.numVisibleRows = function () { 31 | return 2; 32 | }; 33 | Window_MenuStatus.prototype.windowWidth = function () { 34 | return Graphics.boxWidth; 35 | }; 36 | Window_MenuStatus.prototype.windowHeight = function () { 37 | var h1 = this.fittingHeight(1); 38 | var h2 = this.fittingHeight(2); 39 | return Graphics.boxHeight - h1 - h2; 40 | }; 41 | Window_MenuStatus.prototype.maxCols = function () { 42 | return 4; 43 | }; 44 | Window_MenuStatus.prototype.numVisibleRows = function () { 45 | return 1; 46 | }; 47 | Window_MenuStatus.prototype.drawItemImage = function (index) { 48 | var actor = $gameParty.members()[index]; 49 | var rect = this.itemRectForText(index); 50 | var w = Math.min(rect.width, 144); 51 | var h = Math.min(rect.height, 144); 52 | var lineHeight = this.lineHeight(); 53 | this.changePaintOpacity(actor.isBattleMember()); 54 | this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h); 55 | this.changePaintOpacity(true); 56 | }; 57 | Window_MenuStatus.prototype.drawItemStatus = function (index) { 58 | var actor = $gameParty.members()[index]; 59 | var rect = this.itemRectForText(index); 60 | var x = rect.x; 61 | var y = rect.y; 62 | var width = rect.width; 63 | var bottom = y + rect.height; 64 | var lineHeight = this.lineHeight(); 65 | this.drawActorName(actor, x, y + lineHeight * 0, width); 66 | this.drawActorLevel(actor, x, y + lineHeight * 1); 67 | this.drawActorClass(actor, x, bottom - lineHeight * 4, width); 68 | this.drawActorHp(actor, x, bottom - lineHeight * 3, width); 69 | this.drawActorMp(actor, x, bottom - lineHeight * 2, width); 70 | this.drawActorIcons(actor, x, bottom - lineHeight * 1, width); 71 | }; 72 | var _Window_MenuActor_initialize = Window_MenuActor.prototype.initialize; 73 | Window_MenuActor.prototype.initialize = function () { 74 | _Window_MenuActor_initialize.call(this); 75 | this.y = this.fittingHeight(2); 76 | }; 77 | })(); 78 | -------------------------------------------------------------------------------- /sample_code/js/AltSaveScreen.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // AltSaveScreen.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Alternative save/load screen layout. 6 | * @author Yoji Ojima 7 | * 8 | * @help This plugin does not provide plugin commands. 9 | */ 10 | /*:ja 11 | * @plugindesc セーブ/ロード画面のレイアウトを変更します。 12 | * @author Yoji Ojima 13 | * 14 | * @help このプラグインには、プラグインコマンドはありません。 15 | */ 16 | var __extends = (this && this.__extends) || function (d, b) { 17 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 18 | function __() { this.constructor = d; } 19 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 20 | }; 21 | var Window_SavefileStatus = (function (_super) { 22 | __extends(Window_SavefileStatus, _super); 23 | function Window_SavefileStatus(x, y, width, height) { 24 | _super.call(this, x, y, width, height); 25 | } 26 | Window_SavefileStatus.prototype.initialize = function (x, y, width, height) { 27 | _super.prototype.initialize.call(this, x, y, width, height); 28 | this._id = 1; 29 | }; 30 | ; 31 | Window_SavefileStatus.prototype.setMode = function (mode) { 32 | this._mode = mode; 33 | }; 34 | ; 35 | Window_SavefileStatus.prototype.setId = function (id) { 36 | this._id = id; 37 | this.refresh(); 38 | }; 39 | ; 40 | Window_SavefileStatus.prototype.refresh = function () { 41 | this.contents.clear(); 42 | var id = this._id; 43 | var valid = DataManager.isThisGameFile(id); 44 | var info = DataManager.loadSavefileInfo(id); 45 | var rect = this.contents.rect; 46 | this.resetTextColor(); 47 | if (this._mode === "load") { 48 | this.changePaintOpacity(valid); 49 | } 50 | this.drawFileId(id, rect.x, rect.y); 51 | if (info) { 52 | this.changePaintOpacity(valid); 53 | this.drawContents(info, rect, valid); 54 | this.changePaintOpacity(true); 55 | } 56 | }; 57 | ; 58 | Window_SavefileStatus.prototype.drawFileId = function (id, x, y) { 59 | this.drawText(TextManager.file + " " + id, x, y, 180); 60 | }; 61 | ; 62 | Window_SavefileStatus.prototype.drawContents = function (info, rect, valid) { 63 | var bottom = rect.y + rect.height; 64 | var playtimeY = bottom - this.lineHeight(); 65 | this.drawText(info.title, rect.x + 192, rect.y, rect.width - 192); 66 | if (valid) { 67 | this.drawPartyfaces(info, rect.x, bottom - 144); 68 | } 69 | this.drawText(info.playtime, rect.x, playtimeY, rect.width, "right"); 70 | }; 71 | ; 72 | Window_SavefileStatus.prototype.drawPartyfaces = function (info, x, y) { 73 | if (info && info.faces) { 74 | for (var i = 0; i < info.faces.length; i++) { 75 | var data = info.faces[i]; 76 | this.drawFace(data[0], data[1], x + i * 150, y); 77 | } 78 | } 79 | }; 80 | ; 81 | return Window_SavefileStatus; 82 | }(Window_Base)); 83 | (function () { 84 | var _Scene_File_create = Scene_File.prototype.create; 85 | Scene_File.prototype.create = function () { 86 | _Scene_File_create.call(this); 87 | this._listWindow.height = this._listWindow.fittingHeight(8); 88 | var x = 0; 89 | var y = this._listWindow.y + this._listWindow.height; 90 | var width = Graphics.boxWidth; 91 | var height = Graphics.boxHeight - y; 92 | var statusWindow = new Window_SavefileStatus(x, y, width, height); 93 | statusWindow.setMode(this.mode()); 94 | this._listWindow.statusWindow = statusWindow; 95 | this._listWindow.callUpdateHelp(); 96 | this.addWindow(statusWindow); 97 | }; 98 | var _Scene_File_start = Scene_File.prototype.start; 99 | Scene_File.prototype.start = function () { 100 | _Scene_File_start.call(this); 101 | this._listWindow.ensureCursorVisible(); 102 | this._listWindow.callUpdateHelp(); 103 | }; 104 | Window_SavefileList.prototype.spacing = function () { 105 | return 8; 106 | }; 107 | Window_SavefileList.prototype.maxCols = function () { 108 | return 4; 109 | }; 110 | Window_SavefileList.prototype.itemHeight = function () { 111 | return this.lineHeight() * 2; 112 | }; 113 | var _Window_SavefileList_callUpdateHelp = Window_SavefileList.prototype.callUpdateHelp; 114 | Window_SavefileList.prototype.callUpdateHelp = function () { 115 | _Window_SavefileList_callUpdateHelp.call(this); 116 | if (this.active && this.statusWindow) { 117 | this.statusWindow.setId(this.index() + 1); 118 | } 119 | }; 120 | })(); 121 | -------------------------------------------------------------------------------- /sample_code/js/EnemyBook.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // EnemyBook.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Displays detailed statuses of enemies. 6 | * @author Yoji Ojima 7 | * 8 | * @param Unknown Data 9 | * @desc The index name for an unknown enemy. 10 | * @default ?????? 11 | * 12 | * @help 13 | * 14 | * Plugin Command: 15 | * EnemyBook open # Open the enemy book screen 16 | * EnemyBook add 3 # Add enemy #3 to the enemy book 17 | * EnemyBook remove 4 # Remove enemy #4 from the enemy book 18 | * EnemyBook complete # Complete the enemy book 19 | * EnemyBook clear # Clear the enemy book 20 | * 21 | * Enemy Note: 22 | * # Description text in the enemy book, line 1 23 | * # Description text in the enemy book, line 2 24 | * # This enemy does not appear in the enemy book 25 | */ 26 | /*:ja 27 | * @plugindesc モンスター図鑑です。敵キャラの詳細なステータスを表示します。 28 | * @author Yoji Ojima 29 | * 30 | * @param Unknown Data 31 | * @desc 未確認の敵キャラの索引名です。 32 | * @default ?????? 33 | * 34 | * @help 35 | * 36 | * プラグインコマンド: 37 | * EnemyBook open # 図鑑画面を開く 38 | * EnemyBook add 3 # 敵キャラ3番を図鑑に追加 39 | * EnemyBook remove 4 # 敵キャラ4番を図鑑から削除 40 | * EnemyBook complete # 図鑑を完成させる 41 | * EnemyBook clear # 図鑑をクリアする 42 | * 43 | * 敵キャラのメモ: 44 | * # 説明1行目 45 | * # 説明2行目 46 | * # 図鑑に載せない場合 47 | */ 48 | var __extends = (this && this.__extends) || function (d, b) { 49 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 50 | function __() { this.constructor = d; } 51 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 52 | }; 53 | (function () { 54 | var parameters = PluginManager.parameters("EnemyBook"); 55 | var unknownData = String(parameters["Unknown Data"] || "??????"); 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 === "EnemyBook") { 60 | switch (args[0]) { 61 | case "open": 62 | SceneManager.push(Scene_EnemyBook); 63 | break; 64 | case "add": 65 | $gameSystem.addToEnemyBook(Number(args[1])); 66 | break; 67 | case "remove": 68 | $gameSystem.removeFromEnemyBook(Number(args[1])); 69 | break; 70 | case "complete": 71 | $gameSystem.completeEnemyBook(); 72 | break; 73 | case "clear": 74 | $gameSystem.clearEnemyBook(); 75 | break; 76 | default: 77 | break; 78 | } 79 | } 80 | }; 81 | Game_System.prototype.addToEnemyBook = function (enemyId) { 82 | if (!this._enemyBookFlags) { 83 | this.clearEnemyBook(); 84 | } 85 | this._enemyBookFlags[enemyId] = true; 86 | }; 87 | Game_System.prototype.removeFromEnemyBook = function (enemyId) { 88 | if (this._enemyBookFlags) { 89 | this._enemyBookFlags[enemyId] = false; 90 | } 91 | }; 92 | Game_System.prototype.completeEnemyBook = function () { 93 | this.clearEnemyBook(); 94 | for (var i = 1; i < $dataEnemies.length; i++) { 95 | this._enemyBookFlags[i] = true; 96 | } 97 | }; 98 | Game_System.prototype.clearEnemyBook = function () { 99 | this._enemyBookFlags = []; 100 | }; 101 | Game_System.prototype.isInEnemyBook = function (enemy) { 102 | if (this._enemyBookFlags && enemy) { 103 | return !!this._enemyBookFlags[enemy.id]; 104 | } 105 | else { 106 | return false; 107 | } 108 | }; 109 | var _Game_Troop_setup = Game_Troop.prototype.setup; 110 | Game_Troop.prototype.setup = function (troopId) { 111 | _Game_Troop_setup.call(this, troopId); 112 | this.members().forEach(function (enemy) { 113 | if (enemy.isAppeared()) { 114 | $gameSystem.addToEnemyBook(enemy.enemyId()); 115 | } 116 | }, this); 117 | }; 118 | var _Game_Enemy_appear = Game_Enemy.prototype.appear; 119 | Game_Enemy.prototype.appear = function () { 120 | _Game_Enemy_appear.call(this); 121 | $gameSystem.addToEnemyBook(this._enemyId); 122 | }; 123 | var _Game_Enemy_transform = Game_Enemy.prototype.transform; 124 | Game_Enemy.prototype.transform = function (enemyId) { 125 | _Game_Enemy_transform.call(this, enemyId); 126 | $gameSystem.addToEnemyBook(enemyId); 127 | }; 128 | var Scene_EnemyBook = (function (_super) { 129 | __extends(Scene_EnemyBook, _super); 130 | function Scene_EnemyBook() { 131 | _super.apply(this, arguments); 132 | } 133 | Scene_EnemyBook.prototype.initialize = function () { 134 | _super.prototype.initialize.call(this); 135 | }; 136 | Scene_EnemyBook.prototype.create = function () { 137 | _super.prototype.create.call(this); 138 | this._indexWindow = new Window_EnemyBookIndex(0, 0); 139 | this._indexWindow.setHandler("cancel", this.popScene.bind(this)); 140 | var wy = this._indexWindow.height; 141 | var ww = Graphics.boxWidth; 142 | var wh = Graphics.boxHeight - wy; 143 | this._statusWindow = new Window_EnemyBookStatus(0, wy, ww, wh); 144 | this.addWindow(this._indexWindow); 145 | this.addWindow(this._statusWindow); 146 | this._indexWindow.setStatusWindow(this._statusWindow); 147 | }; 148 | return Scene_EnemyBook; 149 | }(Scene_MenuBase)); 150 | var Window_EnemyBookIndex = (function (_super) { 151 | __extends(Window_EnemyBookIndex, _super); 152 | function Window_EnemyBookIndex(x, y) { 153 | _super.call(this, x, y); 154 | this.initialize(x, y); 155 | } 156 | Window_EnemyBookIndex.prototype.initialize = function (x, y) { 157 | var width = Graphics.boxWidth; 158 | var height = this.fittingHeight(6); 159 | _super.prototype.initialize.call(this, x, y, width, height); 160 | this.refresh(); 161 | this.setTopRow(Window_EnemyBookIndex.lastTopRow); 162 | this.select(Window_EnemyBookIndex.lastIndex); 163 | this.activate(); 164 | }; 165 | Window_EnemyBookIndex.prototype.maxCols = function () { 166 | return 3; 167 | }; 168 | Window_EnemyBookIndex.prototype.maxItems = function () { 169 | return this._list ? this._list.length : 0; 170 | }; 171 | Window_EnemyBookIndex.prototype.setStatusWindow = function (statusWindow) { 172 | this._statusWindow = statusWindow; 173 | this.updateStatus(); 174 | }; 175 | Window_EnemyBookIndex.prototype.update = function () { 176 | _super.prototype.update.call(this); 177 | this.updateStatus(); 178 | }; 179 | Window_EnemyBookIndex.prototype.updateStatus = function () { 180 | if (this._statusWindow) { 181 | var enemy = this._list[this.index()]; 182 | this._statusWindow.setEnemy(enemy); 183 | } 184 | }; 185 | Window_EnemyBookIndex.prototype.refresh = function () { 186 | this._list = []; 187 | for (var i = 1; i < $dataEnemies.length; i++) { 188 | var enemy = $dataEnemies[i]; 189 | if (enemy.name && enemy.meta.book !== "no") { 190 | this._list.push(enemy); 191 | } 192 | } 193 | this.createContents(); 194 | this.drawAllItems(); 195 | }; 196 | Window_EnemyBookIndex.prototype.drawItem = function (index) { 197 | var enemy = this._list[index]; 198 | var rect = this.itemRectForText(index); 199 | var name; 200 | if ($gameSystem.isInEnemyBook(enemy)) { 201 | name = enemy.name; 202 | } 203 | else { 204 | name = unknownData; 205 | } 206 | this.drawText(name, rect.x, rect.y, rect.width); 207 | }; 208 | Window_EnemyBookIndex.prototype.processCancel = function () { 209 | _super.prototype.processCancel.call(this); 210 | Window_EnemyBookIndex.lastTopRow = this.topRow(); 211 | Window_EnemyBookIndex.lastIndex = this.index(); 212 | }; 213 | ; 214 | Window_EnemyBookIndex.lastTopRow = 0; 215 | Window_EnemyBookIndex.lastIndex = 0; 216 | return Window_EnemyBookIndex; 217 | }(Window_Selectable)); 218 | var Window_EnemyBookStatus = (function (_super) { 219 | __extends(Window_EnemyBookStatus, _super); 220 | function Window_EnemyBookStatus(x, y, width, height) { 221 | _super.call(this); 222 | this.initialize(x, y, width, height); 223 | } 224 | Window_EnemyBookStatus.prototype.initialize = function (x, y, width, height) { 225 | _super.prototype.initialize.call(this, x, y, width, height); 226 | this._enemy = null; 227 | this._enemySprite = new Sprite(); 228 | this._enemySprite.anchor.x = 0.5; 229 | this._enemySprite.anchor.y = 0.5; 230 | this._enemySprite.x = width / 2 - 20; 231 | this._enemySprite.y = height / 2; 232 | this.addChildToBack(this._enemySprite); 233 | this.refresh(); 234 | }; 235 | Window_EnemyBookStatus.prototype.setEnemy = function (enemy) { 236 | if (this._enemy !== enemy) { 237 | this._enemy = enemy; 238 | this.refresh(); 239 | } 240 | }; 241 | Window_EnemyBookStatus.prototype.update = function () { 242 | _super.prototype.update.call(this); 243 | if (this._enemySprite.bitmap) { 244 | var bitmapHeight = this._enemySprite.bitmap.height; 245 | var contentsHeight = this.contents.height; 246 | var scale = 1; 247 | if (bitmapHeight > contentsHeight) { 248 | scale = contentsHeight / bitmapHeight; 249 | } 250 | this._enemySprite.scale.x = scale; 251 | this._enemySprite.scale.y = scale; 252 | } 253 | }; 254 | Window_EnemyBookStatus.prototype.refresh = function () { 255 | var enemy = this._enemy; 256 | var x = 0; 257 | var y = 0; 258 | var lineHeight = this.lineHeight(); 259 | this.contents.clear(); 260 | if (!enemy || !$gameSystem.isInEnemyBook(enemy)) { 261 | this._enemySprite.bitmap = null; 262 | return; 263 | } 264 | var name = enemy.battlerName; 265 | var hue = enemy.battlerHue; 266 | var bitmap; 267 | if ($gameSystem.isSideView()) { 268 | bitmap = ImageManager.loadSvEnemy(name, hue); 269 | } 270 | else { 271 | bitmap = ImageManager.loadEnemy(name, hue); 272 | } 273 | this._enemySprite.bitmap = bitmap; 274 | this.resetTextColor(); 275 | this.drawText(enemy.name, x, y); 276 | x = this.textPadding(); 277 | y = lineHeight + this.textPadding(); 278 | for (var i = 0; i < 8; i++) { 279 | this.changeTextColor(this.systemColor()); 280 | this.drawText(TextManager.param(i), x, y, 160); 281 | this.resetTextColor(); 282 | this.drawText(enemy.params[i].toString(), x + 160, y, 60, "right"); 283 | y += lineHeight; 284 | } 285 | var rewardsWidth = 280; 286 | x = this.contents.width - rewardsWidth; 287 | y = lineHeight + this.textPadding(); 288 | this.resetTextColor(); 289 | this.drawText(enemy.exp.toString(), x, y); 290 | x += this.textWidth(enemy.exp.toString()) + 6; 291 | this.changeTextColor(this.systemColor()); 292 | this.drawText(TextManager.expA, x, y); 293 | x += this.textWidth(TextManager.expA + " "); 294 | this.resetTextColor(); 295 | this.drawText(enemy.gold.toString(), x, y); 296 | x += this.textWidth(enemy.gold.toString()) + 6; 297 | this.changeTextColor(this.systemColor()); 298 | this.drawText(TextManager.currencyUnit, x, y); 299 | x = this.contents.width - rewardsWidth; 300 | y += lineHeight; 301 | for (var j = 0; j < enemy.dropItems.length; j++) { 302 | var di = enemy.dropItems[j]; 303 | if (di.kind > 0) { 304 | var item = Game_Enemy.prototype.itemObject(di.kind, di.dataId); 305 | this.drawItemName(item, x, y, rewardsWidth); 306 | y += lineHeight; 307 | } 308 | } 309 | var descWidth = 480; 310 | x = this.contents.width - descWidth; 311 | y = this.textPadding() + lineHeight * 7; 312 | this.drawTextEx(enemy.meta.desc1, x, y + lineHeight * 0); 313 | this.drawTextEx(enemy.meta.desc2, x, y + lineHeight * 1); 314 | }; 315 | ; 316 | return Window_EnemyBookStatus; 317 | }(Window_Base)); 318 | })(); 319 | -------------------------------------------------------------------------------- /sample_code/js/ItemBook.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // ItemBook.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Displays detailed statuses of items. 6 | * @author Yoji Ojima 7 | * 8 | * @param Unknown Data 9 | * @desc The index name for an unknown item. 10 | * @default ?????? 11 | * 12 | * @param Price Text 13 | * @desc The text for "Price". 14 | * @default Price 15 | * 16 | * @param Equip Text 17 | * @desc The text for "Equip". 18 | * @default Equip 19 | * 20 | * @param Type Text 21 | * @desc The text for "Type". 22 | * @default Type 23 | * 24 | * @help 25 | * 26 | * Plugin Command: 27 | * ItemBook open # Open the item book screen 28 | * ItemBook add weapon 3 # Add weapon #3 to the item book 29 | * ItemBook add armor 4 # Add armor #4 to the item book 30 | * ItemBook remove armor 5 # Remove armor #5 from the item book 31 | * ItemBook remove item 6 # Remove item #6 from the item book 32 | * ItemBook complete # Complete the item book 33 | * ItemBook clear # Clear the item book 34 | * 35 | * Item (Weapon, Armor) Note: 36 | * # This item does not appear in the item book 37 | */ 38 | /*:ja 39 | * @plugindesc アイテム図鑑です。アイテムの詳細なステータスを表示します。 40 | * @author Yoji Ojima 41 | * 42 | * @param Unknown Data 43 | * @desc 未確認のアイテムの索引名です。 44 | * @default ?????? 45 | * 46 | * @param Price Text 47 | * @desc 「価格」の文字列です。 48 | * @default 価格 49 | * 50 | * @param Equip Text 51 | * @desc 「装備」の文字列です。 52 | * @default 装備 53 | * 54 | * @param Type Text 55 | * @desc 「タイプ」の文字列です。 56 | * @default タイプ 57 | * 58 | * @help 59 | * 60 | * プラグインコマンド: 61 | * ItemBook open # 図鑑画面を開く 62 | * ItemBook add weapon 3 # 武器3番を図鑑に追加 63 | * ItemBook add armor 4 # 防具4番を図鑑に追加 64 | * ItemBook remove armor 5 # 防具5番を図鑑から削除 65 | * ItemBook remove item 6 # アイテム6番を図鑑から削除 66 | * ItemBook complete # 図鑑を完成させる 67 | * ItemBook clear # 図鑑をクリアする 68 | * 69 | * アイテム(武器、防具)のメモ: 70 | * # 図鑑に載せない場合 71 | */ 72 | var __extends = (this && this.__extends) || function (d, b) { 73 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 74 | function __() { this.constructor = d; } 75 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 76 | }; 77 | (function () { 78 | var parameters = PluginManager.parameters("ItemBook"); 79 | var unknownData = String(parameters["Unknown Data"] || "??????"); 80 | var priceText = String(parameters["Price Text"] || "Price"); 81 | var equipText = String(parameters["Equip Text"] || "Equip"); 82 | var typeText = String(parameters["Type Text"] || "Type"); 83 | var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; 84 | Game_Interpreter.prototype.pluginCommand = function (command, args) { 85 | _Game_Interpreter_pluginCommand.call(this, command, args); 86 | if (command === "ItemBook") { 87 | switch (args[0]) { 88 | case "open": 89 | SceneManager.push(Scene_ItemBook); 90 | break; 91 | case "add": 92 | $gameSystem.addToItemBook(args[1], Number(args[2])); 93 | break; 94 | case "remove": 95 | $gameSystem.removeFromItemBook(args[1], Number(args[2])); 96 | break; 97 | case "complete": 98 | $gameSystem.completeItemBook(); 99 | break; 100 | case "clear": 101 | $gameSystem.clearItemBook(); 102 | break; 103 | default: 104 | break; 105 | } 106 | } 107 | }; 108 | Game_System.prototype.addToItemBook = function (type, dataId) { 109 | if (!this._ItemBookFlags) { 110 | this.clearItemBook(); 111 | } 112 | var typeIndex = this.itemBookTypeToIndex(type); 113 | if (typeIndex >= 0) { 114 | this._ItemBookFlags[typeIndex][dataId] = true; 115 | } 116 | }; 117 | Game_System.prototype.removeFromItemBook = function (type, dataId) { 118 | if (this._ItemBookFlags) { 119 | var typeIndex = this.itemBookTypeToIndex(type); 120 | if (typeIndex >= 0) { 121 | this._ItemBookFlags[typeIndex][dataId] = false; 122 | } 123 | } 124 | }; 125 | Game_System.prototype.itemBookTypeToIndex = function (type) { 126 | switch (type) { 127 | case "item": 128 | return 0; 129 | case "weapon": 130 | return 1; 131 | case "armor": 132 | return 2; 133 | default: 134 | return -1; 135 | } 136 | }; 137 | Game_System.prototype.completeItemBook = function () { 138 | this.clearItemBook(); 139 | for (var i = 1; i < $dataItems.length; i++) { 140 | this._ItemBookFlags[0][i] = true; 141 | } 142 | for (var i = 1; i < $dataWeapons.length; i++) { 143 | this._ItemBookFlags[1][i] = true; 144 | } 145 | for (var i = 1; i < $dataArmors.length; i++) { 146 | this._ItemBookFlags[2][i] = true; 147 | } 148 | }; 149 | Game_System.prototype.clearItemBook = function () { 150 | this._ItemBookFlags = [[], [], []]; 151 | }; 152 | Game_System.prototype.isInItemBook = function (item) { 153 | if (this._ItemBookFlags && item) { 154 | var typeIndex = -1; 155 | if (DataManager.isItem(item)) { 156 | typeIndex = 0; 157 | } 158 | else if (DataManager.isWeapon(item)) { 159 | typeIndex = 1; 160 | } 161 | else if (DataManager.isArmor(item)) { 162 | typeIndex = 2; 163 | } 164 | if (typeIndex >= 0) { 165 | return !!this._ItemBookFlags[typeIndex][item.id]; 166 | } 167 | else { 168 | return false; 169 | } 170 | } 171 | else { 172 | return false; 173 | } 174 | }; 175 | var _Game_Party_gainItem = Game_Party.prototype.gainItem; 176 | Game_Party.prototype.gainItem = function (item, amount, includeEquip) { 177 | _Game_Party_gainItem.call(this, item, amount, includeEquip); 178 | if (item && amount > 0) { 179 | var type = void 0; 180 | if (DataManager.isItem(item)) { 181 | type = "item"; 182 | } 183 | else if (DataManager.isWeapon(item)) { 184 | type = "weapon"; 185 | } 186 | else if (DataManager.isArmor(item)) { 187 | type = "armor"; 188 | } 189 | console.log($gameSystem); 190 | $gameSystem.addToItemBook(type, item.id); 191 | } 192 | }; 193 | var Scene_ItemBook = (function (_super) { 194 | __extends(Scene_ItemBook, _super); 195 | function Scene_ItemBook() { 196 | _super.apply(this, arguments); 197 | } 198 | Scene_ItemBook.prototype.initialize = function () { 199 | _super.prototype.initialize.call(this); 200 | }; 201 | ; 202 | Scene_ItemBook.prototype.create = function () { 203 | _super.prototype.create.call(this); 204 | this._indexWindow = new Window_ItemBookIndex(0, 0); 205 | this._indexWindow.setHandler("cancel", this.popScene.bind(this)); 206 | var wy = this._indexWindow.height; 207 | var ww = Graphics.boxWidth; 208 | var wh = Graphics.boxHeight - wy; 209 | this._statusWindow = new Window_ItemBookStatus(0, wy, ww, wh); 210 | this.addWindow(this._indexWindow); 211 | this.addWindow(this._statusWindow); 212 | this._indexWindow.setStatusWindow(this._statusWindow); 213 | }; 214 | return Scene_ItemBook; 215 | }(Scene_MenuBase)); 216 | var Window_ItemBookIndex = (function (_super) { 217 | __extends(Window_ItemBookIndex, _super); 218 | function Window_ItemBookIndex(x, y) { 219 | _super.call(this); 220 | this.initialize(x, y); 221 | } 222 | Window_ItemBookIndex.prototype.initialize = function (x, y) { 223 | var width = Graphics.boxWidth; 224 | var height = this.fittingHeight(6); 225 | _super.prototype.initialize.call(this, x, y, width, height); 226 | this.refresh(); 227 | this.setTopRow(Window_ItemBookIndex.lastTopRow); 228 | this.select(Window_ItemBookIndex.lastIndex); 229 | this.activate(); 230 | }; 231 | Window_ItemBookIndex.prototype.maxCols = function () { 232 | return 3; 233 | }; 234 | Window_ItemBookIndex.prototype.maxItems = function () { 235 | return this._list ? this._list.length : 0; 236 | }; 237 | Window_ItemBookIndex.prototype.setStatusWindow = function (statusWindow) { 238 | this._statusWindow = statusWindow; 239 | this.updateStatus(); 240 | }; 241 | Window_ItemBookIndex.prototype.update = function () { 242 | _super.prototype.update.call(this); 243 | this.updateStatus(); 244 | }; 245 | Window_ItemBookIndex.prototype.updateStatus = function () { 246 | if (this._statusWindow) { 247 | var item = this._list[this.index()]; 248 | this._statusWindow.setItem(item); 249 | } 250 | }; 251 | Window_ItemBookIndex.prototype.refresh = function () { 252 | this._list = []; 253 | for (var i = 1; i < $dataItems.length; i++) { 254 | var item = $dataItems[i]; 255 | if (item.name && item.itypeId === 1 && item.meta.book !== "no") { 256 | this._list.push(item); 257 | } 258 | } 259 | for (var i = 1; i < $dataWeapons.length; i++) { 260 | var item = $dataWeapons[i]; 261 | if (item.name && item.meta.book !== "no") { 262 | this._list.push(item); 263 | } 264 | } 265 | for (var i = 1; i < $dataArmors.length; i++) { 266 | var item = $dataArmors[i]; 267 | if (item.name && item.meta.book !== "no") { 268 | this._list.push(item); 269 | } 270 | } 271 | this.createContents(); 272 | this.drawAllItems(); 273 | }; 274 | Window_ItemBookIndex.prototype.drawItem = function (index) { 275 | var item = this._list[index]; 276 | var rect = this.itemRect(index); 277 | var width = rect.width - this.textPadding(); 278 | if ($gameSystem.isInItemBook(item)) { 279 | this.drawItemName(item, rect.x, rect.y, width); 280 | } 281 | else { 282 | var iw = Window_Base._iconWidth + 4; 283 | this.drawText(unknownData, rect.x + iw, rect.y, width - iw); 284 | } 285 | }; 286 | ; 287 | Window_ItemBookIndex.prototype.processCancel = function () { 288 | Window_Selectable.prototype.processCancel.call(this); 289 | Window_ItemBookIndex.lastTopRow = this.topRow(); 290 | Window_ItemBookIndex.lastIndex = this.index(); 291 | }; 292 | ; 293 | Window_ItemBookIndex.lastTopRow = 0; 294 | Window_ItemBookIndex.lastIndex = 0; 295 | return Window_ItemBookIndex; 296 | }(Window_Selectable)); 297 | var Window_ItemBookStatus = (function (_super) { 298 | __extends(Window_ItemBookStatus, _super); 299 | function Window_ItemBookStatus(x, y, width, height) { 300 | _super.call(this); 301 | this.initialize(x, y, width, height); 302 | } 303 | Window_ItemBookStatus.prototype.initialize = function (x, y, width, height) { 304 | _super.prototype.initialize.call(this, x, y, width, height); 305 | }; 306 | Window_ItemBookStatus.prototype.setItem = function (item) { 307 | if (this._item !== item) { 308 | this._item = item; 309 | this.refresh(); 310 | } 311 | }; 312 | ; 313 | Window_ItemBookStatus.prototype.refresh = function () { 314 | var item = this._item; 315 | var x = 0; 316 | var y = 0; 317 | var lineHeight = this.lineHeight(); 318 | this.contents.clear(); 319 | if (!item || !$gameSystem.isInItemBook(item)) { 320 | return; 321 | } 322 | this.drawItemName(item, x, y); 323 | x = this.textPadding(); 324 | y = lineHeight + this.textPadding(); 325 | var price = item.price > 0 ? item.price.toString() : "-"; 326 | this.changeTextColor(this.systemColor()); 327 | this.drawText(priceText, x, y, 120); 328 | this.resetTextColor(); 329 | this.drawText(price, x + 120, y, 120, "right"); 330 | y += lineHeight; 331 | if (DataManager.isWeapon(item) || DataManager.isArmor(item)) { 332 | var etype = $dataSystem.equipTypes[item.etypeId]; 333 | this.changeTextColor(this.systemColor()); 334 | this.drawText(equipText, x, y, 120); 335 | this.resetTextColor(); 336 | this.drawText(etype, x + 120, y, 120, "right"); 337 | y += lineHeight; 338 | var type = void 0; 339 | if (DataManager.isWeapon(item)) { 340 | type = $dataSystem.weaponTypes[item.wtypeId]; 341 | } 342 | else { 343 | type = $dataSystem.armorTypes[item.atypeId]; 344 | } 345 | this.changeTextColor(this.systemColor()); 346 | this.drawText(typeText, x, y, 120); 347 | this.resetTextColor(); 348 | this.drawText(type, x + 120, y, 120, "right"); 349 | x = this.textPadding() + 300; 350 | y = lineHeight + this.textPadding(); 351 | for (var i = 2; i < 8; i++) { 352 | this.changeTextColor(this.systemColor()); 353 | this.drawText(TextManager.param(i), x, y, 160); 354 | this.resetTextColor(); 355 | this.drawText(item.params[i].toString(), x + 160, y, 60, "right"); 356 | y += lineHeight; 357 | } 358 | } 359 | x = 0; 360 | y = this.textPadding() * 2 + lineHeight * 7; 361 | this.drawTextEx(item.description, x, y); 362 | }; 363 | ; 364 | return Window_ItemBookStatus; 365 | }(Window_Base)); 366 | })(); 367 | -------------------------------------------------------------------------------- /sample_code/js/MadeWithMv.js: -------------------------------------------------------------------------------- 1 | /*: 2 | * NOTE: Images are stored in the img/system folder. 3 | * 4 | * @plugindesc Show a Splash Screen "Made with MV" and/or a Custom Splash Screen before going to main screen. 5 | * @author Dan "Liquidize" Deptula 6 | * 7 | * @help This plugin does not provide plugin commands. 8 | * 9 | * @param Show Made With MV 10 | * @desc Enabled/Disables showing the "Made with MV" splash screen. 11 | * OFF - false ON - true 12 | * Default: ON 13 | * @default true 14 | * 15 | * @param Made with MV Image 16 | * @desc The image to use when showing "Made with MV" 17 | * Default: MadeWithMv 18 | * @default MadeWithMv 19 | * @require 1 20 | * @dir img/system/ 21 | * @type file 22 | * 23 | * @param Show Custom Splash 24 | * @desc Enabled/Disables showing the "Made with MV" splash screen. 25 | * OFF - false ON - true 26 | * Default: OFF 27 | * @default false 28 | * 29 | * @param Custom Image 30 | * @desc The image to use when showing "Made with MV" 31 | * Default: 32 | * @default 33 | * @require 1 34 | * @dir img/system/ 35 | * @type file 36 | * 37 | * @param Fade Out Time 38 | * @desc The time it takes to fade out, in frames. 39 | * Default: 120 40 | * @default 120 41 | * 42 | * @param Fade In Time 43 | * @desc The time it takes to fade in, in frames. 44 | * Default: 120 45 | * @default 120 46 | * 47 | * @param Wait Time 48 | * @desc The time between fading in and out, in frames. 49 | * Default: 160 50 | * @default 160 51 | * 52 | */ 53 | /*:ja 54 | * メモ: イメージはimg/systemフォルダ内に保存されます。 55 | * 56 | * @plugindesc メイン画面へ進む前に、"Made with MV"のスプラッシュ画面もしくはカスタマイズされたスプラッシュ画面を表示します。 57 | * @author Dan "Liquidize" Deptula 58 | * 59 | * @help このプラグインにはプラグインコマンドはありません。 60 | * 61 | * @param Show Made With MV 62 | * @desc "Made with MV"のスプラッシュ画面を表示できる/できないようにします。 63 | * OFF - false ON - true 64 | * デフォルト: ON 65 | * @default true 66 | * 67 | * @param Made with MV Image 68 | * @desc "Made with MV"を表示する際に使用する画像 69 | * デフォルト: MadeWithMv 70 | * @default MadeWithMv 71 | * @require 1 72 | * @dir img/system/ 73 | * @type file 74 | * 75 | * @param Show Custom Splash 76 | * @desc "Made with MV"のスプラッシュ画面を表示できる/できないようにします。 77 | * OFF - false ON - true 78 | * デフォルト: OFF 79 | * @default false 80 | * 81 | * @param Custom Image 82 | * @desc "Made with MV"を表示する際に使用する画像 83 | * デフォルト: 84 | * @default 85 | * @require 1 86 | * @dir img/system/ 87 | * @type file 88 | * 89 | * @param Fade Out Time 90 | * @desc フェードアウトに要する時間(フレーム数) 91 | * デフォルト: 120 92 | * @default 120 93 | * 94 | * @param Fade In Time 95 | * @desc フェードインに要する時間(フレーム数) 96 | * デフォルト: 120 97 | * @default 120 98 | * 99 | * @param Wait Time 100 | * @desc フェードインからフェードアウトまでに要する時間(フレーム数) 101 | * デフォルト: 160 102 | * @default 160 103 | * 104 | */ 105 | var __extends = (this && this.__extends) || function (d, b) { 106 | for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; 107 | function __() { this.constructor = d; } 108 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 109 | }; 110 | var Liquidize; 111 | (function (Liquidize) { 112 | var MadeWithMV = (function () { 113 | function MadeWithMV() { 114 | } 115 | return MadeWithMV; 116 | }()); 117 | Liquidize.MadeWithMV = MadeWithMV; 118 | })(Liquidize || (Liquidize = {})); 119 | Liquidize.MadeWithMV.Parameters = PluginManager.parameters("MadeWithMv"); 120 | Liquidize.MadeWithMV.ShowMV = JSON.parse(Liquidize.MadeWithMV.Parameters["Show Made With MV"]); 121 | Liquidize.MadeWithMV.MVImage = String(Liquidize.MadeWithMV.Parameters["Made with MV Image"]); 122 | Liquidize.MadeWithMV.ShowCustom = JSON.parse(Liquidize.MadeWithMV.Parameters["Show Custom Splash"]); 123 | Liquidize.MadeWithMV.CustomImage = String(Liquidize.MadeWithMV.Parameters["Custom Image"]); 124 | Liquidize.MadeWithMV.FadeOutTime = Number(Liquidize.MadeWithMV.Parameters["Fade Out Time"]) || 120; 125 | Liquidize.MadeWithMV.FadeInTime = Number(Liquidize.MadeWithMV.Parameters["Fade In Time"]) || 120; 126 | Liquidize.MadeWithMV.WaitTime = Number(Liquidize.MadeWithMV.Parameters["Wait Time"]) || 160; 127 | (function () { 128 | //----------------------------------------------------------------------------- 129 | // Scene_Boot 130 | // 131 | // The scene class for dealing with the game boot. 132 | var _Scene_Boot_loadSystemImages = Scene_Boot.loadSystemImages; 133 | Scene_Boot.loadSystemImages = function () { 134 | _Scene_Boot_loadSystemImages.call(this); 135 | if (Liquidize.MadeWithMV.ShowMV) { 136 | ImageManager.loadSystem(Liquidize.MadeWithMV.MVImage); 137 | } 138 | if (Liquidize.MadeWithMV.ShowCustom) { 139 | ImageManager.loadSystem(Liquidize.MadeWithMV.CustomImage); 140 | } 141 | }; 142 | var _Scene_Boot_start = Scene_Boot.prototype.start; 143 | Scene_Boot.prototype.start = function () { 144 | if ((Liquidize.MadeWithMV.ShowMV || Liquidize.MadeWithMV.ShowCustom) && !DataManager.isBattleTest() && !DataManager.isEventTest()) { 145 | SceneManager.goto(Scene_Splash); 146 | } 147 | else { 148 | _Scene_Boot_start.call(this); 149 | } 150 | }; 151 | //----------------------------------------------------------------------------- 152 | // Scene_Splash 153 | // 154 | // The scene class for dealing with the splash screens. 155 | var Scene_Splash = (function (_super) { 156 | __extends(Scene_Splash, _super); 157 | function Scene_Splash() { 158 | _super.apply(this, arguments); 159 | } 160 | Scene_Splash.prototype.createSplashes = function () { 161 | if (Liquidize.MadeWithMV.ShowMV) { 162 | this._mvSplash = new Sprite(ImageManager.loadSystem(Liquidize.MadeWithMV.MVImage)); 163 | this.addChild(this._mvSplash); 164 | } 165 | if (Liquidize.MadeWithMV.ShowCustom) { 166 | this._customSplash = new Sprite(ImageManager.loadSystem(Liquidize.MadeWithMV.CustomImage)); 167 | this._customSplash.opacity = 0; 168 | this.addChild(this._customSplash); 169 | } 170 | }; 171 | ; 172 | Scene_Splash.prototype.centerSprite = function (sprite) { 173 | sprite.x = Graphics.width / 2; 174 | sprite.y = Graphics.height / 2; 175 | sprite.anchor.x = 0.5; 176 | sprite.anchor.y = 0.5; 177 | }; 178 | ; 179 | Scene_Splash.prototype.gotoTitleOrTest = function () { 180 | _super.prototype.start.call(this); 181 | SoundManager.preloadImportantSounds(); 182 | if (DataManager.isBattleTest()) { 183 | DataManager.setupBattleTest(); 184 | SceneManager.goto(Scene_Battle); 185 | } 186 | else if (DataManager.isEventTest()) { 187 | DataManager.setupEventTest(); 188 | SceneManager.goto(Scene_Map); 189 | } 190 | else { 191 | this.checkPlayerLocation(); 192 | DataManager.setupNewGame(); 193 | SceneManager.goto(Scene_Title); 194 | Window_TitleCommand.initCommandPosition(); 195 | } 196 | this.updateDocumentTitle(); 197 | }; 198 | ; 199 | Scene_Splash.prototype.updateDocumentTitle = function () { 200 | document.title = $dataSystem.gameTitle; 201 | }; 202 | ; 203 | Scene_Splash.prototype.checkPlayerLocation = function () { 204 | if ($dataSystem.startMapId === 0) { 205 | throw new Error("Player\"s starting position is not set"); 206 | } 207 | }; 208 | ; 209 | Scene_Splash.prototype.initialize = function () { 210 | _super.prototype.initialize.call(this); 211 | this._mvSplash = null; 212 | this._customSplash = null; 213 | this._mvWaitTime = Liquidize.MadeWithMV.WaitTime; 214 | this._customWaitTime = Liquidize.MadeWithMV.WaitTime; 215 | this._mvFadeOut = false; 216 | this._mvFadeIn = false; 217 | this._customFadeOut = false; 218 | this._customFadeIn = false; 219 | }; 220 | ; 221 | Scene_Splash.prototype.create = function () { 222 | _super.prototype.create.call(this); 223 | this.createSplashes(); 224 | }; 225 | ; 226 | Scene_Splash.prototype.start = function () { 227 | _super.prototype.start.call(this); 228 | SceneManager.clearStack(); 229 | if (this._mvSplash !== null) { 230 | this.centerSprite(this._mvSplash); 231 | } 232 | if (this._customSplash !== null) { 233 | this.centerSprite(this._customSplash); 234 | } 235 | }; 236 | ; 237 | Scene_Splash.prototype.update = function () { 238 | if (Liquidize.MadeWithMV.ShowMV) { 239 | if (!this._mvFadeIn) { 240 | this.startFadeIn(Liquidize.MadeWithMV.FadeInTime, false); 241 | this._mvFadeIn = true; 242 | } 243 | else { 244 | if (this._mvWaitTime > 0 && this._mvFadeOut === false) { 245 | this._mvWaitTime--; 246 | } 247 | else { 248 | if (this._mvFadeOut === false) { 249 | this._mvFadeOut = true; 250 | this.startFadeOut(Liquidize.MadeWithMV.FadeOutTime, false); 251 | } 252 | } 253 | } 254 | } 255 | if (Liquidize.MadeWithMV.ShowCustom) { 256 | if (Liquidize.MadeWithMV.ShowMV && this._mvFadeOut === true) { 257 | if (!this._customFadeIn && this._fadeDuration === 0) { 258 | this._customSplash.opacity = 255; 259 | this._customWaitTime = Liquidize.MadeWithMV.WaitTime; 260 | this.startFadeIn(Liquidize.MadeWithMV.FadeInTime, false); 261 | this._customFadeIn = true; 262 | } 263 | else { 264 | if (this._customWaitTime > 0 && this._customFadeOut === false) { 265 | this._customWaitTime--; 266 | } 267 | else { 268 | if (this._customFadeOut === false) { 269 | this._customFadeOut = true; 270 | this.startFadeOut(Liquidize.MadeWithMV.FadeOutTime, false); 271 | } 272 | } 273 | } 274 | } 275 | else if (!Liquidize.MadeWithMV.ShowMV) { 276 | if (!this._customFadeIn) { 277 | this._customSplash.opacity = 255; 278 | this.startFadeIn(Liquidize.MadeWithMV.FadeInTime, false); 279 | this._customFadeIn = true; 280 | } 281 | else { 282 | if (this._customWaitTime > 0 && this._customFadeOut === false) { 283 | this._customWaitTime--; 284 | } 285 | else { 286 | if (this._customFadeOut === false) { 287 | this._customFadeOut = true; 288 | this.startFadeOut(Liquidize.MadeWithMV.FadeOutTime, false); 289 | } 290 | } 291 | } 292 | } 293 | } 294 | if (Liquidize.MadeWithMV.ShowCustom) { 295 | if (Liquidize.MadeWithMV.ShowMV && this._mvFadeOut === true && this._customFadeOut === true) { 296 | this.gotoTitleOrTest(); 297 | } 298 | else if (!Liquidize.MadeWithMV.ShowMV && this._customFadeOut === true) { 299 | this.gotoTitleOrTest(); 300 | } 301 | } 302 | else { 303 | if (this._mvFadeOut === true) { 304 | this.gotoTitleOrTest(); 305 | } 306 | } 307 | _super.prototype.update.call(this); 308 | }; 309 | ; 310 | return Scene_Splash; 311 | }(Scene_Base)); 312 | })(); 313 | -------------------------------------------------------------------------------- /sample_code/js/SimpleMsgSideView.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // SimpleMsgSideView.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc at sideview battle, only display item/skill names. 6 | * @author Sasuke KANNAZUKI 7 | * 8 | * @param displayAttack 9 | * @desc Whether to display normal attack. 1:yes 0:no 10 | * @default 0 11 | * 12 | * @param position 13 | * @desc Skill name display position. 0:left, 1:center 14 | * @default 1 15 | * 16 | * @help This plugin does not provide plugin commands. 17 | * 18 | * By not displaying the log and only displaying the skill name, 19 | * the speed of battle will increase slightly. 20 | */ 21 | /*:ja 22 | * @plugindesc サイドビューバトルで技/アイテムの名前のみ表示します。 23 | * @author 神無月サスケ 24 | * 25 | * @param displayAttack 26 | * @desc 通常攻撃も表示するか (1:する 0:しない) 27 | * @default 0 28 | * 29 | * @param position 30 | * @desc 技名を表示する位置 (0:左寄せ, 1:中央) 31 | * @default 1 32 | * 33 | * @help このプラグインには、プラグインコマンドはありません。 34 | * 35 | * ログを表示せず、技名のみを表示することで、戦闘のテンポが若干高速になります。 36 | */ 37 | (function () { 38 | var parameters = PluginManager.parameters("SimpleMsgSideView"); 39 | var displayAttack = Number(parameters["displayAttack"]) !== 0; 40 | var position = Number(parameters["position"] || 1); 41 | var _Window_BattleLog_addText = Window_BattleLog.prototype.addText; 42 | Window_BattleLog.prototype.addText = function (text) { 43 | if ($gameSystem.isSideView()) { 44 | this.refresh(); 45 | this.wait(); 46 | return; // not display battle log 47 | } 48 | _Window_BattleLog_addText.call(this, text); 49 | }; 50 | Window_BattleLog.prototype.addItemNameText = function (itemName) { 51 | this._lines.push(itemName); 52 | this.refresh(); 53 | this.wait(); 54 | }; 55 | var _Window_BattleLog_displayAction = Window_BattleLog.prototype.displayAction; 56 | Window_BattleLog.prototype.displayAction = function (subject, item) { 57 | if ($gameSystem.isSideView()) { 58 | if (displayAttack || !(DataManager.isSkill(item) && item.id === subject.attackSkillId())) { 59 | this.push("addItemNameText", item.name); // display item/skill name 60 | } 61 | else { 62 | this.push("wait"); 63 | } 64 | return; 65 | } 66 | _Window_BattleLog_displayAction.call(this, subject, item); 67 | }; 68 | // to put skill/item name at center 69 | var _Window_BattleLog_drawLineText = Window_BattleLog.prototype.drawLineText; 70 | Window_BattleLog.prototype.drawLineText = function (index) { 71 | if ($gameSystem.isSideView() && position === 1) { 72 | var rect = this.itemRectForText(index); 73 | this.contents.clearRect(rect.x, rect.y, rect.width, rect.height); 74 | this.drawText(this._lines[index], rect.x, rect.y, rect.width, "center"); 75 | return; 76 | } 77 | _Window_BattleLog_drawLineText.call(this, index); 78 | }; 79 | })(); 80 | -------------------------------------------------------------------------------- /sample_code/js/TitleCommandPosition.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // TitleCommandPosition.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Changes the position of the title command window. 6 | * @author Yoji Ojima 7 | * 8 | * @param Offset X 9 | * @desc The offset value for the x coordinate. 10 | * @default 0 11 | * 12 | * @param Offset Y 13 | * @desc The offset value for the y coordinate. 14 | * @default 0 15 | * 16 | * @param Width 17 | * @desc The width of the command window. 18 | * @default 240 19 | * 20 | * @param Background 21 | * @desc The background type. 0: Normal, 1: Dim, 2: Transoriginal 22 | * @default 0 23 | * 24 | * @help This plugin does not provide plugin commands. 25 | */ 26 | /*:ja 27 | * @plugindesc タイトルコマンドウィンドウの位置を変更します。 28 | * @author Yoji Ojima 29 | * 30 | * @param Offset X 31 | * @desc X座標のオフセット値です。 32 | * @default 0 33 | * 34 | * @param Offset Y 35 | * @desc Y座標のオフセット値です。 36 | * @default 0 37 | * 38 | * @param Width 39 | * @desc コマンドウィンドウの幅です。 40 | * @default 240 41 | * 42 | * @param Background 43 | * @desc 背景タイプです。0: 通常、1: 暗くする、2: 透明 44 | * @default 0 45 | * 46 | * @help このプラグインには、プラグインコマンドはありません。 47 | */ 48 | (function () { 49 | var parameters = PluginManager.parameters("TitleCommandPosition"); 50 | var offsetX = Number(parameters["Offset X"] || 0); 51 | var offsetY = Number(parameters["Offset Y"] || 0); 52 | var width = Number(parameters["Width"] || 240); 53 | var background = Number(parameters["Background"] || 0); 54 | var _Window_TitleCommand_updatePlacement = Window_TitleCommand.prototype.updatePlacement; 55 | Window_TitleCommand.prototype.updatePlacement = function () { 56 | _Window_TitleCommand_updatePlacement.call(this); 57 | this.x += offsetX; 58 | this.y += offsetY; 59 | this.setBackgroundType(background); 60 | }; 61 | Window_TitleCommand.prototype.windowWidth = function () { 62 | return width; 63 | }; 64 | })(); 65 | -------------------------------------------------------------------------------- /sample_code/js/WeaponSkill.js: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // WeaponSkill.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Change skill id of attack for each weapon. 6 | * @author Sasuke KANNAZUKI 7 | * 8 | * @help This plugin does not provide plugin commands. 9 | * 10 | * When is written in a weapon's note field, 11 | * skill id # 3 is used for the weapon's attack. 12 | * If nothing is written, default id(=1) is used. 13 | * 14 | * Check Points: 15 | * - When multiple weapons are equipped, the skill id of the weapon 16 | * held in the dominant hand (previously defined) is used. 17 | * - It is most favorable for "skill type" to be "none"(=0), 18 | * otherwise you cannot attack when your skill is blocked. 19 | * 20 | * Usage examples of this plugin: 21 | * - to create all-range weapons 22 | * - to create dual-attack or triple-attack weapons 23 | * - If healing skill is set when actor attacks, you can choose a friend to heal. 24 | * - It is possible to make a weapon that functions similar to a guard command. 25 | */ 26 | /*:ja 27 | * @plugindesc 武器ごとに通常攻撃のスキルIDを変更します。 28 | * @author 神無月サスケ 29 | * 30 | * @help このプラグインにはプラグインコマンドはありません。 31 | * 32 | * 武器の「メモ」欄に、 と書いた場合、 33 | * 通常攻撃の際、3番のスキルが発動します。 34 | * ※特に記述がなければ、通常通り1番のスキルが採用されます。 35 | * 36 | * チェックポイント: 37 | * - 二刀流の場合、利き腕(先に定義された方)に持っているスキルIDが採用されます。 38 | * - スキルタイプは「なし」にするのが望ましいです。 39 | * さもなくば、技などを封じられたとき、攻撃が出来なくなります。 40 | * 41 | * 想定される用途: 42 | * - 全体攻撃可能な武器 43 | * - 2回攻撃、3回攻撃する武器 44 | * - 回復魔法をスキルに指定した場合、 45 | * 「攻撃」を選んだ際、味方の選択が出来、その仲間を回復します 46 | * - 防御コマンドなどと同等になる武器も実現可能です。 47 | */ 48 | (function () { 49 | // 50 | // set skill id for attack. 51 | // 52 | Game_Actor.prototype.attackSkillId = function () { 53 | var normalId = Game_BattlerBase.prototype.attackSkillId.call(this); 54 | if (this.hasNoWeapons()) { 55 | return normalId; 56 | } 57 | var weapon = this.weapons()[0]; // at plural weapon, one's first skill. 58 | var id = weapon.meta.skill_id; 59 | return id ? Number(id) : normalId; 60 | }; 61 | // 62 | // for command at battle 63 | // 64 | var _Scene_Battle_commandAttack = Scene_Battle.prototype.commandAttack; 65 | Scene_Battle.prototype.commandAttack = function () { 66 | BattleManager.inputtingAction().setAttack(); 67 | // normal attack weapon (or other single attack weapon) 68 | var action = BattleManager.inputtingAction(); 69 | if (action.needsSelection() && action.isForOpponent()) { 70 | _Scene_Battle_commandAttack.call(this); 71 | return; 72 | } 73 | // special skill weapon 74 | this.onSelectAction(); 75 | }; 76 | })(); 77 | -------------------------------------------------------------------------------- /sample_code/ts/AltMenuScreen.ts: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // AltMenuScreen.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Alternative menu screen layout. 6 | * @author Yoji Ojima 7 | * 8 | * @help This plugin does not provide plugin commands. 9 | */ 10 | /*:ja 11 | * @plugindesc メニュー画面のレイアウトを変更します。 12 | * @author Yoji Ojima 13 | * 14 | * @help このプラグインには、プラグインコマンドはありません。 15 | */ 16 | 17 | (function() { 18 | let _Scene_Menu_create: Function = Scene_Menu.prototype.create; 19 | Scene_Menu.prototype.create = function(this: Scene_Menu): void 20 | { 21 | _Scene_Menu_create.call(this); 22 | 23 | this._statusWindow.x = 0; 24 | this._statusWindow.y = this._commandWindow.height; 25 | this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width; 26 | }; 27 | 28 | Window_MenuCommand.prototype.windowWidth = function(): number 29 | { 30 | return Graphics.boxWidth; 31 | }; 32 | 33 | Window_MenuCommand.prototype.maxCols = function(): number 34 | { 35 | return 4; 36 | }; 37 | 38 | Window_MenuCommand.prototype.numVisibleRows = function(): number 39 | { 40 | return 2; 41 | }; 42 | 43 | Window_MenuStatus.prototype.windowWidth = function(): number 44 | { 45 | return Graphics.boxWidth; 46 | }; 47 | 48 | Window_MenuStatus.prototype.windowHeight = function(): number 49 | { 50 | let h1: number = this.fittingHeight(1); 51 | let h2: number = this.fittingHeight(2); 52 | return Graphics.boxHeight - h1 - h2; 53 | }; 54 | 55 | Window_MenuStatus.prototype.maxCols = function(): number 56 | { 57 | return 4; 58 | }; 59 | 60 | Window_MenuStatus.prototype.numVisibleRows = function(): number 61 | { 62 | return 1; 63 | }; 64 | 65 | Window_MenuStatus.prototype.drawItemImage = function(this: Window_MenuStatus, index: number): void 66 | { 67 | let actor: Game_Actor = $gameParty.members()[index]; 68 | let rect: Rectangle = this.itemRectForText(index); 69 | let w: number = Math.min(rect.width, 144); 70 | let h: number = Math.min(rect.height, 144); 71 | let lineHeight: number = this.lineHeight(); 72 | this.changePaintOpacity(actor.isBattleMember()); 73 | this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h); 74 | this.changePaintOpacity(true); 75 | }; 76 | 77 | Window_MenuStatus.prototype.drawItemStatus = function(this: Window_MenuStatus, index: number): void 78 | { 79 | let actor: Game_Actor = $gameParty.members()[index]; 80 | let rect: Rectangle = this.itemRectForText(index); 81 | let x: number = rect.x; 82 | let y: number = rect.y; 83 | let width: number = rect.width; 84 | let bottom: number = y + rect.height; 85 | let lineHeight: number = this.lineHeight(); 86 | 87 | this.drawActorName(actor, x, y + lineHeight * 0, width); 88 | this.drawActorLevel(actor, x, y + lineHeight * 1); 89 | this.drawActorClass(actor, x, bottom - lineHeight * 4, width); 90 | this.drawActorHp(actor, x, bottom - lineHeight * 3, width); 91 | this.drawActorMp(actor, x, bottom - lineHeight * 2, width); 92 | this.drawActorIcons(actor, x, bottom - lineHeight * 1, width); 93 | }; 94 | 95 | let _Window_MenuActor_initialize: Function = Window_MenuActor.prototype.initialize; 96 | Window_MenuActor.prototype.initialize = function(this: Window_MenuActor): void 97 | { 98 | _Window_MenuActor_initialize.call(this); 99 | this.y = this.fittingHeight(2); 100 | }; 101 | })(); 102 | -------------------------------------------------------------------------------- /sample_code/ts/AltSaveScreen.ts: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // AltSaveScreen.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Alternative save/load screen layout. 6 | * @author Yoji Ojima 7 | * 8 | * @help This plugin does not provide plugin commands. 9 | */ 10 | /*:ja 11 | * @plugindesc セーブ/ロード画面のレイアウトを変更します。 12 | * @author Yoji Ojima 13 | * 14 | * @help このプラグインには、プラグインコマンドはありません。 15 | */ 16 | 17 | interface Window_SavefileList 18 | { 19 | statusWindow: Window_SavefileStatus; 20 | } 21 | 22 | class Window_SavefileStatus extends Window_Base 23 | { 24 | protected _id: number; 25 | protected _mode: string; 26 | 27 | constructor(x: number, y: number, width: number, height: number) 28 | { 29 | super(x, y, width, height); 30 | } 31 | 32 | public initialize(this: Window_SavefileStatus, x?: number, y?: number, width?: number, height?: number): void 33 | { 34 | super.initialize(x, y, width, height); 35 | this._id = 1; 36 | }; 37 | 38 | public setMode(this: Window_SavefileStatus, mode: string): void 39 | { 40 | this._mode = mode; 41 | }; 42 | 43 | public setId(this: Window_SavefileStatus, id: number): void 44 | { 45 | this._id = id; 46 | this.refresh(); 47 | }; 48 | 49 | public refresh(this: Window_SavefileStatus): void 50 | { 51 | this.contents.clear(); 52 | let id: number = this._id; 53 | let valid: boolean = DataManager.isThisGameFile(id); 54 | let info: ISavefileInfo = DataManager.loadSavefileInfo(id); 55 | let rect: Rectangle = this.contents.rect; 56 | this.resetTextColor(); 57 | if (this._mode === "load") 58 | { 59 | this.changePaintOpacity(valid); 60 | } 61 | this.drawFileId(id, rect.x, rect.y); 62 | if (info) 63 | { 64 | this.changePaintOpacity(valid); 65 | this.drawContents(info, rect, valid); 66 | this.changePaintOpacity(true); 67 | } 68 | }; 69 | 70 | public drawFileId(this: Window_SavefileStatus, id: number, x: number, y: number): void 71 | { 72 | this.drawText(TextManager.file + " " + id, x, y, 180); 73 | }; 74 | 75 | public drawContents(this: Window_SavefileStatus, info: ISavefileInfo, rect: Rectangle, valid: boolean): void 76 | { 77 | let bottom: number = rect.y + rect.height; 78 | let playtimeY: number = bottom - this.lineHeight(); 79 | this.drawText(info.title, rect.x + 192, rect.y, rect.width - 192); 80 | if (valid) 81 | { 82 | this.drawPartyfaces(info, rect.x, bottom - 144); 83 | } 84 | this.drawText(info.playtime, rect.x, playtimeY, rect.width, "right"); 85 | }; 86 | 87 | public drawPartyfaces(this: Window_SavefileStatus, info: ISavefileInfo, x: number, y: number): void 88 | { 89 | if (info && info.faces) 90 | { 91 | for (let i: number = 0; i < info.faces.length; i++) 92 | { 93 | let data: [string, number] = info.faces[i]; 94 | this.drawFace(data[0], data[1], x + i * 150, y); 95 | } 96 | } 97 | }; 98 | } 99 | 100 | (function() { 101 | let _Scene_File_create: Function = Scene_File.prototype.create; 102 | Scene_File.prototype.create = function(this: Scene_File): void 103 | { 104 | _Scene_File_create.call(this); 105 | this._listWindow.height = this._listWindow.fittingHeight(8); 106 | 107 | let x: number = 0; 108 | let y: number = this._listWindow.y + this._listWindow.height; 109 | let width: number = Graphics.boxWidth; 110 | let height: number = Graphics.boxHeight - y; 111 | 112 | let statusWindow: Window_SavefileStatus = new Window_SavefileStatus(x, y, width, height); 113 | statusWindow.setMode(this.mode()); 114 | this._listWindow.statusWindow = statusWindow; 115 | this._listWindow.callUpdateHelp(); 116 | this.addWindow(statusWindow); 117 | }; 118 | 119 | let _Scene_File_start: Function = Scene_File.prototype.start; 120 | Scene_File.prototype.start = function(this: Scene_File): void 121 | { 122 | _Scene_File_start.call(this); 123 | this._listWindow.ensureCursorVisible(); 124 | this._listWindow.callUpdateHelp(); 125 | }; 126 | 127 | Window_SavefileList.prototype.spacing = function(): number 128 | { 129 | return 8; 130 | }; 131 | 132 | Window_SavefileList.prototype.maxCols = function(): number 133 | { 134 | return 4; 135 | }; 136 | 137 | Window_SavefileList.prototype.itemHeight = function(): number 138 | { 139 | return this.lineHeight() * 2; 140 | }; 141 | 142 | let _Window_SavefileList_callUpdateHelp: Function = Window_SavefileList.prototype.callUpdateHelp; 143 | Window_SavefileList.prototype.callUpdateHelp = function(this: Window_SavefileList): void 144 | { 145 | _Window_SavefileList_callUpdateHelp.call(this); 146 | 147 | if (this.active && this.statusWindow) 148 | { 149 | this.statusWindow.setId(this.index() + 1); 150 | } 151 | }; 152 | })(); 153 | -------------------------------------------------------------------------------- /sample_code/ts/EnemyBook.ts: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // EnemyBook.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Displays detailed statuses of enemies. 6 | * @author Yoji Ojima 7 | * 8 | * @param Unknown Data 9 | * @desc The index name for an unknown enemy. 10 | * @default ?????? 11 | * 12 | * @help 13 | * 14 | * Plugin Command: 15 | * EnemyBook open # Open the enemy book screen 16 | * EnemyBook add 3 # Add enemy #3 to the enemy book 17 | * EnemyBook remove 4 # Remove enemy #4 from the enemy book 18 | * EnemyBook complete # Complete the enemy book 19 | * EnemyBook clear # Clear the enemy book 20 | * 21 | * Enemy Note: 22 | * # Description text in the enemy book, line 1 23 | * # Description text in the enemy book, line 2 24 | * # This enemy does not appear in the enemy book 25 | */ 26 | /*:ja 27 | * @plugindesc モンスター図鑑です。敵キャラの詳細なステータスを表示します。 28 | * @author Yoji Ojima 29 | * 30 | * @param Unknown Data 31 | * @desc 未確認の敵キャラの索引名です。 32 | * @default ?????? 33 | * 34 | * @help 35 | * 36 | * プラグインコマンド: 37 | * EnemyBook open # 図鑑画面を開く 38 | * EnemyBook add 3 # 敵キャラ3番を図鑑に追加 39 | * EnemyBook remove 4 # 敵キャラ4番を図鑑から削除 40 | * EnemyBook complete # 図鑑を完成させる 41 | * EnemyBook clear # 図鑑をクリアする 42 | * 43 | * 敵キャラのメモ: 44 | * # 説明1行目 45 | * # 説明2行目 46 | * # 図鑑に載せない場合 47 | */ 48 | 49 | interface Game_System 50 | { 51 | _enemyBookFlags?: boolean[]; 52 | 53 | addToEnemyBook?(enemyId: number): void; 54 | removeFromEnemyBook?(enemyId: number): void; 55 | completeEnemyBook?(): void; 56 | clearEnemyBook?(): void; 57 | isInEnemyBook?(enemy: IDataEnemy): boolean; 58 | } 59 | 60 | (function() { 61 | 62 | let parameters: PluginParameters = PluginManager.parameters("EnemyBook"); 63 | let unknownData: string = String(parameters["Unknown Data"] || "??????"); 64 | 65 | let _Game_Interpreter_pluginCommand: Function = Game_Interpreter.prototype.pluginCommand; 66 | Game_Interpreter.prototype.pluginCommand = function(command: string, args: string[]) 67 | { 68 | _Game_Interpreter_pluginCommand.call(this, command, args); 69 | if (command === "EnemyBook") 70 | { 71 | switch (args[0]) 72 | { 73 | case "open": 74 | SceneManager.push(Scene_EnemyBook); 75 | break; 76 | case "add": 77 | $gameSystem.addToEnemyBook(Number(args[1])); 78 | break; 79 | case "remove": 80 | $gameSystem.removeFromEnemyBook(Number(args[1])); 81 | break; 82 | case "complete": 83 | $gameSystem.completeEnemyBook(); 84 | break; 85 | case "clear": 86 | $gameSystem.clearEnemyBook(); 87 | break; 88 | default: 89 | break; 90 | } 91 | } 92 | }; 93 | 94 | Game_System.prototype.addToEnemyBook = function(this: Game_System, enemyId: number): void 95 | { 96 | if (!this._enemyBookFlags) 97 | { 98 | this.clearEnemyBook(); 99 | } 100 | this._enemyBookFlags[enemyId] = true; 101 | }; 102 | 103 | Game_System.prototype.removeFromEnemyBook = function(this: Game_System, enemyId: number): void 104 | { 105 | if (this._enemyBookFlags) 106 | { 107 | this._enemyBookFlags[enemyId] = false; 108 | } 109 | }; 110 | 111 | Game_System.prototype.completeEnemyBook = function(this: Game_System): void 112 | { 113 | this.clearEnemyBook(); 114 | for (let i: number = 1; i < $dataEnemies.length; i++) 115 | { 116 | this._enemyBookFlags[i] = true; 117 | } 118 | }; 119 | 120 | Game_System.prototype.clearEnemyBook = function(this: Game_System): void 121 | { 122 | this._enemyBookFlags = []; 123 | }; 124 | 125 | Game_System.prototype.isInEnemyBook = function(this: Game_System, enemy: IDataEnemy): boolean 126 | { 127 | if (this._enemyBookFlags && enemy) 128 | { 129 | return !!this._enemyBookFlags[enemy.id]; 130 | } 131 | else 132 | { 133 | return false; 134 | } 135 | }; 136 | 137 | let _Game_Troop_setup: Function = Game_Troop.prototype.setup; 138 | Game_Troop.prototype.setup = function(this: Game_Troop, troopId: number): void 139 | { 140 | _Game_Troop_setup.call(this, troopId); 141 | this.members().forEach 142 | ( 143 | function(enemy: Game_Enemy): void 144 | { 145 | if (enemy.isAppeared()) 146 | { 147 | $gameSystem.addToEnemyBook(enemy.enemyId()); 148 | } 149 | }, 150 | this 151 | ); 152 | }; 153 | 154 | let _Game_Enemy_appear: Function = Game_Enemy.prototype.appear; 155 | Game_Enemy.prototype.appear = function(): void 156 | { 157 | _Game_Enemy_appear.call(this); 158 | $gameSystem.addToEnemyBook(this._enemyId); 159 | }; 160 | 161 | let _Game_Enemy_transform: Function = Game_Enemy.prototype.transform; 162 | Game_Enemy.prototype.transform = function(enemyId: number): void 163 | { 164 | _Game_Enemy_transform.call(this, enemyId); 165 | $gameSystem.addToEnemyBook(enemyId); 166 | }; 167 | 168 | class Scene_EnemyBook extends Scene_MenuBase 169 | { 170 | protected _indexWindow: Window_EnemyBookIndex; 171 | protected _statusWindow: Window_EnemyBookStatus; 172 | 173 | public initialize(): void 174 | { 175 | super.initialize(); 176 | } 177 | 178 | public create(this: Scene_EnemyBook): void 179 | { 180 | super.create(); 181 | this._indexWindow = new Window_EnemyBookIndex(0, 0); 182 | this._indexWindow.setHandler("cancel", this.popScene.bind(this)); 183 | let wy: number = this._indexWindow.height; 184 | let ww: number = Graphics.boxWidth; 185 | let wh: number = Graphics.boxHeight - wy; 186 | this._statusWindow = new Window_EnemyBookStatus(0, wy, ww, wh); 187 | this.addWindow(this._indexWindow); 188 | this.addWindow(this._statusWindow); 189 | this._indexWindow.setStatusWindow(this._statusWindow); 190 | } 191 | } 192 | 193 | class Window_EnemyBookIndex extends Window_Selectable 194 | { 195 | public static lastTopRow: number = 0; 196 | public static lastIndex: number = 0; 197 | 198 | protected _list: IDataEnemy[]; 199 | protected _statusWindow: Window_EnemyBookStatus; 200 | 201 | constructor(x: number, y: number) 202 | { 203 | super(x, y); 204 | this.initialize(x, y); 205 | } 206 | 207 | public initialize(this: Window_EnemyBookIndex, x?: number, y?: number): void 208 | { 209 | let width: number = Graphics.boxWidth; 210 | let height: number = this.fittingHeight(6); 211 | super.initialize(x, y, width, height); 212 | this.refresh(); 213 | this.setTopRow(Window_EnemyBookIndex.lastTopRow); 214 | this.select(Window_EnemyBookIndex.lastIndex); 215 | this.activate(); 216 | } 217 | 218 | public maxCols(): number 219 | { 220 | return 3; 221 | } 222 | 223 | public maxItems(this: Window_EnemyBookIndex): number 224 | { 225 | return this._list ? this._list.length : 0; 226 | } 227 | 228 | public setStatusWindow(this: Window_EnemyBookIndex, statusWindow: Window_EnemyBookStatus): void 229 | { 230 | this._statusWindow = statusWindow; 231 | this.updateStatus(); 232 | } 233 | 234 | public update(this: Window_EnemyBookIndex): void 235 | { 236 | super.update(); 237 | this.updateStatus(); 238 | } 239 | 240 | public updateStatus(this: Window_EnemyBookIndex): void 241 | { 242 | if (this._statusWindow) 243 | { 244 | let enemy: IDataEnemy = this._list[this.index()]; 245 | this._statusWindow.setEnemy(enemy); 246 | } 247 | } 248 | 249 | public refresh(this: Window_EnemyBookIndex): void 250 | { 251 | this._list = []; 252 | for (let i: number = 1; i < $dataEnemies.length; i++) 253 | { 254 | let enemy: IDataEnemy = $dataEnemies[i]; 255 | if (enemy.name && enemy.meta.book !== "no") 256 | { 257 | this._list.push(enemy); 258 | } 259 | } 260 | this.createContents(); 261 | this.drawAllItems(); 262 | } 263 | 264 | public drawItem(this: Window_EnemyBookIndex, index: number): void 265 | { 266 | let enemy: IDataEnemy = this._list[index]; 267 | let rect: Rectangle = this.itemRectForText(index); 268 | let name: string; 269 | if ($gameSystem.isInEnemyBook(enemy)) 270 | { 271 | name = enemy.name; 272 | } 273 | else 274 | { 275 | name = unknownData; 276 | } 277 | this.drawText(name, rect.x, rect.y, rect.width); 278 | } 279 | 280 | public processCancel(): void 281 | { 282 | super.processCancel(); 283 | Window_EnemyBookIndex.lastTopRow = this.topRow(); 284 | Window_EnemyBookIndex.lastIndex = this.index(); 285 | }; 286 | } 287 | 288 | class Window_EnemyBookStatus extends Window_Base 289 | { 290 | protected _enemy: IDataEnemy; 291 | protected _enemySprite: Sprite; 292 | 293 | constructor(x: number, y: number, width: number, height: number) 294 | { 295 | super(); 296 | this.initialize(x, y, width, height); 297 | } 298 | 299 | public initialize(this: Window_EnemyBookStatus, x?: number, y?: number, width?: number, height?: number): void 300 | { 301 | super.initialize(x, y, width, height); 302 | this._enemy = null; 303 | this._enemySprite = new Sprite(); 304 | this._enemySprite.anchor.x = 0.5; 305 | this._enemySprite.anchor.y = 0.5; 306 | this._enemySprite.x = width / 2 - 20; 307 | this._enemySprite.y = height / 2; 308 | this.addChildToBack(this._enemySprite); 309 | this.refresh(); 310 | } 311 | 312 | public setEnemy(this: Window_EnemyBookStatus, enemy: IDataEnemy): void 313 | { 314 | if (this._enemy !== enemy) 315 | { 316 | this._enemy = enemy; 317 | this.refresh(); 318 | } 319 | } 320 | 321 | public update(this: Window_EnemyBookStatus): void 322 | { 323 | super.update(); 324 | if (this._enemySprite.bitmap) 325 | { 326 | let bitmapHeight: number = this._enemySprite.bitmap.height; 327 | let contentsHeight: number = this.contents.height; 328 | let scale: number = 1; 329 | if (bitmapHeight > contentsHeight) 330 | { 331 | scale = contentsHeight / bitmapHeight; 332 | } 333 | this._enemySprite.scale.x = scale; 334 | this._enemySprite.scale.y = scale; 335 | } 336 | } 337 | 338 | public refresh(this: Window_EnemyBookStatus): void 339 | { 340 | let enemy: IDataEnemy = this._enemy; 341 | let x: number = 0; 342 | let y: number = 0; 343 | let lineHeight: number = this.lineHeight(); 344 | 345 | this.contents.clear(); 346 | 347 | if (!enemy || !$gameSystem.isInEnemyBook(enemy)) 348 | { 349 | this._enemySprite.bitmap = null; 350 | return; 351 | } 352 | 353 | let name: string = enemy.battlerName; 354 | let hue: number = enemy.battlerHue; 355 | let bitmap: Bitmap; 356 | if ($gameSystem.isSideView()) 357 | { 358 | bitmap = ImageManager.loadSvEnemy(name, hue); 359 | } 360 | else 361 | { 362 | bitmap = ImageManager.loadEnemy(name, hue); 363 | } 364 | this._enemySprite.bitmap = bitmap; 365 | 366 | this.resetTextColor(); 367 | this.drawText(enemy.name, x, y); 368 | 369 | x = this.textPadding(); 370 | y = lineHeight + this.textPadding(); 371 | 372 | for (let i: number = 0; i < 8; i++) 373 | { 374 | this.changeTextColor(this.systemColor()); 375 | this.drawText(TextManager.param(i), x, y, 160); 376 | this.resetTextColor(); 377 | this.drawText(enemy.params[i].toString(), x + 160, y, 60, "right"); 378 | y += lineHeight; 379 | } 380 | 381 | let rewardsWidth: number = 280; 382 | x = this.contents.width - rewardsWidth; 383 | y = lineHeight + this.textPadding(); 384 | 385 | this.resetTextColor(); 386 | this.drawText(enemy.exp.toString(), x, y); 387 | x += this.textWidth(enemy.exp.toString()) + 6; 388 | this.changeTextColor(this.systemColor()); 389 | this.drawText(TextManager.expA, x, y); 390 | x += this.textWidth(TextManager.expA + " "); 391 | 392 | this.resetTextColor(); 393 | this.drawText(enemy.gold.toString(), x, y); 394 | x += this.textWidth(enemy.gold.toString()) + 6; 395 | this.changeTextColor(this.systemColor()); 396 | this.drawText(TextManager.currencyUnit, x, y); 397 | 398 | x = this.contents.width - rewardsWidth; 399 | y += lineHeight; 400 | 401 | for (let j: number = 0; j < enemy.dropItems.length; j++) 402 | { 403 | let di: IDataDropItem = enemy.dropItems[j]; 404 | if (di.kind > 0) 405 | { 406 | let item: IDataAllItem = Game_Enemy.prototype.itemObject(di.kind, di.dataId); 407 | this.drawItemName(item, x, y, rewardsWidth); 408 | y += lineHeight; 409 | } 410 | } 411 | 412 | let descWidth: number = 480; 413 | x = this.contents.width - descWidth; 414 | y = this.textPadding() + lineHeight * 7; 415 | this.drawTextEx(enemy.meta.desc1, x, y + lineHeight * 0); 416 | this.drawTextEx(enemy.meta.desc2, x, y + lineHeight * 1); 417 | }; 418 | } 419 | })(); 420 | -------------------------------------------------------------------------------- /sample_code/ts/ItemBook.ts: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // ItemBook.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Displays detailed statuses of items. 6 | * @author Yoji Ojima 7 | * 8 | * @param Unknown Data 9 | * @desc The index name for an unknown item. 10 | * @default ?????? 11 | * 12 | * @param Price Text 13 | * @desc The text for "Price". 14 | * @default Price 15 | * 16 | * @param Equip Text 17 | * @desc The text for "Equip". 18 | * @default Equip 19 | * 20 | * @param Type Text 21 | * @desc The text for "Type". 22 | * @default Type 23 | * 24 | * @help 25 | * 26 | * Plugin Command: 27 | * ItemBook open # Open the item book screen 28 | * ItemBook add weapon 3 # Add weapon #3 to the item book 29 | * ItemBook add armor 4 # Add armor #4 to the item book 30 | * ItemBook remove armor 5 # Remove armor #5 from the item book 31 | * ItemBook remove item 6 # Remove item #6 from the item book 32 | * ItemBook complete # Complete the item book 33 | * ItemBook clear # Clear the item book 34 | * 35 | * Item (Weapon, Armor) Note: 36 | * # This item does not appear in the item book 37 | */ 38 | /*:ja 39 | * @plugindesc アイテム図鑑です。アイテムの詳細なステータスを表示します。 40 | * @author Yoji Ojima 41 | * 42 | * @param Unknown Data 43 | * @desc 未確認のアイテムの索引名です。 44 | * @default ?????? 45 | * 46 | * @param Price Text 47 | * @desc 「価格」の文字列です。 48 | * @default 価格 49 | * 50 | * @param Equip Text 51 | * @desc 「装備」の文字列です。 52 | * @default 装備 53 | * 54 | * @param Type Text 55 | * @desc 「タイプ」の文字列です。 56 | * @default タイプ 57 | * 58 | * @help 59 | * 60 | * プラグインコマンド: 61 | * ItemBook open # 図鑑画面を開く 62 | * ItemBook add weapon 3 # 武器3番を図鑑に追加 63 | * ItemBook add armor 4 # 防具4番を図鑑に追加 64 | * ItemBook remove armor 5 # 防具5番を図鑑から削除 65 | * ItemBook remove item 6 # アイテム6番を図鑑から削除 66 | * ItemBook complete # 図鑑を完成させる 67 | * ItemBook clear # 図鑑をクリアする 68 | * 69 | * アイテム(武器、防具)のメモ: 70 | * # 図鑑に載せない場合 71 | */ 72 | 73 | interface Game_System 74 | { 75 | _ItemBookFlags?: boolean[][]; 76 | 77 | addToItemBook?(type: string, dataId: number): void; 78 | removeFromItemBook?(type: string, dataId: number): void; 79 | itemBookTypeToIndex?(type: string): number; 80 | completeItemBook?(): void; 81 | clearItemBook?(): void; 82 | isInItemBook?(item: IDataAllItem): boolean; 83 | test?(): void; 84 | } 85 | 86 | (function() 87 | { 88 | let parameters: PluginParameters = PluginManager.parameters("ItemBook"); 89 | let unknownData: string = String(parameters["Unknown Data"] || "??????"); 90 | let priceText: string = String(parameters["Price Text"] || "Price"); 91 | let equipText: string = String(parameters["Equip Text"] || "Equip"); 92 | let typeText: string = String(parameters["Type Text"] || "Type"); 93 | 94 | let _Game_Interpreter_pluginCommand: Function = Game_Interpreter.prototype.pluginCommand; 95 | Game_Interpreter.prototype.pluginCommand = function(command: string, args: string[]): void 96 | { 97 | _Game_Interpreter_pluginCommand.call(this, command, args); 98 | if (command === "ItemBook") 99 | { 100 | switch (args[0]) 101 | { 102 | case "open": 103 | SceneManager.push(Scene_ItemBook); 104 | break; 105 | case "add": 106 | $gameSystem.addToItemBook(args[1], Number(args[2])); 107 | break; 108 | case "remove": 109 | $gameSystem.removeFromItemBook(args[1], Number(args[2])); 110 | break; 111 | case "complete": 112 | $gameSystem.completeItemBook(); 113 | break; 114 | case "clear": 115 | $gameSystem.clearItemBook(); 116 | break; 117 | default: 118 | break; 119 | } 120 | } 121 | }; 122 | 123 | Game_System.prototype.addToItemBook = function(this: Game_System, type: string, dataId: number): void 124 | { 125 | if (!this._ItemBookFlags) 126 | { 127 | this.clearItemBook(); 128 | } 129 | let typeIndex: number = this.itemBookTypeToIndex(type); 130 | if (typeIndex >= 0) 131 | { 132 | this._ItemBookFlags[typeIndex][dataId] = true; 133 | } 134 | }; 135 | 136 | Game_System.prototype.removeFromItemBook = function(this: Game_System, type: string, dataId: number): void 137 | { 138 | if (this._ItemBookFlags) 139 | { 140 | let typeIndex: number = this.itemBookTypeToIndex(type); 141 | if (typeIndex >= 0) 142 | { 143 | this._ItemBookFlags[typeIndex][dataId] = false; 144 | } 145 | } 146 | }; 147 | 148 | Game_System.prototype.itemBookTypeToIndex = function(type: string): number 149 | { 150 | switch (type) 151 | { 152 | case "item": 153 | return 0; 154 | case "weapon": 155 | return 1; 156 | case "armor": 157 | return 2; 158 | default: 159 | return -1; 160 | } 161 | }; 162 | 163 | Game_System.prototype.completeItemBook = function(this: Game_System): void 164 | { 165 | this.clearItemBook(); 166 | for (let i: number = 1; i < $dataItems.length; i++) 167 | { 168 | this._ItemBookFlags[0][i] = true; 169 | } 170 | for (let i: number = 1; i < $dataWeapons.length; i++) 171 | { 172 | this._ItemBookFlags[1][i] = true; 173 | } 174 | for (let i: number = 1; i < $dataArmors.length; i++) 175 | { 176 | this._ItemBookFlags[2][i] = true; 177 | } 178 | }; 179 | 180 | Game_System.prototype.clearItemBook = function(this: Game_System): void 181 | { 182 | this._ItemBookFlags = [[], [], []]; 183 | }; 184 | 185 | Game_System.prototype.isInItemBook = function(this: Game_System, item: IDataAllItem): boolean 186 | { 187 | if (this._ItemBookFlags && item) 188 | { 189 | let typeIndex: number = -1; 190 | if (DataManager.isItem(item)) 191 | { 192 | typeIndex = 0; 193 | } 194 | else if (DataManager.isWeapon(item)) 195 | { 196 | typeIndex = 1; 197 | } 198 | else if (DataManager.isArmor(item)) 199 | { 200 | typeIndex = 2; 201 | } 202 | 203 | if (typeIndex >= 0) 204 | { 205 | return !!this._ItemBookFlags[typeIndex][item.id]; 206 | } 207 | else 208 | { 209 | return false; 210 | } 211 | } 212 | else 213 | { 214 | return false; 215 | } 216 | }; 217 | 218 | let _Game_Party_gainItem: Function = Game_Party.prototype.gainItem; 219 | Game_Party.prototype.gainItem = function(item: IDataItem, amount: number, includeEquip: boolean): void 220 | { 221 | _Game_Party_gainItem.call(this, item, amount, includeEquip); 222 | if (item && amount > 0) 223 | { 224 | let type: string; 225 | if (DataManager.isItem(item)) 226 | { 227 | type = "item"; 228 | } 229 | else if (DataManager.isWeapon(item)) 230 | { 231 | type = "weapon"; 232 | } 233 | else if (DataManager.isArmor(item)) 234 | { 235 | type = "armor"; 236 | } 237 | console.log($gameSystem); 238 | $gameSystem.addToItemBook(type, item.id); 239 | } 240 | }; 241 | 242 | class Scene_ItemBook extends Scene_MenuBase 243 | { 244 | protected _indexWindow: Window_ItemBookIndex; 245 | protected _statusWindow: Window_ItemBookStatus; 246 | 247 | public initialize(): void 248 | { 249 | super.initialize(); 250 | }; 251 | 252 | public create(): void 253 | { 254 | super.create(); 255 | this._indexWindow = new Window_ItemBookIndex(0, 0); 256 | this._indexWindow.setHandler("cancel", this.popScene.bind(this)); 257 | let wy: number = this._indexWindow.height; 258 | let ww: number = Graphics.boxWidth; 259 | let wh: number = Graphics.boxHeight - wy; 260 | this._statusWindow = new Window_ItemBookStatus(0, wy, ww, wh); 261 | this.addWindow(this._indexWindow); 262 | this.addWindow(this._statusWindow); 263 | this._indexWindow.setStatusWindow(this._statusWindow); 264 | } 265 | } 266 | 267 | class Window_ItemBookIndex extends Window_Selectable 268 | { 269 | public static lastTopRow: number = 0; 270 | public static lastIndex: number = 0; 271 | 272 | protected _list: IDataAllItem[]; 273 | protected _statusWindow: Window_ItemBookStatus; 274 | 275 | constructor(x: number, y: number) 276 | { 277 | super(); 278 | this.initialize(x, y); 279 | } 280 | 281 | public initialize(x?: number, y?: number): void 282 | { 283 | let width: number = Graphics.boxWidth; 284 | let height: number = this.fittingHeight(6); 285 | super.initialize(x, y, width, height); 286 | this.refresh(); 287 | this.setTopRow(Window_ItemBookIndex.lastTopRow); 288 | this.select(Window_ItemBookIndex.lastIndex); 289 | this.activate(); 290 | } 291 | 292 | public maxCols(): number 293 | { 294 | return 3; 295 | } 296 | 297 | public maxItems(): number 298 | { 299 | return this._list ? this._list.length : 0; 300 | } 301 | 302 | public setStatusWindow(statusWindow: Window_ItemBookStatus): void 303 | { 304 | this._statusWindow = statusWindow; 305 | this.updateStatus(); 306 | } 307 | 308 | public update(): void 309 | { 310 | super.update(); 311 | this.updateStatus(); 312 | } 313 | 314 | public updateStatus(): void 315 | { 316 | if (this._statusWindow) 317 | { 318 | let item: IDataAllItem = this._list[this.index()]; 319 | this._statusWindow.setItem(item); 320 | } 321 | } 322 | 323 | public refresh(): void 324 | { 325 | this._list = []; 326 | for (let i: number = 1; i < $dataItems.length; i++) 327 | { 328 | let item: IDataItem = $dataItems[i]; 329 | if (item.name && item.itypeId === 1 && item.meta.book !== "no") 330 | { 331 | this._list.push(item); 332 | } 333 | } 334 | for (let i: number = 1; i < $dataWeapons.length; i++) 335 | { 336 | let item: IDataItem = $dataWeapons[i]; 337 | if (item.name && item.meta.book !== "no") 338 | { 339 | this._list.push(item); 340 | } 341 | } 342 | for (let i: number = 1; i < $dataArmors.length; i++) 343 | { 344 | let item: IDataItem = $dataArmors[i]; 345 | if (item.name && item.meta.book !== "no") 346 | { 347 | this._list.push(item); 348 | } 349 | } 350 | this.createContents(); 351 | this.drawAllItems(); 352 | } 353 | 354 | public drawItem(index: number): void 355 | { 356 | let item: IDataAllItem = this._list[index]; 357 | let rect: Rectangle = this.itemRect(index); 358 | let width: number = rect.width - this.textPadding(); 359 | if ($gameSystem.isInItemBook(item)) 360 | { 361 | this.drawItemName(item, rect.x, rect.y, width); 362 | } 363 | else 364 | { 365 | let iw: number = Window_Base._iconWidth + 4; 366 | this.drawText(unknownData, rect.x + iw, rect.y, width - iw); 367 | } 368 | }; 369 | 370 | public processCancel(): void 371 | { 372 | Window_Selectable.prototype.processCancel.call(this); 373 | Window_ItemBookIndex.lastTopRow = this.topRow(); 374 | Window_ItemBookIndex.lastIndex = this.index(); 375 | }; 376 | } 377 | 378 | class Window_ItemBookStatus extends Window_Base 379 | { 380 | protected _item: IDataAllItem; 381 | 382 | constructor(x: number, y: number, width: number, height: number) 383 | { 384 | super(); 385 | this.initialize(x, y, width, height); 386 | } 387 | 388 | public initialize(x?: number, y?: number, width?: number, height?: number): void 389 | { 390 | super.initialize(x, y, width, height); 391 | } 392 | 393 | public setItem(item: IDataAllItem): void 394 | { 395 | if (this._item !== item) 396 | { 397 | this._item = item; 398 | this.refresh(); 399 | } 400 | }; 401 | 402 | public refresh(): void 403 | { 404 | let item: IDataAllItem = this._item; 405 | let x: number = 0; 406 | let y: number = 0; 407 | let lineHeight: number = this.lineHeight(); 408 | 409 | this.contents.clear(); 410 | 411 | if (!item || !$gameSystem.isInItemBook(item)) 412 | { 413 | return; 414 | } 415 | 416 | this.drawItemName(item, x, y); 417 | 418 | x = this.textPadding(); 419 | y = lineHeight + this.textPadding(); 420 | 421 | let price: string = item.price > 0 ? item.price.toString() : "-"; 422 | this.changeTextColor(this.systemColor()); 423 | this.drawText(priceText, x, y, 120); 424 | this.resetTextColor(); 425 | this.drawText(price, x + 120, y, 120, "right"); 426 | y += lineHeight; 427 | 428 | if (DataManager.isWeapon(item) || DataManager.isArmor(item)) 429 | { 430 | let etype: string = $dataSystem.equipTypes[( item).etypeId]; 431 | this.changeTextColor(this.systemColor()); 432 | this.drawText(equipText, x, y, 120); 433 | this.resetTextColor(); 434 | this.drawText(etype, x + 120, y, 120, "right"); 435 | y += lineHeight; 436 | 437 | let type: string; 438 | if (DataManager.isWeapon(item)) 439 | { 440 | type = $dataSystem.weaponTypes[( item).wtypeId]; 441 | } 442 | else 443 | { 444 | type = $dataSystem.armorTypes[( item).atypeId]; 445 | } 446 | this.changeTextColor(this.systemColor()); 447 | this.drawText(typeText, x, y, 120); 448 | this.resetTextColor(); 449 | this.drawText(type, x + 120, y, 120, "right"); 450 | 451 | x = this.textPadding() + 300; 452 | y = lineHeight + this.textPadding(); 453 | for (let i: number = 2; i < 8; i++) 454 | { 455 | this.changeTextColor(this.systemColor()); 456 | this.drawText(TextManager.param(i), x, y, 160); 457 | this.resetTextColor(); 458 | this.drawText(( item).params[i].toString(), x + 160, y, 60, "right"); 459 | y += lineHeight; 460 | } 461 | } 462 | 463 | x = 0; 464 | y = this.textPadding() * 2 + lineHeight * 7; 465 | this.drawTextEx(item.description, x, y); 466 | }; 467 | } 468 | })(); 469 | -------------------------------------------------------------------------------- /sample_code/ts/MadeWithMv.ts: -------------------------------------------------------------------------------- 1 | /*: 2 | * NOTE: Images are stored in the img/system folder. 3 | * 4 | * @plugindesc Show a Splash Screen "Made with MV" and/or a Custom Splash Screen before going to main screen. 5 | * @author Dan "Liquidize" Deptula 6 | * 7 | * @help This plugin does not provide plugin commands. 8 | * 9 | * @param Show Made With MV 10 | * @desc Enabled/Disables showing the "Made with MV" splash screen. 11 | * OFF - false ON - true 12 | * Default: ON 13 | * @default true 14 | * 15 | * @param Made with MV Image 16 | * @desc The image to use when showing "Made with MV" 17 | * Default: MadeWithMv 18 | * @default MadeWithMv 19 | * @require 1 20 | * @dir img/system/ 21 | * @type file 22 | * 23 | * @param Show Custom Splash 24 | * @desc Enabled/Disables showing the "Made with MV" splash screen. 25 | * OFF - false ON - true 26 | * Default: OFF 27 | * @default false 28 | * 29 | * @param Custom Image 30 | * @desc The image to use when showing "Made with MV" 31 | * Default: 32 | * @default 33 | * @require 1 34 | * @dir img/system/ 35 | * @type file 36 | * 37 | * @param Fade Out Time 38 | * @desc The time it takes to fade out, in frames. 39 | * Default: 120 40 | * @default 120 41 | * 42 | * @param Fade In Time 43 | * @desc The time it takes to fade in, in frames. 44 | * Default: 120 45 | * @default 120 46 | * 47 | * @param Wait Time 48 | * @desc The time between fading in and out, in frames. 49 | * Default: 160 50 | * @default 160 51 | * 52 | */ 53 | /*:ja 54 | * メモ: イメージはimg/systemフォルダ内に保存されます。 55 | * 56 | * @plugindesc メイン画面へ進む前に、"Made with MV"のスプラッシュ画面もしくはカスタマイズされたスプラッシュ画面を表示します。 57 | * @author Dan "Liquidize" Deptula 58 | * 59 | * @help このプラグインにはプラグインコマンドはありません。 60 | * 61 | * @param Show Made With MV 62 | * @desc "Made with MV"のスプラッシュ画面を表示できる/できないようにします。 63 | * OFF - false ON - true 64 | * デフォルト: ON 65 | * @default true 66 | * 67 | * @param Made with MV Image 68 | * @desc "Made with MV"を表示する際に使用する画像 69 | * デフォルト: MadeWithMv 70 | * @default MadeWithMv 71 | * @require 1 72 | * @dir img/system/ 73 | * @type file 74 | * 75 | * @param Show Custom Splash 76 | * @desc "Made with MV"のスプラッシュ画面を表示できる/できないようにします。 77 | * OFF - false ON - true 78 | * デフォルト: OFF 79 | * @default false 80 | * 81 | * @param Custom Image 82 | * @desc "Made with MV"を表示する際に使用する画像 83 | * デフォルト: 84 | * @default 85 | * @require 1 86 | * @dir img/system/ 87 | * @type file 88 | * 89 | * @param Fade Out Time 90 | * @desc フェードアウトに要する時間(フレーム数) 91 | * デフォルト: 120 92 | * @default 120 93 | * 94 | * @param Fade In Time 95 | * @desc フェードインに要する時間(フレーム数) 96 | * デフォルト: 120 97 | * @default 120 98 | * 99 | * @param Wait Time 100 | * @desc フェードインからフェードアウトまでに要する時間(フレーム数) 101 | * デフォルト: 160 102 | * @default 160 103 | * 104 | */ 105 | 106 | namespace Liquidize 107 | { 108 | export class MadeWithMV 109 | { 110 | public static Parameters: PluginParameters; 111 | public static ShowMV: any; 112 | public static MVImage: string; 113 | public static ShowCustom: any; 114 | public static CustomImage: string; 115 | public static FadeOutTime: number; 116 | public static FadeInTime: number; 117 | public static WaitTime: number; 118 | } 119 | } 120 | 121 | Liquidize.MadeWithMV.Parameters = PluginManager.parameters("MadeWithMv"); 122 | Liquidize.MadeWithMV.ShowMV = JSON.parse(Liquidize.MadeWithMV.Parameters["Show Made With MV"]); 123 | Liquidize.MadeWithMV.MVImage = String(Liquidize.MadeWithMV.Parameters["Made with MV Image"]); 124 | Liquidize.MadeWithMV.ShowCustom = JSON.parse(Liquidize.MadeWithMV.Parameters["Show Custom Splash"]); 125 | Liquidize.MadeWithMV.CustomImage = String(Liquidize.MadeWithMV.Parameters["Custom Image"]); 126 | Liquidize.MadeWithMV.FadeOutTime = Number(Liquidize.MadeWithMV.Parameters["Fade Out Time"]) || 120; 127 | Liquidize.MadeWithMV.FadeInTime = Number(Liquidize.MadeWithMV.Parameters["Fade In Time"]) || 120; 128 | Liquidize.MadeWithMV.WaitTime = Number(Liquidize.MadeWithMV.Parameters["Wait Time"]) || 160; 129 | 130 | (function() { 131 | 132 | //----------------------------------------------------------------------------- 133 | // Scene_Boot 134 | // 135 | // The scene class for dealing with the game boot. 136 | let _Scene_Boot_loadSystemImages: Function = Scene_Boot.loadSystemImages; 137 | Scene_Boot.loadSystemImages = function(): void 138 | { 139 | _Scene_Boot_loadSystemImages.call(this); 140 | if (Liquidize.MadeWithMV.ShowMV) 141 | { 142 | ImageManager.loadSystem(Liquidize.MadeWithMV.MVImage); 143 | } 144 | if (Liquidize.MadeWithMV.ShowCustom) 145 | { 146 | ImageManager.loadSystem(Liquidize.MadeWithMV.CustomImage); 147 | } 148 | }; 149 | 150 | let _Scene_Boot_start: Function = Scene_Boot.prototype.start; 151 | Scene_Boot.prototype.start = function(): void 152 | { 153 | if ((Liquidize.MadeWithMV.ShowMV || Liquidize.MadeWithMV.ShowCustom) && !DataManager.isBattleTest() && !DataManager.isEventTest()) 154 | { 155 | SceneManager.goto(Scene_Splash); 156 | } 157 | else 158 | { 159 | _Scene_Boot_start.call(this); 160 | } 161 | }; 162 | 163 | //----------------------------------------------------------------------------- 164 | // Scene_Splash 165 | // 166 | // The scene class for dealing with the splash screens. 167 | 168 | class Scene_Splash extends Scene_Base 169 | { 170 | public _mvSplash: Sprite; 171 | public _customSplash: Sprite; 172 | public _mvWaitTime: number; 173 | public _customWaitTime: number; 174 | public _mvFadeOut: boolean; 175 | public _mvFadeIn: boolean; 176 | public _customFadeOut: boolean; 177 | public _customFadeIn: boolean; 178 | 179 | public createSplashes(): void 180 | { 181 | if (Liquidize.MadeWithMV.ShowMV) 182 | { 183 | this._mvSplash = new Sprite(ImageManager.loadSystem(Liquidize.MadeWithMV.MVImage)); 184 | this.addChild(this._mvSplash); 185 | } 186 | if (Liquidize.MadeWithMV.ShowCustom) 187 | { 188 | this._customSplash = new Sprite(ImageManager.loadSystem(Liquidize.MadeWithMV.CustomImage)); 189 | this._customSplash.opacity = 0; 190 | this.addChild(this._customSplash); 191 | } 192 | }; 193 | 194 | public centerSprite(sprite: Sprite): void 195 | { 196 | sprite.x = Graphics.width / 2; 197 | sprite.y = Graphics.height / 2; 198 | sprite.anchor.x = 0.5; 199 | sprite.anchor.y = 0.5; 200 | }; 201 | 202 | public gotoTitleOrTest(): void 203 | { 204 | super.start(); 205 | SoundManager.preloadImportantSounds(); 206 | if (DataManager.isBattleTest()) 207 | { 208 | DataManager.setupBattleTest(); 209 | SceneManager.goto(Scene_Battle); 210 | } 211 | else if (DataManager.isEventTest()) 212 | { 213 | DataManager.setupEventTest(); 214 | SceneManager.goto(Scene_Map); 215 | } 216 | else 217 | { 218 | this.checkPlayerLocation(); 219 | DataManager.setupNewGame(); 220 | SceneManager.goto(Scene_Title); 221 | Window_TitleCommand.initCommandPosition(); 222 | } 223 | this.updateDocumentTitle(); 224 | }; 225 | 226 | public updateDocumentTitle(): void 227 | { 228 | document.title = $dataSystem.gameTitle; 229 | }; 230 | 231 | public checkPlayerLocation(): void 232 | { 233 | if ($dataSystem.startMapId === 0) 234 | { 235 | throw new Error("Player\"s starting position is not set"); 236 | } 237 | }; 238 | 239 | public initialize(): void 240 | { 241 | super.initialize(); 242 | 243 | this._mvSplash = null; 244 | this._customSplash = null; 245 | this._mvWaitTime = Liquidize.MadeWithMV.WaitTime; 246 | this._customWaitTime = Liquidize.MadeWithMV.WaitTime; 247 | this._mvFadeOut = false; 248 | this._mvFadeIn = false; 249 | this._customFadeOut = false; 250 | this._customFadeIn = false; 251 | }; 252 | 253 | public create(): void 254 | { 255 | super.create(); 256 | this.createSplashes(); 257 | }; 258 | 259 | public start(): void 260 | { 261 | super.start(); 262 | SceneManager.clearStack(); 263 | if (this._mvSplash !== null) 264 | { 265 | this.centerSprite(this._mvSplash); 266 | } 267 | if (this._customSplash !== null) 268 | { 269 | this.centerSprite(this._customSplash); 270 | } 271 | }; 272 | 273 | public update(): void 274 | { 275 | if (Liquidize.MadeWithMV.ShowMV) 276 | { 277 | if (!this._mvFadeIn) 278 | { 279 | this.startFadeIn(Liquidize.MadeWithMV.FadeInTime, false); 280 | this._mvFadeIn = true; 281 | } 282 | else 283 | { 284 | if (this._mvWaitTime > 0 && this._mvFadeOut === false) 285 | { 286 | this._mvWaitTime--; 287 | } 288 | else 289 | { 290 | if (this._mvFadeOut === false) 291 | { 292 | this._mvFadeOut = true; 293 | this.startFadeOut(Liquidize.MadeWithMV.FadeOutTime, false); 294 | } 295 | } 296 | } 297 | } 298 | 299 | if (Liquidize.MadeWithMV.ShowCustom) 300 | { 301 | if (Liquidize.MadeWithMV.ShowMV && this._mvFadeOut === true) 302 | { 303 | if (!this._customFadeIn && this._fadeDuration === 0) 304 | { 305 | this._customSplash.opacity = 255; 306 | this._customWaitTime = Liquidize.MadeWithMV.WaitTime; 307 | this.startFadeIn(Liquidize.MadeWithMV.FadeInTime, false); 308 | this._customFadeIn = true; 309 | } 310 | else 311 | { 312 | if (this._customWaitTime > 0 && this._customFadeOut === false) 313 | { 314 | this._customWaitTime--; 315 | } 316 | else 317 | { 318 | if (this._customFadeOut === false) 319 | { 320 | this._customFadeOut = true; 321 | this.startFadeOut(Liquidize.MadeWithMV.FadeOutTime, false); 322 | } 323 | } 324 | } 325 | } 326 | else if (!Liquidize.MadeWithMV.ShowMV) 327 | { 328 | if (!this._customFadeIn) 329 | { 330 | this._customSplash.opacity = 255; 331 | this.startFadeIn(Liquidize.MadeWithMV.FadeInTime, false); 332 | this._customFadeIn = true; 333 | } 334 | else 335 | { 336 | if (this._customWaitTime > 0 && this._customFadeOut === false) 337 | { 338 | this._customWaitTime--; 339 | } 340 | else 341 | { 342 | if (this._customFadeOut === false) 343 | { 344 | this._customFadeOut = true; 345 | this.startFadeOut(Liquidize.MadeWithMV.FadeOutTime, false); 346 | } 347 | } 348 | } 349 | } 350 | } 351 | 352 | if (Liquidize.MadeWithMV.ShowCustom) 353 | { 354 | if (Liquidize.MadeWithMV.ShowMV && this._mvFadeOut === true && this._customFadeOut === true) 355 | { 356 | this.gotoTitleOrTest(); 357 | } 358 | else if (!Liquidize.MadeWithMV.ShowMV && this._customFadeOut === true) 359 | { 360 | this.gotoTitleOrTest(); 361 | } 362 | } 363 | else 364 | { 365 | if (this._mvFadeOut === true) 366 | { 367 | this.gotoTitleOrTest(); 368 | } 369 | } 370 | 371 | super.update(); 372 | }; 373 | } 374 | })(); -------------------------------------------------------------------------------- /sample_code/ts/SimpleMsgSideView.ts: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // SimpleMsgSideView.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc at sideview battle, only display item/skill names. 6 | * @author Sasuke KANNAZUKI 7 | * 8 | * @param displayAttack 9 | * @desc Whether to display normal attack. 1:yes 0:no 10 | * @default 0 11 | * 12 | * @param position 13 | * @desc Skill name display position. 0:left, 1:center 14 | * @default 1 15 | * 16 | * @help This plugin does not provide plugin commands. 17 | * 18 | * By not displaying the log and only displaying the skill name, 19 | * the speed of battle will increase slightly. 20 | */ 21 | /*:ja 22 | * @plugindesc サイドビューバトルで技/アイテムの名前のみ表示します。 23 | * @author 神無月サスケ 24 | * 25 | * @param displayAttack 26 | * @desc 通常攻撃も表示するか (1:する 0:しない) 27 | * @default 0 28 | * 29 | * @param position 30 | * @desc 技名を表示する位置 (0:左寄せ, 1:中央) 31 | * @default 1 32 | * 33 | * @help このプラグインには、プラグインコマンドはありません。 34 | * 35 | * ログを表示せず、技名のみを表示することで、戦闘のテンポが若干高速になります。 36 | */ 37 | 38 | interface Window_BattleLog 39 | { 40 | addItemNameText?(itemName: string): void; 41 | } 42 | 43 | (function() { 44 | 45 | let parameters: PluginParameters = PluginManager.parameters("SimpleMsgSideView"); 46 | let displayAttack: boolean = Number(parameters["displayAttack"]) !== 0; 47 | let position: number = Number(parameters["position"] || 1); 48 | 49 | let _Window_BattleLog_addText: Function = Window_BattleLog.prototype.addText; 50 | Window_BattleLog.prototype.addText = function(this: Window_BattleLog, text: string): void 51 | { 52 | if ($gameSystem.isSideView()) 53 | { 54 | this.refresh(); 55 | this.wait(); 56 | return; // not display battle log 57 | } 58 | _Window_BattleLog_addText.call(this, text); 59 | }; 60 | 61 | Window_BattleLog.prototype.addItemNameText = function(this: Window_BattleLog, itemName: string): void 62 | { 63 | this._lines.push(itemName); 64 | this.refresh(); 65 | this.wait(); 66 | }; 67 | 68 | let _Window_BattleLog_displayAction: Function = Window_BattleLog.prototype.displayAction; 69 | Window_BattleLog.prototype.displayAction = function(this: Window_BattleLog, subject: Game_Battler, item: IDataItem): void 70 | { 71 | if ($gameSystem.isSideView()) 72 | { 73 | if (displayAttack || !(DataManager.isSkill(item) && item.id === subject.attackSkillId())) 74 | { 75 | this.push("addItemNameText", item.name); // display item/skill name 76 | } 77 | else 78 | { 79 | this.push("wait"); 80 | } 81 | return; 82 | } 83 | _Window_BattleLog_displayAction.call(this, subject, item); 84 | }; 85 | 86 | // to put skill/item name at center 87 | let _Window_BattleLog_drawLineText: Function = Window_BattleLog.prototype.drawLineText; 88 | Window_BattleLog.prototype.drawLineText = function(this: Window_BattleLog, index: number): void 89 | { 90 | if ($gameSystem.isSideView() && position === 1) 91 | { 92 | let rect: Rectangle = this.itemRectForText(index); 93 | this.contents.clearRect(rect.x, rect.y, rect.width, rect.height); 94 | this.drawText(this._lines[index], rect.x, rect.y, rect.width, "center"); 95 | return; 96 | } 97 | _Window_BattleLog_drawLineText.call(this, index); 98 | }; 99 | })(); 100 | -------------------------------------------------------------------------------- /sample_code/ts/TitleCommandPosition.ts: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // TitleCommandPosition.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Changes the position of the title command window. 6 | * @author Yoji Ojima 7 | * 8 | * @param Offset X 9 | * @desc The offset value for the x coordinate. 10 | * @default 0 11 | * 12 | * @param Offset Y 13 | * @desc The offset value for the y coordinate. 14 | * @default 0 15 | * 16 | * @param Width 17 | * @desc The width of the command window. 18 | * @default 240 19 | * 20 | * @param Background 21 | * @desc The background type. 0: Normal, 1: Dim, 2: Transoriginal 22 | * @default 0 23 | * 24 | * @help This plugin does not provide plugin commands. 25 | */ 26 | /*:ja 27 | * @plugindesc タイトルコマンドウィンドウの位置を変更します。 28 | * @author Yoji Ojima 29 | * 30 | * @param Offset X 31 | * @desc X座標のオフセット値です。 32 | * @default 0 33 | * 34 | * @param Offset Y 35 | * @desc Y座標のオフセット値です。 36 | * @default 0 37 | * 38 | * @param Width 39 | * @desc コマンドウィンドウの幅です。 40 | * @default 240 41 | * 42 | * @param Background 43 | * @desc 背景タイプです。0: 通常、1: 暗くする、2: 透明 44 | * @default 0 45 | * 46 | * @help このプラグインには、プラグインコマンドはありません。 47 | */ 48 | (function () { 49 | let parameters: PluginParameters = PluginManager.parameters("TitleCommandPosition"); 50 | let offsetX: number = Number(parameters["Offset X"] || 0); 51 | let offsetY: number = Number(parameters["Offset Y"] || 0); 52 | let width: number = Number(parameters["Width"] || 240); 53 | let background: number = Number(parameters["Background"] || 0); 54 | 55 | let _Window_TitleCommand_updatePlacement: Function = Window_TitleCommand.prototype.updatePlacement; 56 | Window_TitleCommand.prototype.updatePlacement = function(this: Window_TitleCommand): void 57 | { 58 | _Window_TitleCommand_updatePlacement.call(this); 59 | this.x += offsetX; 60 | this.y += offsetY; 61 | this.setBackgroundType(background); 62 | }; 63 | 64 | Window_TitleCommand.prototype.windowWidth = function(): number 65 | { 66 | return width; 67 | }; 68 | })(); 69 | -------------------------------------------------------------------------------- /sample_code/ts/WeaponSkill.ts: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // WeaponSkill.js 3 | //============================================================================= 4 | /*: 5 | * @plugindesc Change skill id of attack for each weapon. 6 | * @author Sasuke KANNAZUKI 7 | * 8 | * @help This plugin does not provide plugin commands. 9 | * 10 | * When is written in a weapon's note field, 11 | * skill id # 3 is used for the weapon's attack. 12 | * If nothing is written, default id(=1) is used. 13 | * 14 | * Check Points: 15 | * - When multiple weapons are equipped, the skill id of the weapon 16 | * held in the dominant hand (previously defined) is used. 17 | * - It is most favorable for "skill type" to be "none"(=0), 18 | * otherwise you cannot attack when your skill is blocked. 19 | * 20 | * Usage examples of this plugin: 21 | * - to create all-range weapons 22 | * - to create dual-attack or triple-attack weapons 23 | * - If healing skill is set when actor attacks, you can choose a friend to heal. 24 | * - It is possible to make a weapon that functions similar to a guard command. 25 | */ 26 | /*:ja 27 | * @plugindesc 武器ごとに通常攻撃のスキルIDを変更します。 28 | * @author 神無月サスケ 29 | * 30 | * @help このプラグインにはプラグインコマンドはありません。 31 | * 32 | * 武器の「メモ」欄に、 と書いた場合、 33 | * 通常攻撃の際、3番のスキルが発動します。 34 | * ※特に記述がなければ、通常通り1番のスキルが採用されます。 35 | * 36 | * チェックポイント: 37 | * - 二刀流の場合、利き腕(先に定義された方)に持っているスキルIDが採用されます。 38 | * - スキルタイプは「なし」にするのが望ましいです。 39 | * さもなくば、技などを封じられたとき、攻撃が出来なくなります。 40 | * 41 | * 想定される用途: 42 | * - 全体攻撃可能な武器 43 | * - 2回攻撃、3回攻撃する武器 44 | * - 回復魔法をスキルに指定した場合、 45 | * 「攻撃」を選んだ際、味方の選択が出来、その仲間を回復します 46 | * - 防御コマンドなどと同等になる武器も実現可能です。 47 | */ 48 | 49 | (function() { 50 | 51 | // 52 | // set skill id for attack. 53 | // 54 | Game_Actor.prototype.attackSkillId = function(this: Game_Actor): number 55 | { 56 | let normalId: number = Game_BattlerBase.prototype.attackSkillId.call(this); 57 | if (this.hasNoWeapons()) 58 | { 59 | return normalId; 60 | } 61 | let weapon: IDataWeapon = this.weapons()[0]; // at plural weapon, one's first skill. 62 | let id: string = weapon.meta.skill_id; 63 | return id ? Number(id) : normalId; 64 | }; 65 | 66 | // 67 | // for command at battle 68 | // 69 | let _Scene_Battle_commandAttack: Function = Scene_Battle.prototype.commandAttack; 70 | Scene_Battle.prototype.commandAttack = function(): void 71 | { 72 | BattleManager.inputtingAction().setAttack(); 73 | // normal attack weapon (or other single attack weapon) 74 | let action: Game_Action = BattleManager.inputtingAction(); 75 | 76 | if (action.needsSelection() && action.isForOpponent()) 77 | { 78 | _Scene_Battle_commandAttack.call(this); 79 | return; 80 | } 81 | // special skill weapon 82 | this.onSelectAction(); 83 | }; 84 | })(); -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "baseUrl": "sample_code/ts", 6 | "outDir": "sample_code/js", 7 | "inlineSourceMap": false, 8 | "noFallthroughCasesInSwitch": true, 9 | "noImplicitAny": true, 10 | "noImplicitThis": true, 11 | "removeComments": false, 12 | "experimentalDecorators": true, 13 | "lib": [ 14 | "es5" 15 | ] 16 | }, 17 | "include": [ 18 | "sample_code/ts/**/*", 19 | "typings/**/*" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /typings/rpgmakermv/data.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * jsonで保存されている段階のデータ型 3 | * 4 | * metaキーを除いたものになります。 5 | * 6 | * @example 7 | * type IJsonDataState = JsonDataOf; 8 | */ 9 | declare type JsonDataOf = Pick; 10 | 11 | /** "id"をもつデータ */ 12 | declare interface IHasId { 13 | /** ID */ 14 | id: number; 15 | } 16 | 17 | /** "note"をもつデータ */ 18 | declare interface IHasNote { 19 | /** メモ */ 20 | note: string; 21 | /** メタ情報 */ 22 | meta: IDataMeta; 23 | } 24 | 25 | declare interface IDataSound 26 | { 27 | name: string; 28 | pan: number; 29 | pitch: number; 30 | volume: number; 31 | } 32 | 33 | declare interface IDataTrait 34 | { 35 | code: number; 36 | dataId: number; 37 | value: number; 38 | } 39 | 40 | /** 使用効果 */ 41 | declare interface IDataEffect 42 | { 43 | code: number; 44 | dataId: number; 45 | value1: number; 46 | value2: number; 47 | } 48 | 49 | declare interface IDataAction 50 | { 51 | conditionParam1: number; 52 | conditionParam2: number; 53 | conditionType: number; 54 | rating: number; 55 | skillId: number; 56 | } 57 | 58 | /** イベントコマンド */ 59 | declare interface IDataList 60 | { 61 | code: number; 62 | indent: number; 63 | parameters: Array; 64 | } 65 | 66 | declare interface IDataMoveRouteCommand 67 | { 68 | code: number; 69 | parameters: number[]; 70 | } 71 | 72 | declare interface IDataMoveRoute 73 | { 74 | list: IDataMoveRouteCommand[]; 75 | repeat: boolean; 76 | skippable: boolean; 77 | wait: boolean; 78 | } 79 | 80 | /** アクター */ 81 | declare interface IDataActor extends IHasId, IHasNote 82 | { 83 | battlerName: string; 84 | characterIndex: number; 85 | characterName: string; 86 | classId: number; 87 | equips: number[]; 88 | faceIndex: number; 89 | faceName: string; 90 | traits: IDataTrait[]; 91 | initialLevel: number; 92 | maxLevel: number; 93 | name: string; 94 | nickname: string; 95 | profile: string; 96 | } 97 | 98 | /** 職業 */ 99 | declare interface IDataClass extends IHasId, IHasNote 100 | { 101 | expParams: number[]; 102 | traits: IDataTrait[]; 103 | learnings: { 104 | level: number; 105 | note: string; 106 | skillId: number; 107 | }[]; 108 | name: string; 109 | params: number[][]; 110 | } 111 | 112 | /** スキル */ 113 | declare interface IDataSkill extends IHasId, IHasNote 114 | { 115 | /** アニメーション */ 116 | animationId: number; 117 | /** ダメージ */ 118 | damage: { 119 | /** 会心 */ 120 | critical: boolean; 121 | /** 属性 */ 122 | elementId: number; 123 | /** 計算式 */ 124 | formula: string; 125 | /** タイプ */ 126 | type: number; 127 | /** 分散度 */ 128 | variance: number; 129 | } 130 | /** 説明 */ 131 | description: string; 132 | /** 使用効果 */ 133 | effects: IDataEffect[]; 134 | /** 命中タイプ */ 135 | hitType: number; 136 | /** アイコン */ 137 | iconIndex: number; 138 | /** メッセージ (使用者の名前)~ */ 139 | message1: string; 140 | /** メッセージ */ 141 | message2: string; 142 | /** 消費MP */ 143 | mpCost: number; 144 | /** 名前 */ 145 | name: string; 146 | /** 使用可能時 */ 147 | occasion: number; 148 | /** 連続回数 */ 149 | repeats: number; 150 | /** 武器タイプ1 */ 151 | requiredWtypeId1: number; 152 | /** 武器タイプ2 */ 153 | requiredWtypeId2: number; 154 | /** 範囲 */ 155 | scope: number; 156 | /** 速度補正 */ 157 | speed: number; 158 | /** スキルタイプ */ 159 | stypeId: number; 160 | /** 成功率 */ 161 | successRate: number; 162 | /** 消費TP */ 163 | tpCost: number; 164 | /** 得TP */ 165 | tpGain: number; 166 | } 167 | 168 | /** 全アイテム共通 */ 169 | declare interface IDataAllItem extends IHasId, IHasNote 170 | { 171 | description: string; 172 | name: string; 173 | iconIndex: number; 174 | price: number; 175 | } 176 | 177 | /** アイテム */ 178 | declare interface IDataItem extends IDataAllItem 179 | { 180 | animationId: number; 181 | consumable: boolean; 182 | damage: { 183 | critical: boolean; 184 | elementId: number; 185 | formula: string; 186 | type: number; 187 | variance: number; 188 | } 189 | effects: IDataEffect[]; 190 | hitType: number; 191 | itypeId: number; 192 | occasion: number; 193 | repeats: number; 194 | scope: number; 195 | speed: number; 196 | successRate: number; 197 | tpGain: number; 198 | } 199 | 200 | /** 装備アイテム */ 201 | declare interface IDataEquipItem extends IDataAllItem 202 | { 203 | etypeId: number; 204 | traits: IDataTrait[]; 205 | params: number[]; 206 | } 207 | 208 | /** 武器 */ 209 | declare interface IDataWeapon extends IDataEquipItem 210 | { 211 | animationId: number; 212 | wtypeId: number; 213 | } 214 | 215 | /** 防具 */ 216 | declare interface IDataArmor extends IDataEquipItem 217 | { 218 | atypeId: number; 219 | } 220 | 221 | /** ドロップアイテム */ 222 | declare interface IDataDropItem 223 | { 224 | kind: number; 225 | dataId: number; 226 | denominator: number; 227 | } 228 | 229 | /** 敵 */ 230 | declare interface IDataEnemy extends IHasId, IHasNote 231 | { 232 | actions: IDataAction[]; 233 | battlerHue: number; 234 | battlerName: string; 235 | dropItems: IDataDropItem[]; 236 | exp: number; 237 | traits: IDataTrait[]; 238 | gold: number; 239 | name: string; 240 | params: number[]; 241 | } 242 | 243 | declare interface IDataPage 244 | { 245 | conditions: { 246 | actorHP: number; 247 | actorId: number; 248 | actorValid: boolean; 249 | enemyHp: number; 250 | enemyIndex: number; 251 | enemyValid: boolean; 252 | switchId: number; 253 | switchValid: boolean; 254 | turnA: number; 255 | turnB: number; 256 | turnEnding: boolean; 257 | turnValid: boolean; 258 | }; 259 | list: IDataList[]; 260 | span: number; 261 | } 262 | 263 | /** 敵グループ */ 264 | declare interface IDataTroop extends IHasId 265 | { 266 | members: { 267 | enemyId: number; 268 | x: number; 269 | y: number; 270 | hidden: boolean; 271 | }[]; 272 | name: string; 273 | pages: IDataPage[]; 274 | } 275 | 276 | /** ステート */ 277 | declare interface IDataState extends IHasId, IHasNote 278 | { 279 | autoRemovalTiming: number; 280 | chanceByDamage: number; 281 | iconIndex: number; 282 | maxTurns: number; 283 | message1: string; 284 | message2: string; 285 | message3: string; 286 | message4: string; 287 | minTurns: number; 288 | motion: number; 289 | name: string; 290 | overlay: number; 291 | priority: number; 292 | releaseByDamage: boolean; 293 | removeAtBattleEnd: boolean; 294 | removeByDamage: boolean; 295 | removeByRestriction: boolean; 296 | removeByWalking: boolean; 297 | restriction: number; 298 | stepsToRemove: number; 299 | traits: IDataTrait[]; 300 | } 301 | 302 | declare interface IDataAnimationTiming 303 | { 304 | flashColor: number[]; 305 | flashDuration: number; 306 | flashScope: number; 307 | frame: number; 308 | se: IDataSound; 309 | } 310 | 311 | /** アニメーション */ 312 | declare interface IDataAnimation extends IHasId 313 | { 314 | animation1Hue: number; 315 | animation1Name: string; 316 | animation2Hue: number; 317 | animation2Name: string; 318 | frames: number[][][]; 319 | name: string; 320 | position: number; 321 | timings: IDataAnimationTiming[]; 322 | } 323 | 324 | /** タイルセット */ 325 | declare interface IDataTileset extends IHasId, IHasNote 326 | { 327 | flags: number[]; 328 | mode: number; 329 | name: string; 330 | tilesetNames: string[]; 331 | } 332 | 333 | /** コモンイベント */ 334 | declare interface IDataCommonEvent extends IHasId 335 | { 336 | list: IDataList[]; 337 | name: string; 338 | switchId: number; 339 | trigger: number; 340 | } 341 | 342 | /** 乗り物 */ 343 | declare interface IVehicle 344 | { 345 | bgm: IDataSound; 346 | characterIndex: number; 347 | characterName: string; 348 | startMapId: number; 349 | startX: number; 350 | startY: number; 351 | } 352 | 353 | /** システム */ 354 | declare interface IDataSystem 355 | { 356 | airship: IVehicle; 357 | armorTypes: string[]; 358 | attackMotions: { 359 | type: number; 360 | weaponImageId: number; 361 | }[]; 362 | battleBgm: IDataSound; 363 | battleback1Name: string; 364 | battleback2Name: string; 365 | battlerHue: number; 366 | battlerName: string; 367 | boat: IVehicle; 368 | currencyUnit: string; 369 | defeatMe: IDataSound; 370 | editMapId: number; 371 | elements: string[]; 372 | equipTypes: string[]; 373 | gameTitle: string; 374 | gameoverMe: IDataSound; 375 | locale: string; 376 | magicSkills: number[]; 377 | menuCommands: boolean[]; 378 | optDisplayTp: boolean; 379 | optDrawTitle: boolean; 380 | optExtraExp: boolean; 381 | optFloorDeath: boolean; 382 | optFollowers: boolean; 383 | optSideView: boolean; 384 | optSlipDeath: boolean; 385 | optTransparent: boolean; 386 | partyMembers: number[]; 387 | ship: IVehicle; 388 | skillTypes: string[]; 389 | sounds: IDataSound[]; 390 | startMapId: number; 391 | startX: number; 392 | startY: number; 393 | switches: string[]; 394 | terms: { 395 | basic: string[]; 396 | commands: string[]; 397 | params: string[]; 398 | messages: { 399 | possession: string; 400 | expTotal: string; 401 | expNext: string; 402 | saveMessage: string; 403 | loadMessage: string; 404 | file: string; 405 | partyName: string; 406 | emerge: string; 407 | preemptive: string; 408 | surprise: string; 409 | escapeStart: string; 410 | escapeFailure: string; 411 | victory: string; 412 | defeat: string; 413 | obtainExp: string; 414 | obtainGold: string; 415 | obtainItem: string; 416 | levelUp: string; 417 | obtainSkill: string; 418 | useItem: string; 419 | criticalToEnemy: string; 420 | criticalToActor: string; 421 | actorDamage: string; 422 | actorRecovery: string; 423 | actorGain: string; 424 | actorLoss: string; 425 | actorDrain: string; 426 | actorNoDamage: string; 427 | actorNoHit: string; 428 | enemyDamage: string; 429 | enemyRecovery: string; 430 | enemyGain: string; 431 | enemyLoss: string; 432 | enemyDrain: string; 433 | enemyNoDamage: string; 434 | enemyNoHit: string; 435 | evasion: string; 436 | magicEvasion: string; 437 | magicReflection: string; 438 | counterAttack: string; 439 | substitute: string; 440 | buffAdd: string; 441 | debuffAdd: string; 442 | buffRemove: string; 443 | actionFailure: string; 444 | bgmVolume: string; 445 | bgsVolume: string; 446 | meVolume: string; 447 | seVolume: string; 448 | alwaysDash: string; 449 | commandRemember: string; 450 | }; 451 | }; 452 | testBattlers: { 453 | actorId: number; 454 | equips: number[]; 455 | level: number; 456 | }[]; 457 | testTroopId: number; 458 | title1Name: string; 459 | title2Name: string; 460 | titleBgm: IDataSound; 461 | variables: string[]; 462 | versionId: number; 463 | victoryMe: IDataSound; 464 | weaponTypes: string; 465 | windowTone: number[]; 466 | } 467 | 468 | /** マップ情報 */ 469 | declare interface IDataMapInfo extends IHasId 470 | { 471 | expanded: boolean; 472 | name: string; 473 | order: number; 474 | parentId: number; 475 | scrollX: number; 476 | scrollY: number; 477 | } 478 | 479 | declare interface IDataEncounterList 480 | { 481 | regionSet: number[]; 482 | troopId: number; 483 | weight: number; 484 | } 485 | 486 | declare interface IDataMapEventPage 487 | { 488 | conditions: { 489 | actorId: number; 490 | actorValid: boolean; 491 | itemId: number; 492 | itemValid: boolean; 493 | selfSwitchCh: string; 494 | selfSwitchValid: boolean; 495 | switch1Id: number; 496 | switch1Valid: boolean; 497 | switch2Id: number; 498 | switch2Valid: boolean; 499 | variableId: number; 500 | variableValid: boolean; 501 | variableValue: number; 502 | }; 503 | directionFix: boolean; 504 | image: { 505 | tileId: number; 506 | characterName: string; 507 | direction: number; 508 | pattern: number; 509 | characterIndex: number; 510 | } 511 | list: IDataList[]; 512 | moveFrequency: number; 513 | moveRoute: { 514 | list: { 515 | code: number; 516 | parameters: number[]; 517 | }[]; 518 | repeat: boolean; 519 | skippable: boolean; 520 | wait: boolean; 521 | }; 522 | moveSpeed: number; 523 | moveType: number; 524 | priorityType: number; 525 | stepAnime: boolean; 526 | through: boolean; 527 | trigger: number; 528 | walkAnime: boolean; 529 | } 530 | 531 | declare interface IDataMapEvent extends IHasId, IHasNote 532 | { 533 | name: string; 534 | pages: IDataMapEventPage[]; 535 | } 536 | 537 | /** マップ */ 538 | declare interface IDataMap extends IHasNote 539 | { 540 | autoplayBgm: boolean; 541 | autoplayBgs: boolean; 542 | battleback1Name: string; 543 | battleback2Name: string; 544 | bgm: IDataSound; 545 | bgs: IDataSound; 546 | disableDashing: boolean; 547 | displayName: string; 548 | encounterList: IDataEncounterList[]; 549 | encounterStep: number; 550 | height: number; 551 | parallaxLoopX: boolean; 552 | parallaxLoopY: boolean; 553 | parallaxName: string; 554 | parallaxShow: boolean; 555 | parallaxSx: number; 556 | parallaxSy: number; 557 | scrollType: number; 558 | specifyBattleback: boolean; 559 | tilesetId: number; 560 | width: number; 561 | data: number[]; 562 | events: IDataMapEvent[]; 563 | } 564 | 565 | /** メタ情報 */ 566 | declare interface IDataMeta { 567 | [name: string]: string | true; 568 | } 569 | -------------------------------------------------------------------------------- /typings/rpgmakermv/rpg_managers.d.ts: -------------------------------------------------------------------------------- 1 | /** アクターのデータ */ 2 | declare var $dataActors : IDataActor[]; 3 | /** 職業のデータ */ 4 | declare var $dataClasses : IDataClass[]; 5 | /** スキルのデータ */ 6 | declare var $dataSkills : IDataSkill[]; 7 | /** アイテムのデータ */ 8 | declare var $dataItems : IDataItem[]; 9 | /** 武器のデータ */ 10 | declare var $dataWeapons : IDataWeapon[]; 11 | /** 防具のデータ */ 12 | declare var $dataArmors : IDataArmor[]; 13 | /** 敵のデータ */ 14 | declare var $dataEnemies : IDataEnemy[]; 15 | /** 敵グループのデータ */ 16 | declare var $dataTroops : IDataTroop[]; 17 | /** ステートのデータ */ 18 | declare var $dataStates : IDataState[]; 19 | /** アニメーションのデータ */ 20 | declare var $dataAnimations : IDataAnimation[]; 21 | /** タイルセットのデータ */ 22 | declare var $dataTilesets : IDataTileset[]; 23 | /** コモンイベントのデータ */ 24 | declare var $dataCommonEvents: IDataCommonEvent[]; 25 | /** システムのデータ */ 26 | declare var $dataSystem : IDataSystem; 27 | /** マップ情報のデータ */ 28 | declare var $dataMapInfos : IDataMapInfo[]; 29 | /** マップのデータ */ 30 | declare var $dataMap : IDataMap; 31 | declare var $gameTemp : Game_Temp; 32 | declare var $gameSystem : Game_System; 33 | declare var $gameScreen : Game_Screen; 34 | declare var $gameTimer : Game_Timer; 35 | declare var $gameMessage : Game_Message; 36 | declare var $gameSwitches : Game_Switches; 37 | declare var $gameVariables : Game_Variables; 38 | declare var $gameSelfSwitches: Game_SelfSwitches; 39 | declare var $gameMap : Game_Map; 40 | declare var $gameActors : Game_Actors; 41 | declare var $gameParty : Game_Party; 42 | declare var $gameTroop : Game_Troop; 43 | declare var $gamePlayer : Game_Player; 44 | declare var $testEvent : any; // TODO 45 | 46 | declare interface ISavefileInfo 47 | { 48 | globalId?: number; 49 | title?: string; 50 | characters?: [string, number][]; 51 | faces?: [string, number][]; 52 | playtime?: string; 53 | timestamp?: number; 54 | } 55 | 56 | declare interface ISaveContents 57 | { 58 | system? : Game_System; 59 | screen? : Game_Screen; 60 | timer? : Game_Timer; 61 | switches? : Game_Switches; 62 | variables? : Game_Variables; 63 | selfSwitches? : Game_SelfSwitches; 64 | actors? : Game_Actors; 65 | party? : Game_Party; 66 | map? : Game_Map; 67 | player? : Game_Player; 68 | } 69 | 70 | /** データマネージャー */ 71 | declare class DataManager 72 | { 73 | private constructor(); 74 | 75 | static _globalId : "RPGMV"; 76 | static _lastAccessedId : number; 77 | static _errorUrl : string; 78 | 79 | static _databaseFiles: {name: string, src: string}[]; 80 | /** 81 | * データベースを読む 82 | * 83 | * バトルテストとイベントテストの場合はActors.jsonなどではなくTest_Actors.jsonなどをよむ 84 | */ 85 | static loadDatabase(): void; 86 | /** 87 | * データファイルを読む 88 | * @param name 格納する変数名 89 | * @param src ファイルのURL部分 `data/${src}`が使われる 90 | */ 91 | static loadDataFile(name: string, src: string): void; 92 | static isDatabaseLoaded(): boolean; 93 | /** 94 | * マップデータを読む 95 | * 96 | * `Map${mapId}.json` 97 | * @param mapId マップID 3桁にゼロパディングされて使われる 98 | */ 99 | static loadMapData(mapId: number) : void; 100 | /** 101 | * $dataMapに空のデータをセットする 102 | */ 103 | static makeEmptyMap(): void; 104 | static isMapLoaded(): boolean; 105 | static onLoad(object: IDataActor[] | IDataClass[] | IDataSkill[] | IDataItem[] | IDataWeapon[] | IDataArmor[] | IDataEnemy[] | IDataTroop[] | IDataState[] | IDataAnimation[] | IDataTileset[] | IDataCommonEvent[] | IDataSystem[] | IDataMapInfo[] | IDataMap[]): void; 106 | /** 107 | * メタ情報を展開し、metaプロパティに入れる 108 | * 109 | * ``は`{foo: true}`, ``は`{foo: "bar"}`と展開される 110 | * @param data データ 111 | */ 112 | static extractMetadata(data: IDataActor[] | IDataClass[] | IDataSkill[] | IDataItem[] | IDataWeapon[] | IDataArmor[] | IDataEnemy[] | IDataTroop[] | IDataState[] | IDataAnimation[] | IDataTileset[] | IDataCommonEvent[] | IDataSystem[] | IDataMapInfo[] | IDataMap[]): void; 113 | /** 114 | * _errorUrlがあれば例外を投げる 115 | */ 116 | static checkError(): void; 117 | /** 118 | * バトルテストか? 119 | * 120 | * クエリに"btest"が存在するか 121 | */ 122 | static isBattleTest(): boolean; 123 | /** 124 | * イベントテストか? 125 | * 126 | * クエリに"etest"が存在するか 127 | */ 128 | static isEventTest(): boolean; 129 | static isSkill(item: IDataSkill): boolean; 130 | static isItem(item: IDataItem): boolean; 131 | static isWeapon(item: IDataWeapon): boolean; 132 | static isArmor(item: IDataArmor): boolean; 133 | /** 134 | * ゲームオブジェクト(`$game*`)を初期化する 135 | */ 136 | static createGameObjects(): void; 137 | /** 138 | * 新規ゲーム用にデータを初期化する 139 | * 140 | * 1. ゲームオブジェクト初期化 `this.createGameObjects()` 141 | * 2. 新規ゲーム用の空きセーブデータ番号を取得 `this.selectSavefileForNewGame()` 142 | * 3. 開始パーティーメンバーを設定 `$gameParty.setupStartingMembers()` 143 | * 4. 初期位置への移動を予約 `$gamePlayer.reserveTransfer(...)` 144 | * 5. フレームカウントを初期化 `Graphics.frameCount = 0` 145 | */ 146 | static setupNewGame(): void; 147 | /** 148 | * バトルテスト用にデータを初期化する 149 | * 150 | * 1. ゲームオブジェクト初期化 `this.createGameObjects()` 151 | * 2. バトルテスト用パーティーメンバーを設定 `$gameParty.setupBattleTest()` 152 | * 3. バトルマネージャーをバトルテスト用に設定 153 | */ 154 | static setupBattleTest(): void; 155 | /** 156 | * イベントテスト用にデータを初期化する 157 | * 158 | * 1. ゲームオブジェクト初期化 `this.createGameObjects()` 159 | * 2. 新規ゲーム用の空きセーブデータ番号を取得 `this.selectSavefileForNewGame()` 160 | * 3. 開始パーティーメンバーを設定 `$gameParty.setupStartingMembers()` 161 | * 4. マップ-1の(8, 6)に移動予約 `$gamePlayer.reserveTransfer(-1, 8, 6)` 162 | * 5. 透明化を無効に `$gamePlayer.setTransparent(false)` 163 | */ 164 | static setupEventTest(): void; 165 | /** 166 | * セーブファイル情報(`global.rpgsave`)をロード 167 | * 168 | * 存在しないセーブデータの情報は削除されてから返される 169 | */ 170 | static loadGlobalInfo(): ISavefileInfo[]; 171 | /** 172 | * セーブファイル情報(`global.rpgsave`)をセーブ 173 | * @param info セーブファイル情報 174 | */ 175 | static saveGlobalInfo(info: ISavefileInfo[]): void; 176 | /** 177 | * このゲームのセーブデータか? 178 | * @param savefileId セーブファイルID 179 | */ 180 | static isThisGameFile(savefileId: number): boolean; 181 | /** 182 | * セーブが存在するか? 183 | * 184 | * セーブファイル情報に存在し、かつこのゲームのセーブデータファイルが存在するか 185 | */ 186 | static isAnySavefileExists(): boolean; 187 | /** 188 | * 最新のセーブファイルID 189 | * 190 | * タイムスタンプが一番新しいもの ない場合は1が返される 191 | */ 192 | static latestSavefileId(): number; 193 | /** 194 | * 全てのセーブファイル画像をロードする 195 | */ 196 | static loadAllSavefileImages(): void; 197 | /** 198 | * セーブファイル画像をロードする 199 | */ 200 | static loadSavefileImages(info: ISavefileInfo): void; 201 | /** 202 | * セーブファイル数上限 203 | */ 204 | static maxSavefiles(): number; 205 | /** 206 | * セーブする 207 | * @param savefileId セーブファイルID 208 | * @return 成功したか? 209 | */ 210 | static saveGame(savefileId: number): boolean; 211 | /** 212 | * ロードする 213 | * @param savefileId セーブファイルID 214 | * @return 成功したか? 215 | */ 216 | static loadGame(savefileId: number): boolean; 217 | /** 218 | * セーブファイル情報をロードする 219 | * @param savefileId セーブファイルID 220 | */ 221 | static loadSavefileInfo(savefileId: number): ISavefileInfo; 222 | /** 223 | * 最後にアクセスされたセーブファイルID 224 | */ 225 | static lastAccessedSavefileId(): number; 226 | /** 227 | * 例外処理なしのセーブ 228 | * @param savefileId セーブファイルID 229 | * @return 成功したか? 230 | */ 231 | static saveGameWithoutRescue(savefileId: number): boolean; 232 | /** 233 | * 例外処理なしのロード 234 | * @param savefileId セーブファイルID 235 | * @return 成功したか? 236 | */ 237 | static loadGameWithoutRescue(savefileId: number): boolean; 238 | /** 239 | * 新規ゲーム用の空きセーブデータ番号を`lastAccessedSavefileId`にセット 240 | */ 241 | static selectSavefileForNewGame(): void; 242 | /** 243 | * セーブファイル情報を生成 244 | */ 245 | static makeSavefileInfo(): ISavefileInfo; 246 | /** 247 | * セーブデータを生成 248 | */ 249 | static makeSaveContents(): ISaveContents; 250 | /** 251 | * セーブデータを`$game*`に展開 252 | * @param contents セーブデータ 253 | */ 254 | static extractSaveContents(contents: ISaveContents): void; 255 | } 256 | 257 | /** オプションデータ */ 258 | declare interface IConfig 259 | { 260 | /** 常時ダッシュ */ 261 | alwaysDash?: boolean; 262 | /** コマンド記憶 */ 263 | commandRemember?: boolean; 264 | /** BGM 音量 */ 265 | bgmVolume?: number; 266 | /** BGS 音量 */ 267 | bgsVolume?: number; 268 | /** ME 音量 */ 269 | meVolume?: number; 270 | /** SE 音量 */ 271 | seVolume?: number; 272 | } 273 | 274 | /** オプションマネージャ */ 275 | declare class ConfigManager 276 | { 277 | private constructor(); 278 | 279 | /** 常時ダッシュ */ 280 | static alwaysDash: boolean; 281 | /** コマンド記憶 */ 282 | static commandRemember: boolean; 283 | 284 | /** BGM 音量 */ 285 | static bgmVolume: number; 286 | /** BGS 音量 */ 287 | static bgsVolume: number; 288 | /** ME 音量 */ 289 | static meVolume: number; 290 | /** SE 音量 */ 291 | static seVolume: number; 292 | /** 293 | * ロード (`config.rpgsave`) 294 | */ 295 | static load(): void; 296 | /** 297 | * セーブ (`config.rpgsave`) 298 | */ 299 | static save(): void; 300 | /** 301 | * データを作成 302 | */ 303 | static makeData(): IConfig; 304 | /** 305 | * データを適用 306 | */ 307 | static applyData(config: IConfig): void; 308 | /** 309 | * オプションデータからフラグを取得 310 | * 311 | * - キーがなければfalse 312 | * @param config オプション 313 | * @param name キー名 314 | */ 315 | static readFlag(config: IConfig, name: string): boolean; 316 | /** 317 | * オプションデータから音量を取得 318 | * 319 | * - 0から100に丸められる 320 | * - キーがなければ100 321 | * @param config オプション 322 | * @param name キー名 323 | */ 324 | static readVolume(config: IConfig, name: string): number; 325 | } 326 | 327 | declare class StorageManager 328 | { 329 | private constructor(); 330 | 331 | /** 332 | * セーブする 333 | * @param savefileId セーブファイルID 334 | * @param json JSON文字列 335 | */ 336 | static save(savefileId: number, json: string): void; 337 | /** 338 | * ロードする 339 | * @param savefileId セーブファイルID 340 | * @return JSON文字列 341 | */ 342 | static load(savefileId: number): string; 343 | /** 344 | * 存在確認 345 | * @param savefileId セーブファイルID 346 | */ 347 | static exists(savefileId: number): boolean; 348 | /** 349 | * 削除 350 | * 351 | * (セーブ中に利用する) 352 | * @param savefileId セーブファイルID 353 | */ 354 | static remove(savefileId: number): void; 355 | /** 356 | * バックアップ 357 | * 358 | * (セーブ中に利用する) 359 | * @param savefileId セーブファイルID 360 | */ 361 | static backup(savefileId: number): void; 362 | /** 363 | * バックアップ存在確認 364 | * 365 | * (セーブ中に利用する) 366 | * @param savefileId セーブファイルID 367 | */ 368 | static backupExists(savefileId: number): void; 369 | /** 370 | * バックアップを削除する 371 | * 372 | * (セーブ中に利用する) 373 | * @param savefileId セーブファイルID 374 | */ 375 | static cleanBackup(savefileId: number): void; 376 | /** 377 | * バックアップを戻す 378 | * 379 | * (セーブ中に利用する) 380 | * @param savefileId セーブファイルID 381 | */ 382 | static restoreBackup(savefileId: number): void; 383 | /** 384 | * ローカルモードか? 385 | * 386 | * `Utils.isNwjs()` 387 | */ 388 | static isLocalMode(): boolean; 389 | static saveToLocalFile(savefileId: number, json: any): void; 390 | static loadFromLocalFile(savefileId: number): any; 391 | static loadFromLocalBackupFile(savefileId: number): any; 392 | static localFileBackupExists(savefileId: number): boolean; 393 | static localFileExists(savefileId: number): boolean; 394 | static removeLocalFile(savefileId: number): void; 395 | static saveToWebStorage(savefileId: number, json: any): void; 396 | static loadFromWebStorage(savefileId: number): any; 397 | static loadFromWebStorageBackup(savefileId: number): any; 398 | static webStorageBackupExists(savefileId: number): boolean; 399 | static webStorageExists(savefileId: number): boolean; 400 | static removeWebStorage(savefileId: number): void; 401 | /** 402 | * ローカルファイルのディレクトリパス 403 | */ 404 | static localFileDirectoryPath(): string; 405 | /** 406 | * ローカルファイルパス 407 | * 408 | * - `savefileId < 0` なら `config.rpgsave` 409 | * - `savefileId === 0` なら `global.rpgsave` 410 | * - `savefileId > 0` なら `file${savefileId}.rpgsave` 411 | * @param savefileId セーブファイルID 412 | */ 413 | static localFilePath(savefileId: number): string; 414 | /** 415 | * ウェブストレージキー 416 | * 417 | * - `savefileId < 0` なら `RPG Config` 418 | * - `savefileId === 0` なら `RPG Global` 419 | * - `savefileId > 0` なら `RPG File${savefileId}` 420 | * @param savefileId セーブファイルID 421 | */ 422 | static webStorageKey(savefileId: number): string; 423 | } 424 | 425 | /** 426 | * 画像マネージャー(キャッシュやリクエストキュー付き) 427 | */ 428 | declare class ImageManager 429 | { 430 | private constructor(); 431 | 432 | static _imageCache: ImageCache; 433 | // static _requestQueue: RequestCache; 434 | static _systemReservationId: number; 435 | 436 | static _generateCacheKey(): string; 437 | 438 | static cache: CacheMap; 439 | 440 | static loadAnimation(filename: string, hue?: number): Bitmap; 441 | static loadBattleback1(filename: string, hue?: number): Bitmap; 442 | static loadBattleback2(filename: string, hue?: number): Bitmap; 443 | static loadEnemy(filename: string, hue?: number): Bitmap; 444 | static loadCharacter(filename: string, hue?: number): Bitmap; 445 | static loadFace(filename: string, hue?: number): Bitmap; 446 | static loadParallax(filename: string, hue?: number): Bitmap; 447 | static loadPicture(filename: string, hue?: number): Bitmap; 448 | static loadSvActor(filename: string, hue?: number): Bitmap; 449 | static loadSvEnemy(filename: string, hue?: number): Bitmap; 450 | static loadSystem(filename: string, hue?: number): Bitmap; 451 | static loadTileset(filename: string, hue?: number): Bitmap; 452 | static loadTitle1(filename: string, hue?: number): Bitmap; 453 | static loadTitle2(filename: string, hue?: number): Bitmap; 454 | static loadBitmap(folder: string, filename: string, hue?: number, smooth?: boolean): Bitmap; 455 | static loadEmptyBitmap(): Bitmap; 456 | static loadNormalBitmap(path: string, hue: number): Bitmap; 457 | static clear(): void; 458 | static isReady(): boolean; 459 | /** 460 | * ObjectCharacterか 461 | * 462 | * ファイル名に`!`が存在するか 463 | * @param filename ファイル名 464 | */ 465 | static isObjectCharacter(filename: string): boolean; 466 | /** 467 | * BigCharacterか 468 | * 469 | * ファイル名に`$`が存在するか 470 | * @param filename ファイル名 471 | */ 472 | static isBigCharacter(filename: string): boolean; 473 | /** 474 | * ZeroParallaxか 475 | * 476 | * ファイル名の先頭が`!`であるか 477 | * @param filename ファイル名 478 | */ 479 | static isZeroParallax(filename: string): boolean; 480 | static reserveAnimation(filename: string, hue: number, reservationId: number): Bitmap; 481 | static reserveBattleback1(filename: string, hue: number, reservationId: number): Bitmap; 482 | static reserveBattleback2(filename: string, hue: number, reservationId: number): Bitmap; 483 | static reserveEnemy(filename: string, hue: number, reservationId: number): Bitmap; 484 | static reserveCharacter(filename: string, hue: number, reservationId: number): Bitmap; 485 | static reserveFace(filename: string, hue: number, reservationId: number): Bitmap; 486 | static reserveParallax(filename: string, hue: number, reservationId: number): Bitmap; 487 | static reservePicture(filename: string, hue: number, reservationId: number): Bitmap; 488 | static reserveSvActor(filename: string, hue: number, reservationId: number): Bitmap; 489 | static reserveSvEnemy(filename: string, hue: number, reservationId: number): Bitmap; 490 | static reserveSystem(filename: string, hue: number, reservationId: number): Bitmap; 491 | static reserveTileset(filename: string, hue: number, reservationId: number): Bitmap; 492 | static reserveTitle1(filename: string, hue: number, reservationId: number): Bitmap; 493 | static reserveTitle2(filename: string, hue: number, reservationId: number): Bitmap; 494 | static reserveBitmap(folder: string, filename: string, hue: number, smooth: boolean, reservationId: number): Bitmap; 495 | static reserveNormalBitmap(path: string, hue: number, reservationId: number): Bitmap; 496 | static releaseReservation(reservationId: number): void; 497 | static setDefaultReservationId(reservationId: number): void; 498 | static requestAnimation(filename: string, hue: number): Bitmap; 499 | static requestBattleback1(filename: string, hue: number): Bitmap; 500 | static requestBattleback2(filename: string, hue: number): Bitmap; 501 | static requestEnemy(filename: string, hue: number): Bitmap; 502 | static requestCharacter(filename: string, hue: number): Bitmap; 503 | static requestFace(filename: string, hue: number): Bitmap; 504 | static requestParallax(filename: string, hue: number): Bitmap; 505 | static requestPicture(filename: string, hue: number): Bitmap; 506 | static requestSvActor(filename: string, hue: number): Bitmap; 507 | static requestSvEnemy(filename: string, hue: number): Bitmap; 508 | static requestSystem(filename: string, hue: number): Bitmap; 509 | static requestTileset(filename: string, hue: number): Bitmap; 510 | static requestTitle1(filename: string, hue: number): Bitmap; 511 | static requestTitle2(filename: string, hue: number): Bitmap; 512 | static requestBitmap(folder: string, filename: string, hue: number, smooth: boolean): Bitmap; 513 | static requestNormalBitmap(path: string, hue: number): Bitmap; 514 | static update(): void; 515 | static clearRequest(): void; 516 | } 517 | 518 | interface IAudioObject 519 | { 520 | name: string; 521 | volume: number; 522 | pitch: number; 523 | pan: number; 524 | pos: number; 525 | } 526 | 527 | /** オーディオマネージャー */ 528 | declare class AudioManager 529 | { 530 | private constructor(); 531 | 532 | static _masterVolume : number; 533 | static _bgmVolume : number; 534 | static _bgsVolume : number; 535 | static _meVolume : number; 536 | static _seVolume : number; 537 | static _currentBgm : IAudioObject; 538 | static _currentBgs : IAudioObject; 539 | static _bgmBuffer : WebAudio | Html5Audio; 540 | static _bgsBuffer : WebAudio; 541 | static _meBuffer : WebAudio; 542 | static _seBuffers : WebAudio[]; 543 | static _staticBuffers : WebAudio[]; 544 | static _replayFadeTime : number; 545 | static _path : string; 546 | static _blobUrl : string; 547 | 548 | /** マスター音量を設定・取得 */ 549 | static masterVolume: number; 550 | /** BGM 音量を設定・取得 */ 551 | static bgmVolume: number; 552 | /** BGS 音量を設定・取得 */ 553 | static bgsVolume: number; 554 | /** ME 音量を設定・取得 */ 555 | static meVolume: number; 556 | /** SE 音量を設定・取得 */ 557 | static seVolume: number; 558 | 559 | static playBgm(bgm: IAudioObject, pos: number): void; 560 | static playEncryptedBgm(bgm: IAudioObject, pos: number): void; 561 | static createDecryptBuffer(url: string, bgm: IAudioObject, pos: number): void; 562 | static replayBgm(bgm: IAudioObject): void; 563 | static isCurrentBgm(bgm: IAudioObject): boolean; 564 | static updateBgmParameters(bgm: IAudioObject): void; 565 | static updateCurrentBgm(bgm: IAudioObject, pos: number): void; 566 | static stopBgm(): void; 567 | static fadeOutBgm(duration: number): void; 568 | static fadeInBgm(duration: number): void; 569 | static playBgs(bgs: IAudioObject, pos: number): void; 570 | static replayBgs(bgs: IAudioObject): void; 571 | static isCurrentBgs(bgs: IAudioObject): boolean; 572 | static updateBgsParameters(bgs: IAudioObject): void; 573 | static updateCurrentBgs(bgs: IAudioObject, pos: number): void; 574 | static stopBgs(): void; 575 | static fadeOutBgs(duration: number): void; 576 | static fadeInBgs(duration: number): void; 577 | static playMe(me: IDataSound): void; 578 | static updateMeParameters(me: IDataSound): void; 579 | static fadeOutMe(duration: number): void; 580 | static stopMe(): void; 581 | static playSe(se: IDataSound): void; 582 | static updateSeParameters(buffer: WebAudio | Html5Audio, se: IDataSound): void; 583 | static stopSe(): void; 584 | static playStaticSe(se: IDataSound): void; 585 | static loadStaticSe(se: IDataSound): void; 586 | static isStaticSe(se: IDataSound): boolean; 587 | static stopAll(): void; 588 | static saveBgm(): IAudioObject; 589 | static saveBgs(): IAudioObject; 590 | static makeEmptyAudioObject(): IAudioObject; 591 | static createBuffer(folder: number, name: string): Html5Audio | WebAudio; 592 | static updateBufferParameters(buffer: IAudioObject, configVolume: number, audio: IAudioObject): void; 593 | static audioFileExt(): "ogg" | "m4a"; 594 | static shouldUseHtml5Audio(): boolean; 595 | static checkErrors(): void; 596 | static checkWebAudioError(webAudio: WebAudio): void; 597 | } 598 | 599 | /** システムSEマネージャー */ 600 | declare class SoundManager 601 | { 602 | private constructor(); 603 | 604 | /** 605 | * システムSE 0~3(カーソル・決定・キャンセル・ブザー)をロード 606 | */ 607 | static preloadImportantSounds(): void; 608 | /** 609 | * システムSEをロード 610 | * @param n システムサウンド番号 611 | */ 612 | static loadSystemSound(n: number): void; 613 | /** 614 | * システムSEを再生 615 | * @param n システムサウンド番号 616 | */ 617 | static playSystemSound(n: number): void; 618 | static playCursor(): void; 619 | static playOk(): void; 620 | static playCancel(): void; 621 | static playBuzzer(): void; 622 | static playEquip(): void; 623 | static playSave(): void; 624 | static playLoad(): void; 625 | static playBattleStart(): void; 626 | static playEscapeion(): void; 627 | static playEnemyAttack(): void; 628 | static playEnemyDamage(): void; 629 | static playEnemyCollapse(): void; 630 | static playBossCollapse1(): void; 631 | static playBossCollapse2(): void; 632 | static playActorDamage(): void; 633 | static playActorCollapse(): void; 634 | static playRecoveryion(): void; 635 | static playMiss(): void; 636 | static playEvasionion(): void; 637 | static playMagicEvasion(): void; 638 | static playReflectioni(): void; 639 | static playShop(): void; 640 | static playUseItem(): void; 641 | static playUseSkill(): void; 642 | } 643 | 644 | /** システムテキストマネージャー */ 645 | declare class TextManager 646 | { 647 | private constructor(); 648 | 649 | static basic(basicId: number): string; 650 | static param(paramId: number): string; 651 | static command(commandId: number): string; 652 | static message(messageId: number): string; 653 | static getter(method: Function, param: number): Function; 654 | 655 | static currencyUnit: string; 656 | static level: string; 657 | static levelA: string; 658 | static hp: string; 659 | static hpA: string; 660 | static mp: string; 661 | static mpA: string; 662 | static tp: string; 663 | static tpA: string; 664 | static exp: string; 665 | static expA: string; 666 | static fight: string; 667 | static escape: string; 668 | static attack: string; 669 | static guard: string; 670 | static item: string; 671 | static skill: string; 672 | static equip: string; 673 | static status: string; 674 | static formation: string; 675 | static save: string; 676 | static gameEnd: string; 677 | static options: string; 678 | static weapon: string; 679 | static armor: string; 680 | static keyItem: string; 681 | static equip2: string; 682 | static optimize: string; 683 | static clear: string; 684 | static newGame: string; 685 | static continue_: string; 686 | static toTitle: string; 687 | static cancel: string; 688 | static buy: string; 689 | static sell: string; 690 | static alwaysDash: string; 691 | static commandRemember: string; 692 | static bgmVolume: string; 693 | static bgsVolume: string; 694 | static meVolume: string; 695 | static seVolume: string; 696 | static possession: string; 697 | static expTotal: string; 698 | static expNext: string; 699 | static saveMessage: string; 700 | static loadMessage: string; 701 | static file: string; 702 | static partyName: string; 703 | static emerge: string; 704 | static preemptive: string; 705 | static surprise: string; 706 | static escapeStart: string; 707 | static escapeFailure: string; 708 | static victory: string; 709 | static defeat: string; 710 | static obtainExp: string; 711 | static obtainGold: string; 712 | static obtainItem: string; 713 | static levelUp: string; 714 | static obtainSkill: string; 715 | static useItem: string; 716 | static criticalToEnemy: string; 717 | static criticalToActor: string; 718 | static actorDamage: string; 719 | static actorRecovery: string; 720 | static actorGain: string; 721 | static actorLoss: string; 722 | static actorDrain: string; 723 | static actorNoDamage: string; 724 | static actorNoHit: string; 725 | static enemyDamage: string; 726 | static enemyRecovery: string; 727 | static enemyGain: string; 728 | static enemyLoss: string; 729 | static enemyDrain: string; 730 | static enemyNoDamage: string; 731 | static enemyNoHit: string; 732 | static evasion: string; 733 | static magicEvasion: string; 734 | static magicReflection: string; 735 | static counterAttack: string; 736 | static substitute: string; 737 | static buffAdd: string; 738 | static debuffAdd: string; 739 | static buffRemove: string; 740 | static actionFailure: string; 741 | } 742 | 743 | /** シーンマネージャー */ 744 | declare class SceneManager 745 | { 746 | private constructor(); 747 | 748 | static _getTimeInMsWithoutMobileSafari: number; 749 | /** 現在のシーン */ 750 | static _scene: Scene_Base; 751 | /** 次のシーン */ 752 | static _nextScene: Scene_Base; 753 | /** シーンスタック */ 754 | static _stack: typeof Scene_Base[]; 755 | /** 描画停止中 */ 756 | static _stopped: boolean; 757 | /** シーンが開始したか */ 758 | static _sceneStarted: boolean; 759 | /** 終了中 */ 760 | static _exiting: boolean; 761 | /** 前のシーン */ 762 | static _previousClass: typeof Scene_Base; 763 | /** ブラーのかけられた背景 */ 764 | static _backgroundBitmap: Bitmap; 765 | /** 描画領域横幅 */ 766 | static _screenWidth: number; 767 | /** 描画領域縦幅 */ 768 | static _screenHeight: number; 769 | /** ボックス横幅(描画領域と同じ) */ 770 | static _boxWidth: number; 771 | /** ボックス縦幅(描画領域と同じ) */ 772 | static _boxHeight: number; 773 | static _deltaTime: number; 774 | static _currentTime: number; 775 | static _accumulator: number; 776 | 777 | /** 778 | * シーンマネージャーを実行 779 | * 780 | * 1. 初期化 initialize 781 | * 2. シーン移動 goto(sceneClass) 782 | * 3. 描画開始 requestUpdate 783 | * @param sceneClass シーンクラス 784 | */ 785 | static run(sceneClass: typeof Scene_Base): void; 786 | /** 787 | * 初期化 788 | * 789 | * 1. initGraphics 790 | * 1. checkFileAccess 791 | * 1. initAudio 792 | * 1. initInput 793 | * 1. initNwjs 794 | * 1. checkPluginErrors 795 | * 1. setupErrorHandlers 796 | */ 797 | static initialize(): void; 798 | /** 799 | * Graphicsを初期化 800 | * 801 | * 1. Graphicsの大きさを設定 802 | * 1. Graphicsのローディング画像を設定 803 | * 1. showfpsが有効ならfpsを表示する 804 | * 1. 強制WebGLが使えない場合エラー 805 | */ 806 | static initGraphics(): void; 807 | /** 808 | * レンダリング方式 809 | * 810 | * - クエリにwebglまたはcanvasがあれば強制的に選択 811 | * - そうでなければ自動選択 812 | */ 813 | static preferableRendererType(): "canvas" | "webgl" | "auto"; 814 | /** 815 | * canvasを利用するべきか 816 | * 817 | * モバイルデバイスの場合true 818 | */ 819 | static shouldUseCanvasRenderer(): boolean; 820 | /** 821 | * ブラウザのWebGL機能を調べる 822 | */ 823 | static checkWebGL(): void; 824 | /** 825 | * ブラウザのファイルアクセス機能を調べる 826 | */ 827 | static checkFileAccess(): void; 828 | /** 829 | * オーディオを初期化 830 | * 831 | * クエリにnoaudioがなく初期化不能ならエラー 832 | */ 833 | static initAudio(): void; 834 | /** 835 | * Input・TouchInputを初期化 836 | */ 837 | static initInput(): void; 838 | /** 839 | * NW.JSならそれを初期化 840 | */ 841 | static initNwjs(): void; 842 | /** 843 | * PluginManagerのエラーがないか? 844 | */ 845 | static checkPluginErrors(): void; 846 | /** 847 | * 以下のイベントハンドラを設定 848 | * 849 | * - windowのerrorハンドラ 850 | * - F5リロード 851 | * - F8デバッグ(クエリにtestがあるときのみ) 852 | */ 853 | static setupErrorHandlers(): void; 854 | /** 855 | * 描画停止中でなければrequestAnimationFrame(this.update) 856 | */ 857 | static requestUpdate(): void; 858 | /** 859 | * 1. tickStart 860 | * 1. updateInputData (MobileSafariのみ) 861 | * 1. updateManagers = `ImageManager.update()` 862 | * 1. updateMain 863 | * 1. tickEnd 864 | */ 865 | static update(): void; 866 | /** ウインドウを閉じる */ 867 | static terminate(): void; 868 | /** エラーハンドラ */ 869 | static onError(e: ErrorEvent): void; 870 | /** キーハンドラ */ 871 | static onKeyDown(event: KeyboardEvent): void; 872 | /** 873 | * 例外ハンドラ 874 | * 875 | * - 画面上にエラーを表示 876 | * - オーディオを停止 877 | * - 描画停止 878 | */ 879 | static catchException(e: ErrorEvent): void; 880 | /** `Graphics.tickStart()` */ 881 | static tickStart(): void; 882 | /** `Graphics.tickEnd()` */ 883 | static tickEnd(): void; 884 | /** `Input.update()` `TouchInput.update()` */ 885 | static updateInputData(): void; 886 | /** 887 | * 1. 何回か 888 | * 1. updateInputData (MobileSafari以外) 889 | * 1. changeScene 890 | * 1. updateScene 891 | * 1. renderScene 892 | * 1. requestUpdate 893 | */ 894 | static updateMain(): void; 895 | /** 896 | * `ImageManager.update()` 897 | */ 898 | static updateManagers(): void; 899 | /** 900 | * シーン変更をハンドルする 901 | * 902 | * - シーン変更中かつ現在のシーンがbusyでないなら 903 | * 1. 現在のシーン.terminate() 904 | * 1. 現在のシーンから次のシーンに非同期ロードのハンドルを付け替える 905 | * 1. 次のシーン.create() 906 | * 1. 次のシーン.onSceneCreate() = Graphics ローディング開始 907 | * - 終了中なら 908 | * 1. 上記の次のシーンが無い版 909 | * 1. this.terminate() 910 | */ 911 | static changeScene(): void; 912 | /** 913 | * シーンをupdateする 914 | * 915 | * - シーンがreadyかつstartしていないなら 916 | * 1. シーン.start() 917 | * 1. onSceneStart = Graphics ローディング終了 918 | * - シーンがstartしているなら 919 | * 1. シーン.update() 920 | */ 921 | static updateScene(): void; 922 | /** 923 | * シーンをレンダリングする 924 | * 925 | * - シーンがスタートしているなら 926 | * - Graphics.render(scene) 927 | * - そうでなければ 928 | * - onSceneLoading = Graphics ローディング継続 929 | */ 930 | static renderScene(): void; 931 | /** シーン作成=ローディング開始 Graphics.startLoading() */ 932 | static onSceneCreate(): void; 933 | /** シーン開始=ローディング終了 Graphics.endLoading() */ 934 | static onSceneStart(): void; 935 | /** シーンローディング=ローディング継続 Graphics.updateLoading() */ 936 | static onSceneLoading(): void; 937 | /** 938 | * シーン変更中 939 | * 940 | * 終了中か次のシーンが存在 941 | */ 942 | static isSceneChanging(): boolean; 943 | /** 現在のシーンがbusy */ 944 | static isCurrentSceneBusy(): boolean; 945 | /** 現在のシーンが開始済み */ 946 | static isCurrentSceneStarted(): boolean; 947 | /** 次のシーンか */ 948 | static isNextScene(sceneClass: typeof Scene_Base): boolean; 949 | /** 前のシーンか */ 950 | static isPreviousScene(sceneClass: typeof Scene_Base): boolean; 951 | 952 | /** 953 | * シーンを移動する 954 | * 955 | * 次のシーンを設定し、現在のシーンがあれば停止する 956 | * @param sceneClass シーンクラス 957 | */ 958 | static goto(sceneClass: typeof Scene_Base): void; 959 | /** 960 | * シーンを移動する(スタックに乗せる) 961 | * @param sceneClass シーンクラス 962 | */ 963 | static push(sceneClass: typeof Scene_Base): void; 964 | /** 965 | * シーンを移動する(スタックから下ろす) 966 | */ 967 | static pop(): void; 968 | /** 終了する */ 969 | static exit(): void; 970 | /** スタックをクリアする */ 971 | static clearStack(): void; 972 | /** 描画停止する */ 973 | static stop(): void; 974 | /** 次のシーンのprepareを呼ぶ */ 975 | static prepareNextScene(): void; 976 | /** シーンのスナップショットを返す */ 977 | static snap(): Bitmap; 978 | /** 背景のスナップショットをとりブラーをかける */ 979 | static snapForBackground(): void; 980 | /** ブラーのかけられた背景 */ 981 | static backgroundBitmap(): Bitmap; 982 | /** 描画再開する */ 983 | static resume(): void; 984 | } 985 | 986 | /** バトル報酬 */ 987 | declare interface IDataRewards 988 | { 989 | /** ゴールド */ 990 | gold: number; 991 | /** 経験値 */ 992 | exp: number; 993 | /** アイテム */ 994 | items: IDataAllItem[]; 995 | } 996 | 997 | /** バトルマネージャー */ 998 | declare class BattleManager 999 | { 1000 | private constructor(); 1001 | 1002 | static _phase: string; 1003 | static _canEscape: boolean; 1004 | static _canLose: boolean; 1005 | static _battleTest: boolean; 1006 | static _eventCallback: Function; 1007 | static _preemptive: boolean; 1008 | static _surprise: boolean; 1009 | static _actorIndex: number; 1010 | static _actionForcedBattler: Game_Battler; 1011 | static _mapBgm: IAudioObject; 1012 | static _mapBgs: IAudioObject; 1013 | static _actionBattlers: Game_Battler[]; 1014 | static _subject: Game_Battler; 1015 | static _action: Game_Action; 1016 | static _targets: Game_Battler[]; 1017 | static _logWindow: Window_BattleLog; 1018 | static _statusWindow: Window_BattleStatus; 1019 | static _spriteset: Spriteset_Battle; 1020 | static _escapeRatio: number; 1021 | static _escaped: boolean; 1022 | static _rewards: IDataRewards; 1023 | 1024 | static setup(troopId: number, canEscape: boolean, canLose: boolean): void; 1025 | static initMembers(): void; 1026 | static isBattleTest(): boolean; 1027 | static setBattleTest(battleTest: boolean): void; 1028 | static setEventCallback(callback: Function): void; 1029 | static setLogWindow(logWindow: Window_BattleLog): void; 1030 | static setStatusWindow(statusWindow: Window_BattleStatus): void; 1031 | static setSpriteset(spriteset: Spriteset_Battle): void; 1032 | static onEncounter(): void; 1033 | static ratePreemptive(): number; 1034 | static rateSurprise(): number; 1035 | static saveBgmAndBgs(): void; 1036 | static playBattleBgm(): void; 1037 | static playVictoryMe(): void; 1038 | static playDefeatMe(): void; 1039 | static replayBgmAndBgs(): void; 1040 | static makeEscapeRatio(): void; 1041 | static update(): void; 1042 | static updateEvent(): boolean; 1043 | static updateEventMain(): boolean; 1044 | static isBusy(): boolean; 1045 | static isInputting(): boolean; 1046 | static isInTurn(): boolean; 1047 | static isTurnEnd(): boolean; 1048 | static isAborting(): boolean; 1049 | static isBattleEnd(): boolean; 1050 | static canEscape(): boolean; 1051 | static canLose(): boolean; 1052 | static isEscaped(): boolean; 1053 | static actor(): Game_Actor; 1054 | static clearActor(): void; 1055 | static changeActor(newActorIndex: number, lastActorActionState: string): void; 1056 | static startBattle(): void; 1057 | static displayStartMessages(): void; 1058 | static startInput(): void; 1059 | static inputtingAction(): Game_Action; 1060 | static selectNextCommand(): void; 1061 | static selectPreviousCommand(): void; 1062 | static refreshStatus(): void; 1063 | static startTurn(): void; 1064 | static updateTurn(): void; 1065 | static processTurn(): void; 1066 | static endTurn(): void; 1067 | static updateTurnEnd(): void; 1068 | static getNextSubject(): void; 1069 | static allBattleMembers(): Game_Battler; 1070 | static makeActionOrders(): void; 1071 | static startAction(): void; 1072 | static updateAction(): void; 1073 | static endAction(): void; 1074 | static invokeAction(subject: Game_Battler, target: Game_Battler): void; 1075 | static invokeNormalAction(subject: Game_Battler, target: Game_Battler): void; 1076 | static invokeCounterAttack(subject: Game_Battler, target: Game_Battler): void; 1077 | static invokeMagicReflection(subject: Game_Battler, target: Game_Battler): void; 1078 | static applySubstitute(target: Game_Battler): Game_Battler; 1079 | static checkSubstitute(target: Game_Battler): Game_Battler; 1080 | static isActionForced(): boolean; 1081 | static forceAction(battler: Game_Battler): void; 1082 | static processForcedAction(): void; 1083 | static abort(): void; 1084 | static checkBattleEnd(): boolean; 1085 | static checkAbort(): boolean; 1086 | static checkAbort2(): boolean; 1087 | static processVictory(): void; 1088 | static processEscape(): boolean; 1089 | static processAbort(): void; 1090 | static processDefeat(): void; 1091 | static endBattle(result: number): void; 1092 | static updateBattleEnd(): void; 1093 | static makeRewards(): void; 1094 | static displayVictoryMessage(): void; 1095 | static displayDefeatMessage(): void; 1096 | static makeRewadisplayEscapeSuccessMessagerds(): void; 1097 | static displayEscapeFailureMessage(): void; 1098 | static displayRewards(): void; 1099 | static displayExp(): void; 1100 | static displayGold(): void; 1101 | static displayDropItems(): void; 1102 | static gainRewards(): void; 1103 | static gainExp(): void; 1104 | static gainGold(): void; 1105 | static gainDropItems(): void; 1106 | } 1107 | 1108 | /** プラグイン指定 */ 1109 | declare interface IDataPlugin 1110 | { 1111 | /** 名前 */ 1112 | name: string; 1113 | /** 状態(ON/OFF) */ 1114 | status: boolean; 1115 | /** 説明 */ 1116 | description: string; 1117 | /** プラグインパラメーター */ 1118 | parameters: PluginParameters; 1119 | } 1120 | 1121 | /** プラグインパラメーター */ 1122 | declare type PluginParameters = { [key: string]: string; }; 1123 | 1124 | /** プラグインマネージャー */ 1125 | declare class PluginManager 1126 | { 1127 | private constructor(); 1128 | 1129 | static _path: string; 1130 | static _scripts: string[]; 1131 | static _errorUrls: string[]; 1132 | static _parameters: PluginParameters; 1133 | 1134 | /** プラグインを読み込む */ 1135 | static setup(plugins: IDataPlugin[]): void; 1136 | /** 読み込みエラーがあれば例外 */ 1137 | static checkErrors(): void; 1138 | /** 1139 | * プラグインパラメーター 1140 | * @param name プラグイン名 1141 | */ 1142 | static parameters(name: string): PluginParameters; 1143 | /** 1144 | * プラグインパラメーターを設定 1145 | * @param name プラグイン名 1146 | * @param parameters プラグインパラメーター 1147 | */ 1148 | static setParameters(name: string, parameters: PluginParameters): void; 1149 | /** 1150 | * プラグインスクリプトをファイルからロードする 1151 | * @param name プラグイン名 1152 | */ 1153 | static loadScript(name: string): void; 1154 | /** 1155 | * ロード時のエラーで呼ばれる内部関数 1156 | */ 1157 | static onError(e: ErrorEvent): void; 1158 | } 1159 | -------------------------------------------------------------------------------- /typings/rpgmakermv/rpg_scenes.d.ts: -------------------------------------------------------------------------------- 1 | declare class Scene_Base extends Stage 2 | { 3 | _active: boolean; 4 | _fadeSign: number; 5 | _fadeDuration: number; 6 | _fadeSprite: ScreenSprite; 7 | _windowLayer: WindowLayer; 8 | _spriteset: Spriteset_Base; 9 | 10 | constructor(); 11 | initialize(): void; 12 | create(): void; 13 | isActive(): boolean; 14 | isReady(): boolean; 15 | start(): void; 16 | update(): void; 17 | stop(): void; 18 | isBusy(): boolean; 19 | terminate(): void; 20 | createWindowLayer(): void; 21 | addWindow(window: Window_Base): void; 22 | startFadeIn(duration?: number, white?: boolean): void; 23 | startFadeOut(duration?: number, white?: boolean): void; 24 | createFadeSprite(white?: boolean): void; 25 | updateFade(): void; 26 | updateChildren(): void; 27 | popScene(): void; 28 | checkGameover(): void; 29 | fadeOutAll(): void; 30 | fadeSpeed(): number; 31 | slowFadeSpeed(): number; 32 | attachReservation(): void; 33 | detachReservation(): void; 34 | } 35 | 36 | declare class Scene_Boot extends Scene_Base 37 | { 38 | _startDate: number; 39 | 40 | static loadSystemImages(): void; 41 | 42 | constructor(); 43 | initialize(): void; 44 | create(): void; 45 | loadSystemWindowImage(): void; 46 | isReady(): boolean; 47 | isGameFontLoaded(): boolean; 48 | start(): void; 49 | updateDocumentTitle(): void; 50 | checkPlayerLocation(): void; 51 | } 52 | 53 | declare class Scene_Title extends Scene_Base 54 | { 55 | _commandWindow: Window_TitleCommand; 56 | _backSprite1: Sprite; 57 | _backSprite2: Sprite; 58 | _gameTitleSprite: Sprite; 59 | 60 | constructor(); 61 | initialize(): void; 62 | create(): void; 63 | start(): void; 64 | update(): void; 65 | isBusy(): boolean; 66 | terminate(): void; 67 | createBackground(): void; 68 | createForeground(): void; 69 | drawGameTitle(): void; 70 | centerSprite(sprite: Sprite_Base): void; 71 | createCommandWindow(): void; 72 | commandNewGame(): void; 73 | commandContinue(): void; 74 | commandOptions(): void; 75 | playTitleMusic(): void; 76 | } 77 | 78 | declare class Scene_Map extends Scene_Base 79 | { 80 | _waitCount: number; 81 | _encounterEffectDuration: number; 82 | _mapLoaded: boolean; 83 | _mapNameWindow: Window_MapName; 84 | _messageWindow: Window_Message; 85 | _scrollTextWindow: Window_ScrollText; 86 | _spriteset: Spriteset_Map; 87 | _touchCount: number; 88 | _transfer: boolean; 89 | 90 | menuCalling: boolean; 91 | 92 | constructor(); 93 | initialize(): void; 94 | create(): void; 95 | isReady(): boolean; 96 | onMapLoaded(): void; 97 | start(): void; 98 | update(): void; 99 | updateMainMultiply(): void; 100 | updateMain(): void; 101 | isFastForward(): boolean; 102 | stop(): void; 103 | isBusy(): boolean; 104 | terminate(): void; 105 | needsFadeIn(): boolean; 106 | needsSlowFadeOut(): boolean; 107 | updateWaitCount(): boolean; 108 | updateDestination(): void; 109 | isMapTouchOk(): boolean; 110 | processMapTouch(): void; 111 | isSceneChangeOk(): boolean; 112 | updateScene(): void; 113 | createDisplayObjects(): void; 114 | createSpriteset(): void; 115 | createAllWindows(): void; 116 | createMapNameWindow(): void; 117 | createMessageWindow(): void; 118 | createScrollTextWindow(): void; 119 | updateTransferPlayer(): void; 120 | updateEncounter(): void; 121 | updateCallMenu(): void; 122 | isMenuEnabled(): boolean; 123 | isMenuCalled(): boolean; 124 | callMenu(): void; 125 | updateCallDebug(): void; 126 | isDebugCalled(): boolean; 127 | fadeInForTransfer(): void; 128 | fadeOutForTransfer(): void; 129 | launchBattle(): void; 130 | stopAudioOnBattleStart(): void; 131 | startEncounterEffect(): void; 132 | updateEncounterEffect(): void; 133 | snapForBattleBackground(): void; 134 | startFlashForEncounter(duration: number): void; 135 | encounterEffectSpeed(): number; 136 | } 137 | 138 | declare class Scene_MenuBase extends Scene_Base 139 | { 140 | _actor: Game_Actor; 141 | _backgroundSprite: Sprite; 142 | _helpWindow: Window_Help; 143 | 144 | constructor(); 145 | initialize(): void; 146 | create(): void; 147 | actor(): Game_Actor; 148 | updateActor(): void; 149 | createBackground(): void; 150 | setBackgroundOpacity(opacity: number): void; 151 | createHelpWindow(): void; 152 | nextActor(): void; 153 | previousActor(): void; 154 | onActorChange(): void; 155 | } 156 | 157 | declare class Scene_Menu extends Scene_MenuBase 158 | { 159 | _statusWindow: Window_MenuStatus; 160 | _goldWindow: Window_Gold; 161 | _commandWindow: Window_MenuCommand; 162 | 163 | constructor(); 164 | initialize(): void; 165 | create(): void; 166 | start(): void; 167 | createCommandWindow(): void; 168 | createGoldWindow(): void; 169 | createStatusWindow(): void; 170 | commandItem(): void; 171 | commandPersonal(): void; 172 | commandFormation(): void; 173 | commandOptions(): void; 174 | commandSave(): void; 175 | commandGameEnd(): void; 176 | onPersonalOk(): void; 177 | onPersonalCancel(): void; 178 | onFormationOk(): void; 179 | onFormationCancel(): void; 180 | } 181 | 182 | declare class Scene_ItemBase extends Scene_MenuBase 183 | { 184 | _actorWindow: Window_MenuActor; 185 | _itemWindow: Window_Selectable; 186 | 187 | constructor(); 188 | initialize(): void; 189 | create(): void; 190 | createActorWindow(): void; 191 | item(): IDataAllItem; 192 | user(): Game_Actor; 193 | isCursorLeft(): boolean; 194 | showSubWindow(window: Window_Base): void; 195 | hideSubWindow(window: Window_Base): void; 196 | onActorOk(): void; 197 | onActorCancel(): void; 198 | determineItem(): void; 199 | useItem(): void; 200 | activateItemWindow(): void; 201 | itemTargetActors(): void; 202 | canUse(): boolean; 203 | isItemEffectsValid(): boolean; 204 | applyItem(): void; 205 | checkCommonEvent(): void; 206 | } 207 | 208 | declare class Scene_Item extends Scene_ItemBase 209 | { 210 | _categoryWindow: Window_ItemCategory; 211 | _itemWindow: Window_ItemList; 212 | 213 | constructor(); 214 | initialize(): void; 215 | create(): void; 216 | createCategoryWindow(): void; 217 | createItemWindow(): void; 218 | user(): Game_Actor; 219 | onCategoryOk(): void; 220 | onItemOk(): void; 221 | onItemCancel(): void; 222 | playSeForItem(): void; 223 | useItem(): void; 224 | } 225 | 226 | declare class Scene_Skill extends Scene_ItemBase 227 | { 228 | _skillTypeWindow: Window_SkillType; 229 | _statusWindow: Window_SkillStatus; 230 | _itemWindow: Window_SkillList; 231 | 232 | constructor(); 233 | initialize(): void; 234 | create(): void; 235 | start(): void; 236 | createSkillTypeWindow(): void; 237 | createStatusWindow(): void; 238 | createItemWindow(): void; 239 | refreshActor(): void; 240 | user(): Game_Actor; 241 | commandSkill(): void; 242 | onItemOk(): void; 243 | onItemCancel(): void; 244 | playSeForItem(): void; 245 | useItem(): void; 246 | onActorChange(): void; 247 | } 248 | 249 | declare class Scene_Equip extends Scene_MenuBase 250 | { 251 | _statusWindow: Window_EquipStatus; 252 | _commandWindow: Window_EquipCommand; 253 | _slotWindow: Window_EquipSlot; 254 | _itemWindow: Window_EquipItem; 255 | 256 | constructor(); 257 | initialize(): void; 258 | create(): void; 259 | createStatusWindow(): void; 260 | createCommandWindow(): void; 261 | createSlotWindow(): void; 262 | createItemWindow(): void; 263 | refreshActor(): void; 264 | commandEquip(): void; 265 | commandOptimize(): void; 266 | commandClear(): void; 267 | onSlotOk(): void; 268 | onSlotCancel(): void; 269 | onItemOk(): void; 270 | onItemCancel(): void; 271 | onActorChange(): void; 272 | } 273 | 274 | declare class Scene_Status extends Scene_MenuBase 275 | { 276 | _statusWindow: Window_Status; 277 | 278 | constructor(); 279 | initialize(): void; 280 | create(): void; 281 | refreshActor(): void; 282 | onActorChange(): void; 283 | } 284 | 285 | declare class Scene_Options extends Scene_MenuBase 286 | { 287 | _optionsWindow: Window_Options; 288 | 289 | constructor(); 290 | initialize(): void; 291 | create(): void; 292 | terminate(): void; 293 | createOptionsWindow(): void; 294 | } 295 | 296 | declare class Scene_File extends Scene_MenuBase 297 | { 298 | _listWindow: Window_SavefileList; 299 | _helpWindow: Window_Help; 300 | 301 | constructor(); 302 | initialize(): void; 303 | create(): void; 304 | start(): void; 305 | savefileId(): number; 306 | createHelpWindow(): void; 307 | createListWindow(): void; 308 | mode(): string; 309 | activateListWindow(): void; 310 | helpWindowText(): string; 311 | firstSavefileIndex(): number; 312 | onSavefileOk(): void; 313 | } 314 | 315 | declare class Scene_Save extends Scene_File 316 | { 317 | constructor(); 318 | initialize(): void; 319 | mode(): string; 320 | helpWindowText(): string; 321 | firstSavefileIndex(): number; 322 | onSavefileOk(): void; 323 | onSaveSuccess(): void; 324 | onSaveFailure(): void; 325 | } 326 | 327 | declare class Scene_Load extends Scene_File 328 | { 329 | _loadSuccess: boolean; 330 | 331 | constructor(); 332 | initialize(): void; 333 | terminate(): void; 334 | mode(): string; 335 | helpWindowText(): string; 336 | firstSavefileIndex(): number; 337 | onSavefileOk(): void; 338 | onSaveSuccess(): void; 339 | onSaveFailure(): void; 340 | reloadMapIfUpdated(): void; 341 | } 342 | 343 | declare class Scene_GameEnd extends Scene_MenuBase 344 | { 345 | _commandWindow: Window_GameEnd; 346 | 347 | constructor(); 348 | initialize(): void; 349 | create(): void; 350 | stop(): void; 351 | createBackground(): void; 352 | createCommandWindow(): void; 353 | commandToTitle(): void; 354 | } 355 | 356 | declare class Scene_Shop extends Scene_MenuBase 357 | { 358 | _goods: any[][]; 359 | _purchaseOnly: boolean; 360 | _item: IDataAllItem; 361 | _goldWindow: Window_Gold; 362 | _commandWindow: Window_ShopCommand; 363 | _dummyWindow: Window_Base; 364 | _numberWindow: Window_ShopNumber; 365 | _statusWindow: Window_ShopStatus; 366 | _buyWindow: Window_ShopBuy; 367 | _categoryWindow: Window_ItemCategory; 368 | _sellWindow: Window_ShopSell; 369 | 370 | constructor(); 371 | initialize(): void; 372 | prepare(goods: any[][], purchaseOnly: boolean): void; 373 | create(): void; 374 | createGoldWindow(): void; 375 | createCommandWindow(): void; 376 | createDummyWindow(): void; 377 | createNumberWindow(): void; 378 | createStatusWindow(): void; 379 | createBuyWindow(): void; 380 | createCategoryWindow(): void; 381 | createSellWindow(): void; 382 | activateBuyWindow(): void; 383 | activateSellWindow(): void; 384 | commandBuy(): void; 385 | commandSell(): void; 386 | onBuyOk(): void; 387 | onBuyCancel(): void; 388 | onCategoryOk(): void; 389 | onCategoryCancel(): void; 390 | onSellOk(): void; 391 | onSellCancel(): void; 392 | onNumberOk(): void; 393 | onNumberCancel(): void; 394 | doBuy(number: number): void; 395 | doSell(number: number): void; 396 | endNumberInput(): void; 397 | maxBuy(): number; 398 | maxSell(): number; 399 | money(): number; 400 | currencyUnit(): string; 401 | buyingPrice(): number; 402 | sellingPrice(): number; 403 | } 404 | 405 | declare class Scene_Name extends Scene_MenuBase 406 | { 407 | _actor: Game_Actor; 408 | _actorId: number; 409 | _maxLength: number; 410 | _editWindow: Window_NameEdit; 411 | _inputWindow: Window_NameInput; 412 | 413 | constructor(); 414 | initialize(): void; 415 | prepare(actorId: number, maxLength: number): void; 416 | create(): void; 417 | start(): void; 418 | createEditWindow(): void; 419 | createInputWindow(): void; 420 | onInputOk(): void; 421 | } 422 | 423 | declare class Scene_Debug extends Scene_MenuBase 424 | { 425 | _editWindow: Window_DebugEdit; 426 | _rangeWindow: Window_DebugRange; 427 | _debugHelpWindow : Window_Base; 428 | 429 | constructor(); 430 | initialize(): void; 431 | create(): void; 432 | createRangeWindow(): void; 433 | createEditWindow(): void; 434 | createDebugHelpWindow(): void; 435 | onRangeOk(): void; 436 | onEditCancel(): void; 437 | refreshHelpWindow(): void; 438 | helpText(): string; 439 | } 440 | 441 | declare class Scene_Battle extends Scene_Base 442 | { 443 | _partyCommandWindow: Window_PartyCommand; 444 | _actorCommandWindow: Window_ActorCommand; 445 | _skillWindow: Window_BattleSkill; 446 | _itemWindow: Window_BattleItem; 447 | _actorWindow: Window_BattleActor; 448 | _enemyWindow: Window_BattleEnemy; 449 | _helpWindow: Window_Help; 450 | _statusWindow: Window_BattleStatus; 451 | _spriteset: Spriteset_Battle; 452 | _logWindow: Window_BattleLog; 453 | _messageWindow: Window_Message; 454 | _scrollTextWindow: Window_ScrollText; 455 | 456 | constructor(); 457 | initialize(): void; 458 | create(): void; 459 | start(): void; 460 | update(): void; 461 | updateBattleProcess(): void; 462 | isAnyInputWindowActive(): boolean; 463 | changeInputWindow(): void; 464 | stop(): void; 465 | terminate(): void; 466 | needsSlowFadeOut(): boolean; 467 | updateStatusWindow(): void; 468 | updateWindowPositions(): void; 469 | createDisplayObjects(): void; 470 | createSpriteset(): void; 471 | createAllWindows(): void; 472 | createLogWindow(): void; 473 | createStatusWindow(): void; 474 | createPartyCommandWindow(): void; 475 | createActorCommandWindow(): void; 476 | createHelpWindow(): void; 477 | createSkillWindow(): void; 478 | createItemWindow(): void; 479 | createActorWindow(): void; 480 | createEnemyWindow(): void; 481 | createMessageWindow(): void; 482 | createScrollTextWindow(): void; 483 | refreshStatus(): void; 484 | startPartyCommandSelection(): void; 485 | commandFight(): void; 486 | commandEscape(): void; 487 | startActorCommandSelection(): void; 488 | commandAttack(): void; 489 | commandSkill(): void; 490 | commandGuard(): void; 491 | commandItem(): void; 492 | selectNextCommand(): void; 493 | selectPreviousCommand(): void; 494 | selectActorSelection(): void; 495 | onActorOk(): void; 496 | onActorCancel(): void; 497 | selectEnemySelection(): void; 498 | onEnemyOk(): void; 499 | onEnemyCancel(): void; 500 | onSkillOk(): void; 501 | onSkillCancel(): void; 502 | onItemOk(): void; 503 | onItemCancel(): void; 504 | onSelectAction(): void; 505 | endCommandSelection(): void; 506 | } 507 | 508 | declare class Scene_Gameover extends Scene_Base 509 | { 510 | _backSprite: Sprite; 511 | 512 | constructor(); 513 | initialize(): void; 514 | create(): void; 515 | start(): void; 516 | update(): void; 517 | stop(): void; 518 | terminate(): void; 519 | playGameoverMusic(): void; 520 | createBackground(): void; 521 | isTriggered(): boolean; 522 | gotoTitle(): void; 523 | } 524 | -------------------------------------------------------------------------------- /typings/rpgmakermv/rpg_sprites.d.ts: -------------------------------------------------------------------------------- 1 | declare class Sprite_Base extends Sprite 2 | { 3 | _animationSprites: Sprite_Animation[]; 4 | _effectTarget: Sprite_Base; 5 | _hiding: boolean; 6 | 7 | visible: boolean; 8 | 9 | constructor(); 10 | initialize(): void; 11 | update(): void; 12 | hide(): void; 13 | show(): void; 14 | updateVisibility(): void; 15 | updateAnimationSprites(): void; 16 | startAnimation(animation: IDataAnimation, mirror: boolean, delay: number): void; 17 | isAnimationPlaying(): boolean; 18 | } 19 | 20 | declare class Sprite_Button extends Sprite 21 | { 22 | _touching: boolean; 23 | _coldFrame: Rectangle; 24 | _hotFrame: Rectangle; 25 | _clickHandler: Function; 26 | 27 | constructor(); 28 | initialize(): void; 29 | update(): void; 30 | updateFrame(): void; 31 | setColdFrame(x: number, y: number, width: number, height: number): void; 32 | setHotFrame(x: number, y: number, width: number, height: number): void; 33 | setClickHandler(method: Function): void; 34 | callClickHandler(): void; 35 | processTouch(): void; 36 | isActive(): boolean; 37 | isButtonTouched(): boolean; 38 | canvasToLocalX(x: number): number; 39 | canvasToLocalY(y: number): number; 40 | reserveFaceImages(): void; 41 | } 42 | 43 | declare class Sprite_Character extends Sprite_Base 44 | { 45 | _character: Game_Character; 46 | _balloonSprite: Sprite_Balloon; 47 | _balloonDuration: number; 48 | _tilesetId: number; 49 | _tileId: number; 50 | _characterName: string; 51 | _characterIndex: number; 52 | _upperBody: Sprite; 53 | _lowerBody: Sprite; 54 | _isBigCharacter: boolean; 55 | _bushDepth: number; 56 | 57 | constructor(character?: Game_CharacterBase); 58 | initialize(character?: Game_CharacterBase): void; 59 | initMembers(): void; 60 | setCharacter(character: Game_CharacterBase): void; 61 | update(): void; 62 | updateVisibility(): void; 63 | isTile(): boolean; 64 | tilesetBitmap(tileId: number): Bitmap; 65 | updateBitmap(): void; 66 | isImageChanged(): boolean; 67 | setTileBitmap(): void; 68 | setCharacterBitmap(): void; 69 | updateFrame(): void; 70 | updateTileFrame(): void; 71 | updateCharacterFrame(): void; 72 | characterBlockX(): number; 73 | characterBlockY(): number; 74 | characterPatternX(): number; 75 | characterPatternY(): number; 76 | patternWidth(): number; 77 | patternHeight(): number; 78 | updateHalfBodySprites(): void; 79 | createHalfBodySprites(): void; 80 | updatePosition(): void; 81 | updateAnimation(): void; 82 | updateOther(): void; 83 | setupAnimation(): void; 84 | setupBalloon(): void; 85 | startBalloon(): void; 86 | updateBalloon(): void; 87 | endBalloon(): void; 88 | isBalloonPlaying(): boolean; 89 | } 90 | 91 | declare class Sprite_Battler extends Sprite_Base 92 | { 93 | _battler: Game_Battler; 94 | _damages: Sprite_Damage[]; 95 | _homeX: number; 96 | _homeY: number; 97 | _offsetX: number; 98 | _offsetY: number; 99 | _targetOffsetX: number; 100 | _targetOffsetY: number; 101 | _movementDuration: number; 102 | _selectionEffectCount: number; 103 | 104 | constructor(); 105 | initialize(battler?: Game_Battler): void; 106 | initMembers(): void; 107 | setBattler(battler: Game_Battler): void; 108 | setHome(x: number, y: number): void; 109 | update(): void; 110 | updateVisibility(): void; 111 | updateMain(): void; 112 | updateBitmap(): void; 113 | updateFrame(): void; 114 | updateMove(): void; 115 | updatePosition(): void; 116 | updateAnimation(): void; 117 | updateDamagePopup(): void; 118 | updateSelectionEffect(): void; 119 | setupAnimation(): void; 120 | setupDamagePopup(): void; 121 | damageOffsetX(): number; 122 | damageOffsetY(): number; 123 | startMove(x: number, y: number, duration: number): void; 124 | onMoveEnd(): void; 125 | isEffecting(): boolean; 126 | isMoving(): boolean; 127 | inHomePosition(): boolean; 128 | } 129 | 130 | declare interface IMotion 131 | { 132 | index: number; 133 | loop: boolean; 134 | } 135 | 136 | declare class Sprite_Actor extends Sprite_Battler 137 | { 138 | static MOTIONS: { [key: string]: IMotion }; 139 | 140 | _battlerName: string; 141 | _motion: IMotion; 142 | _motionCount: number; 143 | _pattern: number; 144 | _mainSprite: Sprite_Base; 145 | _effectTarget: Sprite_Base; 146 | _shadowSprite: Sprite; 147 | _weaponSprite: Sprite_Weapon; 148 | _stateSprite: Sprite_StateOverlay; 149 | 150 | constructor(); 151 | initialize(battler?: Game_Actor): void; 152 | initMembers(): void; 153 | createMainSprite(): void; 154 | createShadowSprite(): void; 155 | createWeaponSprite(): void; 156 | createStateSprite(): void; 157 | setBattler(battler: Game_Actor): void; 158 | moveToStartPosition(): void; 159 | setActorHome(index: number): void; 160 | update(): void; 161 | updateShadow(): void; 162 | updateMain(): void; 163 | setupMotion(): void; 164 | setupWeaponAnimation(): void; 165 | startMotion(motionType: string): void; 166 | updateTargetPosition(): void; 167 | updateBitmap(): void; 168 | updateFrame(): void; 169 | updateMove(): void; 170 | updateMotion(): void; 171 | updateMotionCount(): void; 172 | motionSpeed(): number; 173 | refreshMotion(): void; 174 | startEntryMotion(): void; 175 | stepForward(): void; 176 | stepBack(): void; 177 | retreat(): void; 178 | onMoveEnd(): void; 179 | damageOffsetX(): number; 180 | damageOffsetY(): number; 181 | } 182 | 183 | declare class Sprite_Enemy extends Sprite_Battler 184 | { 185 | _enemy: Game_Enemy; 186 | _appeared: boolean; 187 | _battlerName: string; 188 | _battlerHue: number; 189 | _effectType: string; 190 | _effectDuration: number; 191 | _shake: number; 192 | _stateIconSprite: Sprite_StateIcon; 193 | 194 | constructor(); 195 | initialize(battler?: Game_Enemy): void; 196 | initMembers(): void; 197 | createStateIconSprite(): void; 198 | setBattler(battler: Game_Enemy): void; 199 | update(): void; 200 | updateBitmap(): void; 201 | loadBitmap(name: string, hue: number): void; 202 | updateFrame(): void; 203 | updatePosition(): void; 204 | updateStateSprite(): void; 205 | initVisibility(): void; 206 | setupEffect(): void; 207 | startEffect(effectType: string): void; 208 | startAppear(): void; 209 | startDisappear(): void; 210 | startWhiten(): void; 211 | startBlink(): void; 212 | startCollapse(): void; 213 | startBossCollapse(): void; 214 | startInstantCollapse(): void; 215 | updateEffect(): void; 216 | isEffecting(): boolean; 217 | revertToNormal(): void; 218 | updateWhiten(): void; 219 | updateBlink(): void; 220 | updateAppear(): void; 221 | updateDisappear(): void; 222 | updateCollapse(): void; 223 | updateBossCollapse(): void; 224 | updateInstantCollapse(): void; 225 | damageOffsetX(): number; 226 | damageOffsetY(): number; 227 | } 228 | 229 | declare class Sprite_Animation extends Sprite 230 | { 231 | _reduceArtifacts: boolean; 232 | _target: Sprite_Base; 233 | _animation: IDataAnimation; 234 | _mirror: boolean; 235 | _delay: number; 236 | _rate: number; 237 | _duration: number; 238 | _flashColor: number[]; 239 | _flashDuration: number; 240 | _screenFlashDuration: number; 241 | _hidingDuration: number; 242 | _bitmap1: Bitmap; 243 | _bitmap2: Bitmap; 244 | _cellSprites: Sprite[]; 245 | _screenFlashSprite: ScreenSprite; 246 | _duplicated: boolean; 247 | 248 | constructor(); 249 | initialize(): void; 250 | initMembers(): void; 251 | setup(target: Sprite_Base, animation: IDataAnimation, mirror: boolean, delay: number): void; 252 | remove(): void; 253 | setupRate(): void; 254 | setupDuration(): void; 255 | update(): void; 256 | updateFlash(): void; 257 | updateScreenFlash(): void; 258 | absoluteX(): number; 259 | absoluteY(): number; 260 | updateHiding(): void; 261 | isPlaying(): boolean; 262 | loadBitmaps(): void; 263 | isReady(): boolean; 264 | createSprites(): void; 265 | createCellSprites(): void; 266 | createScreenFlashSprite(): void; 267 | updateMain(): void; 268 | updatePosition(): void; 269 | updateFrame(): void; 270 | currentFrameIndex(): void; 271 | updateAllCellSprites(frame: number[][]): void; 272 | updateCellSprite(sprite: Sprite, cell: number[]): void; 273 | processTimingData(timing: IDataAnimationTiming): void; 274 | startFlash(color: number[], duration: number): void; 275 | startScreenFlash(color: number[], duration: number): void; 276 | startHiding(duration: number): void; 277 | } 278 | 279 | declare class Sprite_Damage extends Sprite 280 | { 281 | _duration: number; 282 | _flashColor: number[]; 283 | _flashDuration: number; 284 | _damageBitmap: Bitmap; 285 | 286 | constructor(); 287 | initialize(): void; 288 | setup(target: Game_Battler): void; 289 | digitWidth(): number; 290 | digitHeight(): number; 291 | createMiss(): void; 292 | createDigits(baseRow: number, value: number): void; 293 | createChildSprite(): Sprite; 294 | update(): void; 295 | updateChild(sprite: Sprite): void; 296 | updateFlash(): void; 297 | updateOpacity(): void; 298 | isPlaying(): boolean; 299 | } 300 | 301 | declare class Sprite_StateIcon extends Sprite 302 | { 303 | static _iconWidth: number; 304 | static _iconHeight: number; 305 | 306 | _battler: Game_Battler; 307 | _iconIndex: number; 308 | _animationCount: number; 309 | _animationIndex: number; 310 | 311 | constructor(); 312 | initialize(): void; 313 | initMembers(): void; 314 | setup(battler: Game_Battler): void; 315 | update(): void; 316 | animationWait(): number; 317 | updateIcon(): void; 318 | updateFrame(): void; 319 | } 320 | 321 | declare class Sprite_StateOverlay extends Sprite_Base 322 | { 323 | _battler: Game_Battler; 324 | _overlayIndex: number; 325 | _animationCount: number; 326 | _pattern: number; 327 | 328 | constructor(); 329 | initialize(): void; 330 | initMembers(): void; 331 | loadBitmap(): void; 332 | setup(battler: Game_Battler): void; 333 | update(): void; 334 | animationWait(): number; 335 | updatePattern(): void; 336 | updateFrame(): void; 337 | } 338 | 339 | declare class Sprite_Weapon extends Sprite_Base 340 | { 341 | _weaponImageId: number; 342 | _animationCount: number; 343 | _pattern: number; 344 | 345 | constructor(); 346 | initialize(): void; 347 | initMembers(): void; 348 | setup(weaponImageId: number): void; 349 | update(): void; 350 | animationWait(): number; 351 | updatePattern(): void; 352 | loadBitmap(): void; 353 | updateFrame(): void; 354 | isPlaying(): boolean; 355 | } 356 | 357 | declare class Sprite_Balloon extends Sprite_Base 358 | { 359 | _balloonId: number; 360 | _duration: number; 361 | 362 | constructor(); 363 | initialize(): void; 364 | initMembers(): void; 365 | loadBitmap(): void; 366 | setup(balloonId: number): void; 367 | update(): void; 368 | updateFrame(): void; 369 | speed(): number; 370 | waitTime(): number; 371 | frameIndex(): number; 372 | isPlaying(): boolean; 373 | } 374 | 375 | declare class Sprite_Picture extends Sprite 376 | { 377 | _pictureId: number; 378 | _pictureName: string; 379 | _isPicture: boolean; 380 | 381 | constructor(pictureId: number); 382 | initialize(): void; 383 | initialize(pictureId: number): void; 384 | picture(): Game_Picture; 385 | update(): void; 386 | updateBitmap(): void; 387 | updateOrigin(): void; 388 | updatePosition(): void; 389 | updateScale(): void; 390 | updateTone(): void; 391 | updateOther(): void; 392 | loadBitmap(): void; 393 | } 394 | 395 | declare class Sprite_Timer extends Sprite 396 | { 397 | _seconds: number; 398 | 399 | constructor(); 400 | initialize(): void; 401 | createBitmap(): void; 402 | update(): void; 403 | updateBitmap(): void; 404 | redraw(): void; 405 | timerText(): string; 406 | updatePosition(): void; 407 | updateVisibility(): void; 408 | } 409 | 410 | declare class Sprite_Destination extends Sprite 411 | { 412 | _frameCount: number; 413 | 414 | constructor(); 415 | initialize(): void; 416 | update(): void; 417 | createBitmap(): void; 418 | updatePosition(): void; 419 | updateAnimation(): void; 420 | } 421 | 422 | declare class Spriteset_Base extends Sprite 423 | { 424 | _tone: number[]; 425 | _baseSprite: Sprite; 426 | _toneSprite: ToneSprite; 427 | _toneFilter: ToneFilter; 428 | _pictureContainer: Sprite; 429 | _timerSprite: Sprite_Timer; 430 | _flashSprite: ScreenSprite; 431 | _fadeSprite: ScreenSprite; 432 | 433 | opaque: boolean; 434 | 435 | constructor(); 436 | initialize(): void; 437 | createLowerLayer(): void; 438 | createUpperLayer(): void; 439 | update(): void; 440 | createBaseSprite(): void; 441 | createToneChanger(): void; 442 | createCanvasToneChanger(): void; 443 | createPictures(): void; 444 | createTimer(): void; 445 | createScreenSprites(): void; 446 | updateScreenSprites(): void; 447 | updateToneChanger(): void; 448 | updateWebGLToneChanger(): void; 449 | updateCanvasToneChanger(): void; 450 | updatePosition(): void; 451 | } 452 | 453 | declare class Spriteset_Map extends Spriteset_Base 454 | { 455 | _parallax: TilingSprite; 456 | _parallaxName: string; 457 | _tilemap: Tilemap; 458 | _tileset: IDataTileset; 459 | _characterSprites: Sprite_Character[]; 460 | _shadowSprite: Sprite; 461 | _destinationSprite: Sprite_Destination; 462 | _weather: Weather; 463 | 464 | constructor(); 465 | initialize(): void; 466 | createLowerLayer(): void; 467 | update(): void; 468 | hideCharacters(): void; 469 | createParallax(): void; 470 | createTilemap(): void; 471 | loadTileset(): void; 472 | createCharacters(): void; 473 | createShadow(): void; 474 | createDestination(): void; 475 | createWeather(): void; 476 | updateTileset(): void; 477 | 478 | _canvasReAddParallax(): void; 479 | 480 | updateParallax(): void; 481 | updateTilemap(): void; 482 | updateShadow(): void; 483 | updateWeather(): void; 484 | } 485 | 486 | declare class Spriteset_Battle extends Spriteset_Base 487 | { 488 | _battlebackLocated: boolean; 489 | _backgroundSprite: Sprite; 490 | _battleField: Sprite; 491 | _back1Sprite: TilingSprite; 492 | _back2Sprite: TilingSprite; 493 | _enemySprites: Sprite_Enemy[]; 494 | _actorSprites: Sprite_Actor[]; 495 | 496 | constructor(); 497 | initialize(): void; 498 | createLowerLayer(): void; 499 | createBackground(): void; 500 | update(): void; 501 | createBattleField(): void; 502 | createBattleback(): void; 503 | updateBattleback(): void; 504 | locateBattleback(): void; 505 | battleback1Bitmap(): Bitmap; 506 | battleback2Bitmap(): Bitmap; 507 | battleback1Name(): string; 508 | battleback2Name(): string; 509 | overworldBattleback1Name(): string; 510 | overworldBattleback2Name(): string; 511 | normalBattleback1Name(): string; 512 | normalBattleback2Name(): string; 513 | terrainBattleback1Name(type: number): string; 514 | terrainBattleback2Name(type: number): string; 515 | defaultBattleback1Name(): string; 516 | defaultBattleback2Name(): string; 517 | shipBattleback1Name(): string; 518 | shipBattleback2Name(): string; 519 | autotileType(z: number): number; 520 | createEnemies(): void; 521 | compareEnemySprite(a: Sprite_Enemy, b: Sprite_Enemy): number; 522 | createActors(): void; 523 | updateActors(): void; 524 | battlerSprites(): Sprite_Battler[]; 525 | isAnimationPlaying(): boolean; 526 | isEffecting(): boolean; 527 | isAnyoneMoving(): boolean; 528 | isBusy(): boolean; 529 | } 530 | -------------------------------------------------------------------------------- /typings/rpgmakermv/rpgmakermv.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// 11 | --------------------------------------------------------------------------------