| 赞 | 15 |
| VIP | |
| 好人卡 | |
| 积分 | 3 |
| 经验 | |
| 最后登录 | 2026-5-25 |
| 在线时间 | 217 小时 |
- 梦石
- 0
- 星屑
- 296
- 在线时间
- 217 小时
- 注册时间
- 2008-12-18
- 回帖
- 30
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
国庆时候写的多周目插件,
一直犹豫着要不要发出来,
因为自我感觉还是半成品。
少了一些可制定化的设置。
- /*:
- * Renews.js
- * @plugindesc 多周目游戏
- * @author 魏玉龙
- * @since 2018.10.01
- * @version 0.1
- *
- * @param clearCountVariable
- * @desc 通关次数同步变量值。大于0时,相应变量值同步通关次数。等于0则无变量同步次数。
- * @default 0
- *
- * @param inheritVariables
- * @desc 需要被继承的变量ID 多个变量时用‘,’间隔
- * @default 0
- *
- * @param inheritSwitches
- * @desc 需要被继承的开关ID 多个开关时用‘,’间隔
- * @default 0
- *
- * @help
- * 此插件提供以下插件命令:
- *
- * 通关标记 [string]
- * 对接下来的通关存档做标记
- *
- */
- (function () {
- var parameters = PluginManager.parameters('Renews');
- var clearCountVariable = Number(parameters['clearCountVariable']) || 0;
- var inheritVariables = parameters['inheritVariables'].split(',');
- var inheritSwitches = parameters['inheritSwitches'].split(',');
- var DataManager_makeSavefileInfo = DataManager.makeSavefileInfo;
- DataManager.makeSavefileInfo = function () {
- var info = DataManager_makeSavefileInfo.call(this);
- info.gameClear = $gameTemp.isGameClear();
- info.clearSign = $gameTemp.clearSign();
- return info;
- };
- DataManager.startRenewGame = function (savefileId) {
- var json = JsonEx.parse(StorageManager.load(savefileId));
- if (this.isThisGameFile(savefileId)) {
- this.createGameObjects();
- this.extractRenewContents(json);
- $gamePlayer.reserveTransfer($dataSystem.startMapId,
- $dataSystem.startX, $dataSystem.startY);
- $gameParty.setupStartingMembers();
- $gameVariables.setValue(clearCountVariable, $gameSystem.gameClearCount());
- return true;
- } else {
- return false;
- }
- }
- DataManager.extractRenewContents = function (contents) {
- $gameSystem = contents.system;
- $gameActors = contents.actors;
- $gameParty = contents.party;
- inheritVariables.forEach(function (value) {
- var variableId = Number(value) || 0;
- if (value > 0) {
- $gameVariables.setValue(variableId, contents.variables.value(variableId));
- }
- });
- inheritSwitches.forEach(function (value) {
- var variableId = Number(value) || 0;
- if (value > 0) {
- $gameSwitches.setValue(variableId, contents.Switches.value(variableId));
- }
- });
- }
- var Game_Temp_prototype_initialize = Game_Temp.prototype.initialize;
- Game_Temp.prototype.initialize = function () {
- Game_Temp_prototype_initialize.call(this);
- this._gameClear = false;
- this._clearSign = '';
- };
- Game_Temp.prototype.isGameClear = function () {
- return this._gameClear;
- };
- Game_Temp.prototype.clearSign = function () {
- return this._clearSign;
- };
- Game_Temp.prototype.setGameClear = function (sign) {
- this._gameClear = true;
- this._clearSign = sign;
- $gameSystem._gameClearCount += 1;
- };
- var Game_System_prototype_initialize = Game_System.prototype.initialize;
- Game_System.prototype.initialize = function () {
- Game_System_prototype_initialize.call(this);
- this._gameClearCount = 0;
- };
- Game_System.prototype.gameClearCount = function () {
- return this._gameClearCount;
- }
- Window_SavefileList.prototype.drawGameTitle = function (info, x, y, width) {
- if (info.title) {
- var title = info.title;
- if (info.gameClear && info.clearSign) {
- title += ' ' + info.clearSign;
- }
- this.drawText(title, x, y, width);
- }
- };
- function Window_RenewGame() {
- this.initialize.apply(this, arguments);
- }
- Window_RenewGame.prototype = Object.create(Window_Command.prototype);
- Window_RenewGame.prototype.constructor = Window_RenewGame;
- Window_RenewGame.prototype.initialize = function () {
- Window_Command.prototype.initialize.call(this, 0, 0);
- this.updatePlacement();
- };
- Window_RenewGame.prototype.windowWidth = function () {
- return 200;
- };
- Window_RenewGame.prototype.windowHeight = function () {
- return this.fittingHeight(2);
- };
- Window_RenewGame.prototype.updatePlacement = function () {
- this.x = (Graphics.boxWidth - this.width) / 2;
- this.y = (Graphics.boxHeight - this.height) / 2;
- };
- Window_RenewGame.prototype.makeCommandList = function () {
- this.addCommand('重新开始', 'renew');
- this.addCommand('取消', 'cancel');
- };
- var Scene_Load_prototype_create = Scene_Load.prototype.create;
- Scene_Load.prototype.create = function () {
- Scene_Load_prototype_create.call(this);
- this.createRenewWindow();
- }
- Scene_Load.prototype.createRenewWindow = function () {
- this._renewWindow = new Window_RenewGame();
- this._renewWindow.setHandler('renew', this.startRenewGame.bind(this));
- this._renewWindow.setHandler('cancel', this.cancelRenewGame.bind(this));
- this._renewWindow.deactivate();
- this._renewWindow.hide();
- this.addWindow(this._renewWindow);
- }
- Scene_Load.prototype.isRenewGame = function () {
- var info = DataManager.loadSavefileInfo(this.savefileId());
- return info.gameClear;
- }
- Scene_Load.prototype.startRenewGame = function () {
- this.onStartRenewGame();
- }
- Scene_Load.prototype.cancelRenewGame = function () {
- this._renewWindow.deactivate();
- this._renewWindow.hide();
- this.activateListWindow();
- }
- Scene_Load.prototype.onSavefileOk = function () {
- Scene_File.prototype.onSavefileOk.call(this);
- if (DataManager.isThisGameFile(this.savefileId())) {
- if (this.isRenewGame()) {
- this._renewWindow.show();
- this._renewWindow.activate();
- } else {
- DataManager.loadGame(this.savefileId())
- this.onLoadSuccess();
- }
- } else {
- this.onLoadFailure();
- }
- }
- Scene_Load.prototype.onStartRenewGame = function () {
- DataManager.startRenewGame(this.savefileId());
- SoundManager.playLoad();
- this.fadeOutAll();
- SceneManager.goto(Scene_Map);
- this._loadSuccess = true;
- }
- var Scene_Gameover_prototype_gotoTitle = Scene_Gameover.prototype.gotoTitle;
- Scene_Gameover.prototype.gotoTitle = function () {
- if ($gameTemp.isGameClear()) {
- SceneManager.push(Scene_Save);
- } else {
- Scene_Gameover_prototype_gotoTitle.call(this);
- }
- }
- var Scene_Save_prototype_popScene = Scene_Save.prototype.popScene;
- Scene_Save.prototype.popScene = function () {
- Scene_Save_prototype_popScene.call(this);
- if ($gameTemp.isGameClear()) {
- SceneManager.goto(Scene_Title);
- }
- }
- var Scene_Save_prototype_helpWindowText = Scene_Save.prototype.helpWindowText;
- Scene_Save.prototype.helpWindowText = function () {
- if ($gameTemp.isGameClear()) {
- return '将通关文档存储在哪个文件?';
- } else {
- return Scene_Save_prototype_helpWindowText.call(this);
- }
- };
- var Game_Interpreter_prototype_pluginCommand = Game_Interpreter.prototype.pluginCommand;
- Game_Interpreter.prototype.pluginCommand = function (command, args) {
- Game_Interpreter_prototype_pluginCommand.call(this, command, args);
- if (command === "通关标记") {
- var sign = args[1] || '⚝';
- $gameTemp.setGameClear(sign);
- }
- };
- })();
复制代码
犹豫了几天还是觉得先发出来吧,让各位小白鼠帮着测测BUG也好啊!
用法很简单!游戏结束前插入指令:通关标记
就可以了!插件可以设定记录通关次数的变量ID
并且可以设置需要下个周目要保存的变量及开关!
通关存档后,存档文件会有标记!就可以从哪个通关档开始新游戏!
继承全部人物属性及物品装备!少了黑名单功能,所以有些不应该被继承的暂时在结局前手动删一下吧!
等有空了继续完善吧!
目前在写一个超级Debug的插件用来调试和测试游戏用,这个插件没有重大BUG暂时不会更新!
小白鼠们可以在该贴下提BUG或需要加入的功能,我有空了就完善一下!
|
评分
-
查看全部评分
|