MV Damage Pop-Up in Map [Mog vs. Triacontane] HELP

Hi!😅
I use Mog Plugins and my battle system is ABS.
The MOG_DmgPopupEffects is used to show the Damage on Characters when hit by an Enemy, but it doesn't show the Damage popup when it's in an Event where the Character loses or gains HP or Damaged Floor.
Tried to use Triacontane's Character Popup Damage Plugin but it nullifies the damage popups from MOG Enemies.
Could someone analyze these plugins or make a "basic" plugin for Damage PopUp on the map?

Spoiler: MOG-Damage PopUp
//============================================================================= // MOG_DmgPopupEffects.js //============================================================================= /*: * @plugindesc (v1.0) Adiciona alguns efeitos nos sprites do dano. * @author Moghunter * * @param Duration * @desc Duração do dano. * @default 90 * * @param PopUp Type * @desc Tipo de Animação. * 0 - Bouncing 1 - Flying * @default 0 * * @param Zoom Effect * @desc Ativar efeito de Zoom. * @default true * * @param Center Y-Axis * @desc Centralizar a posição do dano baseado na altura do battler. * @default true * * @help * ============================================================================= * +++ MOG - Damage Popup Effects (v1.0) +++ * By Moghunter * https://atelierrgss.wordpress.com/ * ============================================================================= * Adiciona alguns efeitos nos sprites do dano e novas Strings. * * É necessário que a imagem tenha a altura dividida por 8 para que as imagens * fiquem alinhadas. (O padrão é 5) * * ============================================================================= * É possível ajustar a posição do dano usando o comentário abaixo na * caixa de notas. * * Damage Offset: X:Y * * Exemplo * * Damage Offset: 60:20 * */ //============================================================================= // ** PLUGIN PARAMETERS //=============================================================================   var Imported = Imported || {};   Imported.MOG_DmgPopupEffects = true;   var Moghunter = Moghunter || {}; Moghunter.parameters = PluginManager.parameters('MOG_DmgPopupEffects'); Moghunter.dmgp_duration = Number(Moghunter.parameters['Duration'] || 90); Moghunter.dmgp_popup_type = Number(Moghunter.parameters['PopUp Type'] || 0); Moghunter.dmgp_zoom_effect = String(Moghunter.parameters['Zoom Effect'] || "true"); Moghunter.dmgp_center_y = String(Moghunter.parameters['Center Y-Axis'] || "true"); //============================================================================= // ** Game Action Result //============================================================================= //============================== // ** Clear //============================== var _mog_dmgpop_gaction_clear = Game_ActionResult.prototype.clear Game_ActionResult.prototype.clear = function() { _mog_dmgpop_gaction_clear.call(this); this.counter = false; this.reflection = false; }; //============================================================================= // ** Game Battler //============================================================================= var _mog_dmgpop_gbat_initMembers = Game_Battler.prototype.initMembers; Game_Battler.prototype.initMembers = function() { _mog_dmgpop_gbat_initMembers.call(this); this._dmgOffsetX = 0; this._dmgOffsetY = 0; }; //============================== // ** perform Counter //============================== var _mog_dmgpop_gbat_performCounter = Game_Battler.prototype.performCounter; Game_Battler.prototype.performCounter = function() { _mog_dmgpop_gbat_performCounter.call(this); this.startDamagePopup(); this._result.counter = true; }; //============================== // ** perform Reflection //============================== var _mog_dmgpop_gbat_performReflection = Game_Battler.prototype.performReflection; Game_Battler.prototype.performReflection = function() { _mog_dmgpop_gbat_performReflection.call(this); this.startDamagePopup(); this._result.reflection = true; }; //============================== // * Notetags //============================== Game_Battler.prototype.notetags = function() { if (this.isEnemy()) {return this.enemy().note.split(/[\r\n]+/)}; if (this.isActor()) {return this.actor().note.split(/[\r\n]+/)}; }; //============================== // * setDmgOffset //============================== Game_Battler.prototype.setDmgOffset = function() { this.notetags().forEach(function(note) {var note_data = note.split(': '); if (note_data[0].toLowerCase() == "damage offset"){ var par = note_data[1].split(':'); this._dmgOffsetX = Number(par[0]); this._dmgOffsetY = Number(par[1]); } },this); }; //============================================================================= // ** Game Actor //============================================================================= //============================== // * Setup //============================== var _mog_dmgpop_gact_setup = Game_Actor.prototype.setup; Game_Actor.prototype.setup = function(actorId) { _mog_dmgpop_gact_setup.call(this,actorId); this.setDmgOffset(); }; //============================================================================= // ** Game Enemy //============================================================================= //============================== // * Setup //============================== var _mog_dmgpop_gemy_setup = Game_Enemy.prototype.setup; Game_Enemy.prototype.setup = function(enemyId, x, y) { _mog_dmgpop_gemy_setup.call(this,enemyId, x, y); this.setDmgOffset(); }; //============================================================================= // ** Sprite Damage //============================================================================= //============================== // ** initialize //============================== var _mog_dmgpopeffect_sprit_dmg_initialize = Sprite_Damage.prototype.initialize; Sprite_Damage.prototype.initialize = function() { _mog_dmgpopeffect_sprit_dmg_initialize.call(this); this._duration = Math.min(Math.max(Moghunter.dmgp_duration,10),999); this._zoomEffect = String(Moghunter.dmgp_zoom_effect) === "true" ? true : false; this._animeType = Math.min(Math.max(Moghunter.dmgp_popup_type,0),2); this._damage = [0,0]; }; //============================== // ** Setup //============================== var _mog_dmgpop_sprdmg_setup = Sprite_Damage.prototype.setup; Sprite_Damage.prototype.setup = function(target) { _mog_dmgpop_sprdmg_setup.call(this,target); var result = target.result(); if (result.counter) {this.createCounter() } else if (result.reflection) {this.createReflection()}; }; //============================== // ** Create Miss //============================== Sprite_Damage.prototype.createMiss = function() { var w = this.digitWidth(); var h = this.digitHeight(); var sprite = this.createChildSprite(); sprite.setFrame(0, 4 * h, 10 * w, h); sprite.dy = 0; sprite.x = (6 * w) / 2; }; //============================== // ** Create Critical //============================== Sprite_Damage.prototype.createCritical = function() { var w = this.digitWidth(); var h = this.digitHeight(); var sprite = this.createChildSprite(); sprite.setFrame(0, 5 * h, 10 * w, h); sprite.dy = 0; sprite.yf2 = h + 5; if (this._zoomEffect && this._animeType === 1) { sprite.yf3 = 16; sprite.rotation = 0.1; }; sprite.x = (5 * w) / 2; }; //============================== // ** Create Counter //============================== Sprite_Damage.prototype.createCounter = function() { var w = this.digitWidth(); var h = this.digitHeight(); var sprite = this.createChildSprite(); sprite.setFrame(0, 6 * h, 10 * w, h); sprite.dy = 0; sprite.x = (5 * w) / 2; }; //============================== // ** Create Reflect //============================== Sprite_Damage.prototype.createReflection = function() { var w = this.digitWidth(); var h = this.digitHeight(); var sprite = this.createChildSprite(); sprite.setFrame(0, 7 * h, 10 * w, h); sprite.dy = 0; sprite.x = (5 * w) / 2; }; //============================== // ** CreateChild Sprite //============================== Sprite_Damage.prototype.createChildSprite = function() { var sprite = new Sprite(); sprite.bitmap = this._damageBitmap; this.setBaseData(sprite); return sprite; }; //============================== // ** set Base Data //============================== Sprite_Damage.prototype.setBaseData = function(sprite) { sprite.anchor.x = 0.5; sprite.anchor.y = 1; sprite.y = -40; sprite.zt = 0; sprite.ry = sprite.y; sprite.yf = 0; sprite.yf2 = 0; sprite.yf3 = 0; sprite.ex = false; this.addChild(sprite); }; //============================== // ** createDigits //============================== Sprite_Damage.prototype.createDigits = function(baseRow, value) { var string = Math.abs(value).toString(); var row = baseRow + (value < 0 ? 1 : 0); var w = this.digitWidth(); var h = this.digitHeight(); for (var i = 0; i < string.length; i++) { var sprite = this.createChildSprite(); var n = Number(string[i]); sprite.setFrame(n * w, row * h, w, h); sprite.x = (i - (string.length - 1) / 2) * w; sprite.dy = -i; if (this._zoomEffect) {this.setZoomEffect(sprite,string.length * 2,i)}; }; this._damage = [value,string.length]; }; //============================== // ** Setup Critical Effect //============================== var _mog_sprtdmb_setupCriticalEffect = Sprite_Damage.prototype.setupCriticalEffect; Sprite_Damage.prototype.setupCriticalEffect = function() { _mog_sprtdmb_setupCriticalEffect.call(this); this.createCritical(); }; //============================== // ** DigiHeight //============================== Sprite_Damage.prototype.digitHeight = function() { return this._damageBitmap ? this._damageBitmap.height / 8 : 0; }; //============================== // ** set Zoom Effect //============================== Sprite_Damage.prototype.setZoomEffect = function(sprite,d,i) { if (!d) {d = 0}; if (!i) {i = 0}; sprite.scale.x = 2.5; sprite.scale.y = 2.5; sprite.anchor.x = 0.5; sprite.anchor.y = 0.5; sprite.yf = this.digitHeight() / 2; this._duration += d; sprite.zt = 5 * i; }; //============================== // ** Update Child //============================== Sprite_Damage.prototype.updateChild = function(sprite) { sprite.setBlendColor(this._flashColor); if (sprite.zt > 0) {sprite.zt -= 1; sprite.opacity = 0}; if (sprite.zt <= 0) {this.updateDmgSpriteEffect(sprite)}; } //============================== // ** Update Dmg Sprite Effect //============================== Sprite_Damage.prototype.updateDmgSpriteEffect = function(sprite) { if (this._animeType === 0) {this.updateBounceEffect(sprite); } else {this.updateFlyEffect(sprite)} if (this._zoomEffect) {this.updateZoomEffect(sprite)}; }; //============================== // ** Update Fly Effect //============================== Sprite_Damage.prototype.updateFlyEffect = function(sprite) { sprite.yf3 -= 1; sprite.y = - sprite.yf2 + sprite.yf3; if (this._duration > 30) {sprite.opacity += 10 } else { sprite.opacity -= 10}; }; //============================== // ** Update Bounce Effect //============================== Sprite_Damage.prototype.updateBounceEffect = function(sprite) { sprite.opacity += 35; sprite.dy += 0.5; sprite.ry += sprite.dy; if (sprite.ry >= 0) { sprite.ry = 0; sprite.dy *= -0.6; }; sprite.y = Math.round(sprite.ry) - sprite.yf - sprite.yf2; }; //============================== // ** Update Zoom Effect //============================== Sprite_Damage.prototype.updateZoomEffect = function(sprite) { if (sprite.scale.x > 1.00) {sprite.scale.x -= 0.05}; sprite.scale.y = sprite.scale.x; }; //============================================================================= // ** Sprite Battler //============================================================================= //============================== // ** initMemters //============================== var _mog_dmgpopup_sprbat_initMembers = Sprite_Battler.prototype.initMembers; Sprite_Battler.prototype.initMembers = function() { _mog_dmgpopup_sprbat_initMembers.call(this); this._dmgCenter = String(Moghunter.dmgp_center_y) === "true" ? true : false; }; //============================================================================= // ** Sprite Actor //============================================================================= //============================== // ** damageOffsetX //============================== Sprite_Actor.prototype.damageOffsetX = function() { return this._battler._dmgOffsetX; }; //============================== // ** damageOffsetY //============================== Sprite_Actor.prototype.damageOffsetY = function() { return this._battler._dmgOffsetY; }; //============================================================================= // ** Sprite Enemy //============================================================================= //============================== // ** damageOffsetX //============================== Sprite_Enemy.prototype.damageOffsetX = function() { return this._battler._dmgOffsetX; }; //============================== // ** damageOffsetY //============================== Sprite_Enemy.prototype.damageOffsetY = function() { if (this._dmgCenter && this.bitmap) {return (-this.bitmap.height / 2) + this._battler._dmgOffsetY + 16;}; return this._battler._dmgOffsetY; };

