//========================================== // RPG Maker MZ - Actions //========================================== /*: * @target MZ * @plugindesc * @author * @help *------------------------------------------ * @param addStates * @text 使用技能击败敌人添加状态 * @type struct<addStates>[] * @default [] * @desc */ /*~struct~addStates: * @param skillId * @text 技能ID * @type skill * @default 0 * @desc * * @param stateId * @text 状态ID * @type state * @default 0 * @desc * */ (() => { 'use strict'; const pluginName = "Actions"; const parameters = PluginManager.parameters(pluginName); const realparameters =JSON.parse(parameters['addStates']); //读取参数 if(realparameters){ for(let i = 0;i < realparameters.length;i++){ realparameters[i] =JSON.parse(realparameters[i]); } }; // 表现倒下(死亡后的消失效果) const _Game_Enemy_performCollapse =Game_Enemy.prototype.performCollapse; Game_Enemy.prototype.performCollapse = function() { Game_Battler.prototype.performCollapse.call(this); switch (this.collapseType()) { case 0: //取得最后杀敌角色使用技能ID const lastSkill = BattleManager._subject._lastBattleSkill._itemId; for(let i = 0;i < realparameters.length;i++){ if (lastSkill == realparameters[i].skillId) { //添加状态 BattleManager._subject.addState(parseInt(realparameters[i].stateId)); //强制行动 //BattleManager._subject.forceAction(parseInt(realparameters[i].skillId),-1); } } this.requestEffect("collapse"); SoundManager.playEnemyCollapse(); break; case 1: this.requestEffect("bossCollapse"); SoundManager.playBossCollapse1(); break; case 2: this.requestEffect("instantCollapse"); break; } }; })();
aster258 发表于 2021-8-27 19:29
状态勾选战斗结束后解除。。。
或者设置走1步就解除
2.jpg (24.09 KB, 下载次数: 55)
MH-Pride 发表于 2021-8-27 23:31
(() => {
'use strict';
const pluginName = "Actions";
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |