|
本帖最后由 烁灵 于 2024-7-15 11:07 编辑
简单设置技能选中后继续选择该角色的其他行动
在【技能】的备注栏填写
即可,这个效果一回合只能使用一次。
脚本:保存为 SimpleSkillMulticast.js
- /*:
- * @target MZ
- * @plugindesc 简易技能连续行动
- * 更多插件请访问 www.hknmtt.com
- * @author 烁灵
- *
- * @help SimpleSkillMulticast.js
- *
- * 在【技能】的备注栏中填写备注:
- * <SLMULTICAST>
- * 可以使得选中该技能后,可以继续选择该角色的其他行动
- * 这个效果一回合只能使用一次
- *
- */
- (function() {
- var Imported = Imported || {};
- Imported.Soulbaka_Multicast = true;
- var soulbaka = soulbaka || {};
- soulbaka.Multicast = soulbaka.Multicast || {};
- soulbaka.Multicast.skills = {};
- soulbaka.Multicast.multiActors = {}
- soulbaka.Multicast.multiskill_DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
- DataManager.isDatabaseLoaded = function() {
- if (!soulbaka.Multicast.multiskill_DataManager_isDatabaseLoaded.call(this)) return false;
- if (!soulbaka.Multicast._loaded) {
- this.process_Multicast_notetags($dataSkills);
- soulbaka.Multicast._loaded = true;
- }
- return true;
- };
- DataManager.process_Multicast_notetags = function(group) {
- let regex = [
- /\<SLMULTICAST\>/i,
- ];
- for (var n = 1; n < group.length; n++) {
- let obj = group[n];
- let notedata = obj.note.split(/[\r\n]+/);
- for (var i = 0; i < notedata.length; i++) {
- let result;
- if ([, ...result] = notedata[i].match(regex[0]) || '') {
- soulbaka.Multicast.skills[obj.id] = true;
- }
- }
- }
- };
- Game_Actor.prototype.selectNextCommand = function() {
- if (this._actionInputIndex < this.numActions() - 1) {
- this._actionInputIndex++;
- return true;
- } else {
- // 判断上个行动是否是连续行动技能
- if (this.inputtingAction() &&
- this.inputtingAction()._item &&
- soulbaka.Multicast.skills[this.inputtingAction()._item._itemId] &&
- !soulbaka.Multicast.multiActors[this._actorId]) {
- this._actionInputIndex++;
- this._actions.push(new Game_Action(this));
- soulbaka.Multicast.multiActors[this._actorId] = true;
- return true;
- }
- return false;
- }
- };
- soulbaka.Multicast.multiskill_BattleManager_startActorInput = BattleManager.startActorInput;
- BattleManager.startActorInput = function() {
- soulbaka.Multicast.multiskill_BattleManager_startActorInput.call(this);
- if (this._currentActor) {
- // 取消连续行动标记
- if (soulbaka.Multicast.multiActors[this._currentActor._actorId]) {
- soulbaka.Multicast.multiActors[this._currentActor._actorId] = false;
- this._currentActor.makeActions(); // 重新初始化行动
- }
- }
- };
- soulbaka.Multicast.multiskill_BattleManager_startBattle = BattleManager.startBattle;
- BattleManager.startBattle = function() {
- // 初始化连续行动标记
- soulbaka.Multicast.multiActors = {};
- soulbaka.Multicast.multiskill_BattleManager_startBattle.call(this);
- };
- })();
复制代码
|
|