回復アイテムのスキルやアイテムでダメージを受けてしまう
ゾンビの状態異常を実現するプラグインを手に入れたのですが、ステートの欄にゾンビの状態異常を
追加する方法が分かりません そのままプラグインをONにしてしまうと、何もない状態でゾンビにかかっている
ことになってしまいます。下記に詳細を載せますのでわかる方がいましたら教えてほしいです。
プラグインは2つあります
//=============================================================================
// zombie.js
// Version: 0.01
//=============================================================================
/*:
* @plugindesc It damaged the recovery
* @author karakasr_dool
*
* @help
* Notes column of actor or enemy
* <zombie>
*/
/*:ja
* @plugindesc 回復でダメージを受ける
* @author 唐傘ドール
* @help
* アクターまたはエネミーのメモ欄
* <zombie>
*/
(function() {
// メタデータ
Game_Battler.prototype.meta = function() {
return [];
};
Game_Enemy.prototype.meta = function() {
return this.enemy().meta;
};
Game_Actor.prototype.meta = function() {
return this.actor().meta;
};
// HP回復
Game_Action.prototype.itemEffectRecoverHp = function(target, effect) {
var value = (target.mhp * effect.value1 - effect.value2) * target.rec;
if (this.isItem()) {
value *= this.subject().pha;
}
value = Math.floor(value);
// ゾンビなら反転させる
if(target.meta().zombie){ value = +value; }
//
if (value !== 0) {
target.gainHp(value);
this.makeSuccess(target);
}
};
// MP回復
Game_Action.prototype.itemEffectRecoverMp = function(target, effect) {
var value = (target.mmp * effect.value1 + effect.value2) * target.rec;
if (this.isItem()) {
value *= this.subject().pha;
}
value = Math.floor(value);
// ゾンビなら反転させる
if(target.meta().zombie){ value = -value; }
//
if (value !== 0) {
target.gainMp(value);
this.makeSuccess(target);
}
};
// ダメージ
Game_Action.prototype.evalDamageFormula = function(target) {
try {
var item = this.item();
var a = this.subject();
var b = target;
var v = $gameVariables._data;
// タイプがHP回復又はMP回復の時に、ゾンビ状態以外を追加
var sign = ([3, 4].contains(item.damage.type) && !target.meta().zombie ? -1 : 1);
return Math.max(eval(item.damage.formula), 0) * sign;
} catch (e) {
return 0;
}
};
})();
下が二つ目です
//=============================================================================
// zombie.js
// Version: 0.02
//=============================================================================
/*:
* @plugindesc It damaged the recovery
* @author karakasr_dool
*
* @param ZombieID
* @desc ID to be handled as a zombie state
* @default 0
*
* @help
* Notes column of actor or enemy
* <zombie>
*/
/*:ja
* @plugindesc 回復でダメージを受ける
* @author 唐傘ドール
* @param ZombieID
* @desc ゾンビステートとして扱うID
* @default 0
*
* @help
* アクターまたはエネミーのメモ欄
* <zombie>
*/
(function() {
var parameters = PluginManager.parameters('zombie');
var zombieId = parseInt(parameters['ZombieID']) || 0;
// メタデータ
Game_Battler.prototype.meta = function(){
return [];
};
Game_Enemy.prototype.meta = function(){
return this.enemy().meta;
};
Game_Actor.prototype.meta = function(){
return this.actor().meta;
};
Game_Battler.prototype.zombie = function(){
if(this._states.indexOf(zombieId) >= 0){
return true;
}
return meta().zombie;
};
// HP回復
Game_Action.prototype.itemEffectRecoverHp = function(target, effect) {
var value = (target.mhp * effect.value1 - effect.value2) * target.rec;
if (this.isItem()) {
value *= this.subject().pha;
}
value = Math.floor(value);
// ゾンビなら反転させる
if(target.zombie()){ value = -value; }
//
if (value !== 0) {
target.gainHp(value);
this.makeSuccess(target);
}
};
// MP回復
Game_Action.prototype.itemEffectRecoverMp = function(target, effect) {
var value = (target.mmp * effect.value1 + effect.value2) * target.rec;
if (this.isItem()) {
value *= this.subject().pha;
}
value = Math.floor(value);
// ゾンビなら反転させる
if(target.zombie()){ value = -value; }
//
if (value !== 0) {
target.gainMp(value);
this.makeSuccess(target);
}
};
// ダメージ
Game_Action.prototype.evalDamageFormula = function(target) {
try {
var item = this.item();
var a = this.subject();
var b = target;
var v = $gameVariables._data;
// タイプがHP回復又はMP回復の時に、ゾンビ状態以外を追加
var sign = ([3, 4].contains(item.damage.type) && !target.zombie() ? -1 : 1);
return Math.max(eval(item.damage.formula), 0) * sign;
} catch (e) {
return 0;
}
};
})();
ゾンビの状態異常のプラグイン
ページ移動
- クイックリンク
- ↳ 新着
- ↳ 運営からのお知らせ
- ↳ MZ:プラグイン素材
- ↳ MV:プラグイン素材
- ↳ 【重要】攻撃的な発言への対処につきまして
- RPGツクールMZ
- ↳ MZ:素材の投稿・ダウンロード
- ↳ MZ:プラグイン素材
- ↳ MZ:アニメーション素材
- ↳ MZ:バトル背景素材
- ↳ MZ:キャラチップ素材
- ↳ MZ:エネミー素材
- ↳ MZ:顔グラ素材
- ↳ MZ:遠景素材
- ↳ MZ:ピクチャ素材
- ↳ MZ:サイドビューキャラチップ素材
- ↳ MZ:サイドビューエネミー素材
- ↳ MZ:システム画像素材
- ↳ MZ:タイルセット素材
- ↳ MZ:キャラクター生成素材
- ↳ MZ:質問
- ↳ MZ:素材のリクエスト
- ↳ MZ:画像素材のリクエスト
- ↳ MZ:プラグイン素材のリクエスト
- ↳ MZ:小ネタ・TIPS・講座
- RPGツクールMV
- ↳ MV:素材の投稿・ダウンロード
- ↳ MV:アニメーション素材
- ↳ MV:バトル背景素材
- ↳ MV:キャラチップ素材
- ↳ MV:エネミー素材
- ↳ MV:顔グラ素材
- ↳ MV:遠景素材
- ↳ MV:ピクチャ素材
- ↳ MV:サイドビューキャラチップ素材
- ↳ MV:サイドビューエネミー素材
- ↳ MV:システム画像素材
- ↳ MV:タイルセット素材
- ↳ MV:キャラクター生成素材
- ↳ MV:プラグイン素材
- ↳ MV:質問
- ↳ MV:素材のリクエスト
- ↳ MV:画像素材のリクエスト
- ↳ MV:プラグイン素材のリクエスト
- ↳ MV:小ネタ・TIPS・講座
- RPGツクールVX / VXAce / XP / 2000
- ↳ VX / Ace:素材の投稿・ダウンロード
- ↳ VX / Ace:アニメーション素材
- ↳ VX / Ace:バトル背景素材
- ↳ VX / Ace:キャラチップ素材
- ↳ VX / Ace:エネミー素材
- ↳ VX / Ace:顔グラ素材
- ↳ VX / Ace:遠景素材
- ↳ VX / Ace:ピクチャ素材
- ↳ VX / Ace:システム画像素材
- ↳ VX / Ace:タイルセット素材
- ↳ Ace:キャラクター生成素材
- ↳ VX:スクリプト素材(RGSS2)
- ↳ Ace:スクリプト素材(RGSS3)
- ↳ VX / Ace:質問
- ↳ VX / Ace:素材のリクエスト
- ↳ VX / Ace:画像素材のリクエスト
- ↳ VX / Ace:スクリプト素材のリクエスト
- ↳ XP / 2000:素材の投稿・ダウンロード
- ↳ XP:画像素材
- ↳ XP:スクリプト素材(RGSS)
- ↳ 2000:素材
- ツクール広場
- ↳ 自己紹介・あいさつ
- ↳ 雑談
- ↳ 作品紹介
- 音楽・人員募集
- ↳ 音声素材
- ↳ BGM素材
- ↳ SE素材
- ↳ ME素材
- ↳ 制作補助ツール
- ↳ 人員募集
- 素材リンク集
- ↳ MV:画像の素材サイト
- ↳ MV:プラグインの素材サイト
- ↳ BGM・SE・MEの素材サイト
- その他
- ↳ 利用規約
- ↳ 素材規約テンプレート
- ↳ お問い合わせ
- ↳ RSS