moon-red-goddess-cornelia/js/plugins/HitCounterActor1.js
2025-10-06 13:25:53 -05:00

67 lines
No EOL
2.2 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//=============================================================================
// RPG Maker MZ - HitCounterActor1.js
//=============================================================================
/*:
* @target MZ
* @Counting atack hits by Acotr1
* @author UM
*
* @help I don't well English sory
*
* This plugin has no plugin command
*
*/
/*:ja
* @target MZ
* @plugindesc アクター1の攻撃回数をカウントする
* @author 温州みかん
*
* @help
* このプラグインにプラグインコマンドはありません
*
* ゲーム内スイッチ248がオンの時ヒット回数を数えます
* ヒット回数はゲーム内変数248に反映されます
*/
(() => {
'use strict';
const pluginName = "HitCounterActor1";
const _Game_Action_apply = Game_Action.prototype.apply;
Game_Action.prototype.apply = function(target){
_Game_Action_apply.apply(this, arguments);
const subject = this.subject();
const result = target.result();
if(subject.isActor() && target.isEnemy()){
if(subject.actorId() === 1){
if($gameSwitches.value(248)){
$gameVariables.setValue(248,$gameVariables.value(248)+1)
}
else if ($gameSwitches.value(261)) {
if (target === $gameTroop.members()[1]) {
$gameVariables.setValue(248, $gameVariables.value(248) + 1)
}
}
}
else if (subject.actorId() === 2) {
if ($gameSwitches.value(248)) {
$gameVariables.setValue(248, $gameVariables.value(248) + 1)
}
else if ($gameSwitches.value(261)) {
if (target === $gameTroop.members()[1]) {
$gameVariables.setValue(248, $gameVariables.value(248) + 1)
}
}
}
} else if (subject.isEnemy() && target.isActor()) {
if ($gameSwitches.value(250)) {
$gameVariables.setValue(250, $gameVariables.value(250) + 1)
}
}
};
})();