ゾンビの状態異常のプラグイン

返信する
しょうま
記事: 2
登録日時: 2016年4月10日(日) 02:06

ゾンビの状態異常のプラグイン

投稿記事 by しょうま »

回復アイテムのスキルやアイテムでダメージを受けてしまう
ゾンビの状態異常を実現するプラグインを手に入れたのですが、ステートの欄にゾンビの状態異常を
追加する方法が分かりません そのままプラグインを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;
}
};

})();
返信する

“MV:質問”に戻る