加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 gp371322 于 2021-8-28 07:51 编辑
可以了
//========================================== // 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; } }; })();
//==========================================
// 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;
}
};
})();
|