Spoiler: Triacontane-Character Popup Damage
//============================================================================= // CharacterPopupDamage.js // ---------------------------------------------------------------------------- // (C) 2016 Triacontane // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // ---------------------------------------------------------------------------- // Versão. // 1.6.1 2019/04/20 Alterada a notação quando o dano é 0 de "MISS" para "0" // 1.6.0 2018/11/11 Suporta a função de digitação de plugins // Adicionado um switch que pode silenciar o efeito de som pop-up // 1.5.1 2017/11/10 Corrigido um erro causado por copypemis // 1.5.0 23/04/2017 Adicionada a função para piscar o caractere no momento do pop-up // 1.4.0 2017/03/03 Adicionada uma configuração que pode aparecer na frente da imagem // Corrigido para que a taxa de ampliação possa ser alterada livremente, mesmo que não haja rotação // 1.3.0 2017/01/23 Suporta pop-ups de dano por deslizamento // Adicionada a capacidade de exibir o popup do seguidor correspondente // 1.2.0 2016/12/31 Adicionada função de configuração de tom de cor pop-up // Adicionada uma função que permite especificar o método de exibição do popup em detalhes. // 1.1.1 2016/09/15 Corrigido um problema em que as configurações de pop-up automático estavam afetando os manuais na correção mais recente // 1.1.0 2016/09/14 Adicionada a função para especificar um efeito de som dedicado para dano de MP // Adicionada uma função que pode definir individualmente a disponibilidade de saída de acordo com as condições de HP, MP, TP, aumentar, diminuir // 1.0.3 2016/09/10 Resolver conflito com VE_BasicModule.js // 1.0.2 2016/04/17 Corrigido um problema em que o comando popup disable plugin não estava funcionando // 1.0.1 2016/04/10 Corrigido que era interpretado ao contrário ao aumentar e diminuir em conjunto com o aumento e diminuição de HP // 1.0.0 2016/04/09 Primeira Edição // ---------------------------------------------------------------------------- // [Blog] : https://triacontane.blogspot.jp/ // [Twitter]: https://twitter.com/triacontane/ // [GitHub] : https://github.com/triacontane/ //============================================================================= /*: * @plugindesc Plugin pop de dano de caracter * @author Triacontane * * @param Desempenho de efeitos sonoros * @desc Reproduz automaticamente os efeitos sonoros do sistema de acordo com a situação.(ON/OFF) * @default true * @type boolean * * @param Desliga o ID do switch * @desc Quando a chave do ID especificado estiver em ON, o efeito de som do sistema não será reproduzido automaticamente. * @default 0 * @type switch * * @param correção da coordenada X * @desc Corrige a coordenada X da posição do popup. * @default 0 * * @param correção de coordenada Y * @desc Corrige a coordenada Y da posição do popup. * @default 0 * * @param HP pop-up automático * @desc Tem como alvo o aumento/diminuição de HP para pop-ups automáticos.(ON/OFF) * @default true * @type boolean * * @param MP pop-up automático * @desc Torna o aumento/diminuição de MP sujeito a pop-ups automáticos.(ON/OFF) * @default true * @type boolean * * @param TP pop-up automático * @desc O aumento/diminuição de TP é direcionado para pop-up automático.(ON/OFF) * @default true * @type boolean * * @param Aumenta o pop-up automático * @desc Visa o aumento do parâmetro @desc para um popup automático.(ON/OFF) * @default true * @type boolean * * @param Diminui po-pup automático * @desc Direcione a redução do parâmetro @desc para um popup automático.(ON/OFF) * @default true * @type boolean * * @param som de dano MP * @desc Efeito sonoro p/ dano de MP(áudio/se). Se nada for especificado, será o mesmo que HP. * @default * * @param rotação * @desc Habilita o movimento rotacional dos números. * @default true * @type boolean * * @param X raio direcional * @desc raio na direção X ao girar o número. * @default 40 * * @param Y Raio de direção * @desc O raio na direção Y ao girar o número. * @default 40 * * @param Velocidade de rotação * @desc A velocidade com que os números são girados. * @default 60 * * @param Escala * @desc Esta é a taxa de ampliação inicial. * @default 100 * * @param Valor de alteração da taxa de Escala * @desc O valor de alteração da taxa de ampliação para cada quadro. * @default -10 * * @param Exibição em primeiro plano * @desc Traz o pop-up para a frente da imagem. * @default false * @type boolean * * @help Fornece a capacidade de exibir números de eventos e jogadores na tela do mapa. * Pode ser usado para produzir dano e recuperação no mapa. A produção é a mesma da batalha. * Se o valor especificado for definido como menos, ele será tratado como recuperação e a cor mudará. * Além disso, se você o tornar crítico, a cor dos números ficará vermelha por um momento. * * Além disso, uma função que exibe automaticamente a quantidade de mudança quando um evento como * "aumento/diminuição de HP" é executado, * Há também uma função que aparece automaticamente ao passar por um piso danificado. * Dependendo do parâmetro, você pode especificar condições como somente HP ou somente aumentar. * * Detalhes do comando do plug-in * Executado a partir do comando de evento "comando plug-in". * (Separe os parâmetros com um espaço de meia largura) * * ・CPD_DAMAGE or Dano pop-up [ID do personagem] [Valor do dano] [Reverso] * ID do Personagem: Especifique um personagem para causar dano. * キャラクターの指定は以下の通りです。 * -1: Jogador * 0 : Evento em execução * 1..: Evento com ID especificado * * Quando a inversão estiver habilitada, o pop-up irá girar na direção oposta. * (Quando o parâmetro "Rotação" está habilitado) * * CPD_DAMAGE 5 -300 ON * Dano pop-up 0 \v[1] OFF * * ・CPD_CRITICAL ou pop-up crítico * Especifique um personagem e mostre o dano como crítico. * * CPD_CRITICAL -1 100 ON * Pop-up crítico 3 \v[1] OFF * * ・CPD_MP_DAMAGE or MP dano pop-up * Especifique um personagem para causar dano de MP. * * CPD_MP_DAMAGE 5 -300 ON * MP dano pop-up 0 \v[1] OFF * * ・CPD_MP_CRITICAL or MP pop-up crítico * Especifique um personagem e dê dano de MP como crítico. * * CPD_MP_CRITICAL -1 100 ON * MP pop-up crítico 3 \v[1] OFF * * ・CPD_MISS or miss pop-up * Especifique um personagem e pop-up miss. * * CPD_MISS -1 ON * miss pop-up 3 OFF * * ・CPD_INVALID or invalidação de pop-up * Desative pop-ups automáticos. * Quando habilitado, o evento comanda "aumentar/diminuir HP", "aumentar/diminuir MP" e "aumentar/diminuir TP" * E os danos causados pelo piso aparecerão automaticamente. * Válido no estado inicial. * * ・CPD_VALID or pop-up ativado * Reative pop-ups automáticos. * * ・CPD_SETTING_TONE or pop-up setting_color tone[vermelho] [verde] [azul] [cinza] * Você pode alterar o tom da cor da imagem pop-up. Especifique as configurações de tom de cor em ordem. * * CPD_SETTING_TONE 255 0 0 255 * Pop-up setting_color tone -255 -255 -255 0 * * ・CPD_SETTING_FLASH or pop-up setting_flash [vermelho] [verde] [azul] [força] * Pisque o personagem ao aparecer. * Flash somente se estiver danificado. * * CPD_SETTING_FLASH 255 0 0 255 * pop-up setting_flash 255 0 0 255 * * termos de serviço: * Pode ser modificado e redistribuído sem a permissão do autor, e forma de uso (comercial, 18 uso proibido, etc.) * Não há restrições para. * Este plugin já é seu. */ (function() { 'use strict'; var pluginName = 'CharacterPopupDamage'; var settings = { /* som de dano MP(ファイル名はパラメータで指定) */ mpDamageSe: { volume: 90, pitch : 100, pan : 0 } }; var getCommandName = function(command) { return (command || '').toUpperCase(); }; var getParamBoolean = function(paramNames) { var value = getParamOther(paramNames); return (value || '').toUpperCase() === 'ON' || (value || '').toUpperCase() === 'TRUE'; }; var getParamNumber = function(paramNames, min, max) { var value = getParamOther(paramNames); if (arguments.length < 2) min = -Infinity; if (arguments.length < 3) max = Infinity; return (parseInt(value, 10) || 0).clamp(min, max); }; var getParamString = function(paramNames) { var value = getParamOther(paramNames); return value === null ? '' : value; }; var getParamOther = function(paramNames) { if (!Array.isArray(paramNames)) paramNames = [paramNames]; for (var i = 0; i < paramNames.length; i++) { var name = PluginManager.parameters(pluginName)[paramNames[i]]; if (name) return name; } return null; }; var getArgNumber = function(arg, min, max) { if (arguments.length < 2) min = -Infinity; if (arguments.length < 3) max = Infinity; return (parseInt(convertEscapeCharactersAndEval(arg, true), 10) || 0).clamp(min, max); }; var getArgBoolean = function(arg) { return (arg || '').toUpperCase() === 'ON'; }; var convertEscapeCharactersAndEval = function(text, evalFlg) { if (text === null || text === undefined) text = ''; var window = SceneManager._scene._windowLayer.children[0]; if (window) { var result = window.convertEscapeCharacters(text); return evalFlg ? eval(result) : result; } else { return text; } }; //============================================================================= // パラメータの取得と整形 //============================================================================= var paramPlaySe = getParamBoolean(['PlaySe', 'Desempenho de efeitos sonoros']); var paramSuppressSwitchId = getParamNumber(['SuppressSwitchId', 'Desliga o ID do switch'], 0); var paramOffsetX = getParamNumber(['OffsetX', 'correção da coordenada X']); var paramOffsetY = getParamNumber(['OffsetY', 'correção de coordenada Y']); var paramTpAutoPop = getParamBoolean(['TPAutoPop', 'TP pop-up automático']); var paramMpAutoPop = getParamBoolean(['MPAutoPop', 'MP pop-up automático']); var paramHpAutoPop = getParamBoolean(['HPAutoPop', 'HP pop-up automático']); var paramIncreaseAutoPop = getParamBoolean(['IncreaseAutoPop', 'Aumenta o pop-up automático']); var paramDecreaseAutoPop = getParamBoolean(['DecreaseAutoPop', 'Diminui po-pup automático']); var paramMpDamageSe = getParamString(['MPDamageSe', 'som de dano MP']); var paramRotation = getParamBoolean(['Rotation', 'rotação']); var paramRadiusX = getParamNumber(['RadiusX', 'X raio direcional']); var paramRadiusY = getParamNumber(['RadiusY', 'Y Raio de direção']); var paramRotateSpeed = getParamNumber(['RotateSpeed', 'Velocidade de rotação']); var paramScale = getParamNumber(['Scale', 'Escala']); var paramScaleDelta = getParamNumber(['ScaleDelta', 'Valor de alteração da taxa de Escala']); var paramOnTop = getParamBoolean(['OnTop', 'Exibição em primeiro plano']); //============================================================================= // Game_Interpreter // プラグインコマンドを追加定義します。 //============================================================================= var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function(command, args) { _Game_Interpreter_pluginCommand.apply(this, arguments); this.pluginCommandCharacterPopupDamage(command, args); }; Game_Interpreter.prototype.pluginCommandCharacterPopupDamage = function(command, args) { var popupArgs = []; switch (getCommandName(command)) { case 'CPD_DAMAGE' : case 'ポップアップダメージ': popupArgs = [getArgNumber(args[1]), false, getArgBoolean(args[2])]; this.callCharacterPopup(args, 'popupDamage', popupArgs); break; case 'CPD_CRITICAL' : case 'ポップアップクリティカル': popupArgs = [getArgNumber(args[1]), true, getArgBoolean(args[2])]; this.callCharacterPopup(args, 'popupDamage', popupArgs); break; case 'CPD_MP_DAMAGE' : case 'ポップアップMPダメージ': popupArgs = [getArgNumber(args[1]), false, getArgBoolean(args[2])]; this.callCharacterPopup(args, 'popupMpDamage', popupArgs); break; case 'CPD_MP_CRITICAL' : case 'ポップアップMPクリティカル': popupArgs = [getArgNumber(args[1]), true, getArgBoolean(args[2])]; this.callCharacterPopup(args, 'popupMpDamage', popupArgs); break; case 'CPD_MISS' : case 'ポップアップミス': popupArgs = [getArgBoolean(args[1])]; this.callCharacterPopup(args, 'popupMiss', popupArgs); break; case 'CPD_VALID' : case 'ポップアップ有効化': $gameSystem.setSuppressAutoPopup(false); break; case 'CPD_INVALID' : case 'ポップアップ無効化': $gameSystem.setSuppressAutoPopup(true); break; case 'CPD_SETTING_TONE' : case 'ポップアップ設定_色調': var red = getArgNumber(args[0]); var green = getArgNumber(args[1]); var blue = getArgNumber(args[2]); var gray = getArgNumber(args[3]); $gameSystem.setPopupDamageTone([red, green, blue, gray]); break; case 'CPD_SETTING_FLASH' : case 'ポップアップ設定_フラッシュ': var flashRed = getArgNumber(args[0], 0); var flashGreen = getArgNumber(args[1], 0); var flashBlue = getArgNumber(args[2], 0); var alpha = getArgNumber(args[3], 0) || 255; $gameSystem.setPopupDamageFlash([flashRed, flashGreen, flashBlue, alpha]); break; } }; var _Game_Interpreter_command311 = Game_Interpreter.prototype.command311; Game_Interpreter.prototype.command311 = function() { var value = -this.operateValue(this._params[2], this._params[3], this._params[4]); this.iterateActorEx(this._params[0], this._params[1], function(actor) { actor.popupDamage(value); }.bind(this)); return _Game_Interpreter_command311.apply(this, arguments); }; var _Game_Interpreter_command312 = Game_Interpreter.prototype.command312; Game_Interpreter.prototype.command312 = function() { var value = -this.operateValue(this._params[2], this._params[3], this._params[4]); this.iterateActorEx(this._params[0], this._params[1], function(actor) { actor.popupMpDamage(value); }.bind(this)); return _Game_Interpreter_command312.apply(this, arguments); }; var _Game_Interpreter_command326 = Game_Interpreter.prototype.command326; Game_Interpreter.prototype.command326 = function() { var value = -this.operateValue(this._params[2], this._params[3], this._params[4]); this.iterateActorEx(this._params[0], this._params[1], function(actor) { actor.popupTpDamage(value); }.bind(this)); return _Game_Interpreter_command326.apply(this, arguments); }; Game_Interpreter.prototype.callCharacterPopup = function(args, methodName, extend) { var character = this.character(getArgNumber(args[0], -1)); if (character) character[methodName].apply(character, extend); }; //============================================================================= // Game_Actor // ダメージ床によるポップアップを処理します。 //============================================================================= var _Game_Actor_executeFloorDamage = Game_Actor.prototype.executeFloorDamage; Game_Actor.prototype.executeFloorDamage = function() { this.popupMapDamage(_Game_Actor_executeFloorDamage); }; var _Game_Actor_turnEndOnMap = Game_Actor.prototype.turnEndOnMap; Game_Actor.prototype.turnEndOnMap = function() { this.popupMapDamage(_Game_Actor_turnEndOnMap); }; Game_Actor.prototype.popupMapDamage = function(callBackFunc) { var prevHp = this.hp; var prevMp = this.mp; var prevTp = this.tp; callBackFunc.apply(this); var character = this.getCharacterObject(); if (!character) return; var hpDamage = prevHp - this.hp; if (hpDamage !== 0 && $gameSystem.isNeedAutoHpPopup(hpDamage)) character.popupDamage(hpDamage, false); var mpDamage = prevMp - this.mp; if (mpDamage !== 0 && $gameSystem.isNeedAutoMpPopup(mpDamage)) character.popupMpDamage(mpDamage, false); var tpDamage = prevTp - this.tp; if (tpDamage !== 0 && $gameSystem.isNeedAutoTpPopup(tpDamage)) character.popupDamage(tpDamage, false); }; Game_Actor.prototype.popupDamage = function(value) { var character = this.getCharacterObject(); if (!character) return; if (value !== 0 && $gameSystem.isNeedAutoHpPopup(value)) { character.popupDamage(value, false); } }; Game_Actor.prototype.popupMpDamage = function(value) { var character = this.getCharacterObject(); if (!character) return; if (value !== 0 && $gameSystem.isNeedAutoMpPopup(value)) { character.popupMpDamage(value, false); } }; Game_Actor.prototype.popupTpDamage = function(value) { var character = this.getCharacterObject(); if (!character) return; if (value !== 0 && $gameSystem.isNeedAutoTpPopup(value)) { character.popupDamage(value, false); } }; Game_Actor.prototype.getCharacterObject = function() { var index = $gameParty.battleMembers().indexOf(this); var result; switch (index) { case -1: result = null; break; case 0: result = $gamePlayer; break; default: var followers = $gamePlayer.followers(); result = followers.isVisible() ? followers.follower(index - 1) : null; } return result; }; //============================================================================= // Game_System // オートポップアップの有効フラグを追加定義します。 //============================================================================= var _Game_System_initialize = Game_System.prototype.initialize; Game_System.prototype.initialize = function() { _Game_System_initialize.apply(this, arguments); this._suppressAutoPopup = false; this._popupDamageTone = null; this._popupDamageFlash = null; }; Game_System.prototype.setSuppressAutoPopup = function(value) { this._suppressAutoPopup = !!value; }; Game_System.prototype.isSuppressAutoPopup = function() { return this._suppressAutoPopup; }; Game_System.prototype.isNeedAutoHpPopup = function(value) { return paramHpAutoPop && this.isNeedAutoPopup(value); }; Game_System.prototype.isNeedAutoMpPopup = function(value) { return paramMpAutoPop && this.isNeedAutoPopup(value); }; Game_System.prototype.isNeedAutoTpPopup = function(value) { return paramTpAutoPop && this.isNeedAutoPopup(value); }; Game_System.prototype.isNeedAutoPopup = function(value) { return !$gameSystem.isSuppressAutoPopup() && ((paramIncreaseAutoPop && value < 0) || (paramDecreaseAutoPop && value > 0)); }; Game_System.prototype.getPopupDamageTone = function() { return this._popupDamageTone; }; Game_System.prototype.setPopupDamageTone = function(value) { this._popupDamageTone = value; }; Game_System.prototype.getPopupDamageFlash = function() { return this._popupDamageFlash; }; Game_System.prototype.setPopupDamageFlash = function(value) { this._popupDamageFlash = value; }; //============================================================================= // Game_CharacterBase // ダメージ情報を保持します。 //============================================================================= Game_CharacterBase.prototype.popupDamage = function(value, critical, mirror) { this.startDamagePopup(value, critical, false, mirror); }; Game_CharacterBase.prototype.popupMpDamage = function(value, critical, mirror) { this.startDamagePopup(value, critical, true, mirror); }; Game_CharacterBase.prototype.popupMiss = function(mirror) { this.startDamagePopup(null, false, mirror); }; Game_CharacterBase.prototype.isDamagePopupRequested = function() { return this._damagePopup; }; Game_CharacterBase.prototype.clearDamagePopup = function() { if (!this._damageInfo || this._damageInfo.length === 0) { this._damagePopup = false; } }; Game_CharacterBase.prototype.startDamagePopup = function(value, critical, mpFlg, mirror) { this._damagePopup = true; if (!this._damageInfo) this._damageInfo = []; var damageInfo = {value: value, critical: critical, mpFlg: mpFlg, mirror: mirror}; if (this.isPlayPopupSe()) { this.playPopupSe(damageInfo); } this._damageInfo.push(damageInfo); }; Game_CharacterBase.prototype.playPopupSe = function(damageInfo) { if (damageInfo.value === null) { SoundManager.playMiss(); } else if (damageInfo.value < 0) { SoundManager.playRecovery(); } else if (damageInfo.mpFlg && paramMpDamageSe) { settings.mpDamageSe.name = paramMpDamageSe; AudioManager.playStaticSe(settings.mpDamageSe); } else if (this === $gamePlayer) { SoundManager.playActorDamage(); } else { SoundManager.playEnemyDamage(); } }; Game_CharacterBase.prototype.shiftDamageInfo = function() { return this._damageInfo ? this._damageInfo.shift() : null; }; Game_CharacterBase.prototype.isPlayPopupSe = function() { return paramPlaySe && !$gameSwitches.value(paramSuppressSwitchId) }; //============================================================================= // Sprite_Character // ダメージをポップアップします。 //============================================================================= var _Sprite_Character_update = Sprite_Character.prototype.update; Sprite_Character.prototype.update = function() { _Sprite_Character_update.apply(this, arguments); this.updateDamagePopup(); }; Sprite_Character.prototype.updateDamagePopup = function() { this.setupDamagePopup(); if (this._damages && this._damages.length > 0) { for (var i = 0; i < this._damages.length; i++) { this._damages[i].update(); } if (!this._damages[0].isPlaying()) { this.getPopupParent().removeChild(this._damages[0]); this._damages.shift(); } } if (this._popupFlash) { this.updateDamagePopupFlash(); } }; Sprite_Character.prototype.updateDamagePopupFlash = function() { this.setBlendColor(this._popupFlash); this._popupFlash[3] -= this._popupFlashSpeed; if (this._popupFlash[3] <= 0) { this._popupFlash = null; this._popupFlashSpeed = 0; } }; Sprite_Character.prototype.setupDamagePopup = function() { if (!this._character.isDamagePopupRequested()) return; var sprite = new Sprite_CharacterDamage(); sprite.x = this.x + this.damageOffsetX(); sprite.y = this.y + this.damageOffsetY(); if (!sprite.z) sprite.z = 9; sprite.setupCharacter(this._character); if (!this._damages) this._damages = []; this._damages.push(sprite); this.getPopupParent().addChild(sprite); this._character.clearDamagePopup(); if (!sprite.isMiss() && !sprite.isRecover()) { this.setupDamagePopupFlash(); } }; Sprite_Character.prototype.setupDamagePopupFlash = function() { var flashColor = $gameSystem.getPopupDamageFlash(); if (!flashColor) return; this._popupFlash = flashColor.clone(); this._popupFlashSpeed = Math.floor(this._popupFlash[3] / 30); this.updateDamagePopupFlash(); }; Sprite_Character.prototype.damageOffsetX = function() { return paramOffsetX; }; Sprite_Character.prototype.damageOffsetY = function() { return paramOffsetY; }; Sprite_Character.prototype.getPopupParent = function() { return paramOnTop ? this.parent.parent.parent : this.parent; }; //============================================================================= // Sprite_CharacterDamage // ダメージ情報を受け取ってセットアップします。 //============================================================================= function Sprite_CharacterDamage() { this.initialize.apply(this, arguments); } Sprite_CharacterDamage.prototype = Object.create(Sprite_Damage.prototype); Sprite_CharacterDamage.prototype.constructor = Sprite_CharacterDamage; Sprite_CharacterDamage.prototype.setupCharacter = function(character) { var damageInfo = character.shiftDamageInfo(); this._toneColor = $gameSystem.getPopupDamageTone(); this._mirror = damageInfo.mirror; this._damageInfo = damageInfo; this._digit = 0; if (this.isMiss()) { this.createMissForCharacter(); } else { this.createDigits(damageInfo.mpFlg ? 2 : 0, damageInfo.value); } if (damageInfo.critical) { this.setupCriticalEffect(); } }; Sprite_CharacterDamage.prototype.isMiss = function() { return this._damageInfo.value === null; }; Sprite_CharacterDamage.prototype.isRecover = function() { return this._damageInfo.value < 0; }; Sprite_CharacterDamage.prototype.createMissForCharacter = function() { var w = this.digitWidth(); var h = this.digitHeight(); var sprite = this.createChildSprite(); sprite.setFrame(0, 4 * h, 4 * w, h); sprite.dy = 0; sprite.x = w / 2; sprite.digit++; this._digit++; }; Sprite_CharacterDamage.prototype.createChildSprite = function() { var sprite = Sprite_Damage.prototype.createChildSprite.apply(this, arguments); sprite.frame = 0; sprite.digit = this._digit++; if (this._toneColor) sprite.setColorTone(this._toneColor); return sprite; }; Sprite_CharacterDamage.prototype.updateChild = function(sprite) { if (paramRotation) { this.updateChildRotation(sprite); sprite.setBlendColor(this._flashColor); } else { Sprite_Damage.prototype.updateChild.apply(this, arguments); sprite.x = 0; } if (paramScale) { this.updateChildScale(sprite); } sprite.frame++; }; Sprite_CharacterDamage.prototype.updateChildRotation = function(sprite) { var frame = sprite.frame; var speed = frame / 3600 * paramRotateSpeed; sprite.rx = paramRadiusX * (Math.cos(speed) - 1); sprite.ry = -paramRadiusY * Math.sin(speed); if (this._mirror) { sprite.rx *= -1; } sprite.x = Math.round(sprite.rx); sprite.y = Math.round(sprite.ry); }; Sprite_CharacterDamage.prototype.updateChildScale = function(sprite) { var frame = sprite.frame; var scale = (paramScale + frame * paramScaleDelta / 10) / 100; sprite.scale.x = scale; sprite.scale.y = scale; sprite.x += (sprite.digit - (this._digit - 1) / 2) * (this.digitWidth() * scale); }; })();


[ICODE][/ICODE]

Original thread: https://forums.rpgmakerweb.com/threads/damage-pop-up-in-map-mog-vs-triacontane-help.146147/