Hello there! What I want to do is to "isolate" the "Invocation" rating on spell. I want to get a "Fizzle" Battle message when Invocation ($dataSkills[id].successRate) don't connect on Spell.
From rpg_objects.js we got this:
Game_Action.prototype.itemHit = function(target) {
if (this.isPhysical()) {
return this.item().successRate * 0.01 * this.subject().hit;
} else {
return this.item().successRate * 0.01;
}
};
Game_Action.prototype.apply = function(target) {
var result = target.result();
this.subject().clearResult();
result.clear();
result.used = this.testApply(target);
result.missed = (result.used && Math.random() >= this.itemHit(target));
result.evaded = (!result.missed && Math.random() < this.itemEva(target));
result.physical = this.isPhysical();
result.drain = this.isDrain();
if (result.isHit()) {
if (this.item().damage.type > 0) {
result.critical = (Math.random() < this.itemCri(target));
var value = this.makeDamageValue(target, result.critical);
this.executeDamage(target, value);
}
this.item().effects.forEach(function(effect) {
this.applyItemEffect(target, effect);
}, this);
this.applyItemUserEffect(target);
}
};
So, what I understand is, if it's not Physical, there's no +HIT added. (In other words, for skill without Physical, Invocation ($dataSkills[id].successRate) IS the Hit rate!
From there...
Window_BattleLog.prototype.displayDamage = function(target) {
if (target.result().missed) {
this.displayMiss(target);
} else if (target.result().evaded) {
this.displayEvasion(target);
} else {
this.displayHpDamage(target);
this.displayMpDamage(target);
this.displayTpDamage(target);
}
};
Window_BattleLog.prototype.displayMiss = function(target) {
var fmt;
if (target.result().physical) {
fmt = target.isActor() ? TextManager.actorNoHit : TextManager.enemyNoHit;
this.push('performMiss', target);
} else {
fmt = TextManager.actionFailure;
}
this.push('addText', fmt.format(target.name()));
};
This look like that for the battle log. In database:
actorNoHit = Miss! %1 took no damage!
enemyNoHit = Miss! %1 took no damage!
actionFailure = There was no effect on %1!
I guess I need to change something here to add : Your spell fizzles!
like if (target.result().magical)... fmt = TextManager.something
But... my test are not really working if i'm trying to change it..
Can't rename "actionFailure" tag and use it, because it's only for missed effect... im looking at missed skill.
Anyone got a idea?
From rpg_objects.js we got this:
Game_Action.prototype.itemHit = function(target) {
if (this.isPhysical()) {
return this.item().successRate * 0.01 * this.subject().hit;
} else {
return this.item().successRate * 0.01;
}
};
Game_Action.prototype.apply = function(target) {
var result = target.result();
this.subject().clearResult();
result.clear();
result.used = this.testApply(target);
result.missed = (result.used && Math.random() >= this.itemHit(target));
result.evaded = (!result.missed && Math.random() < this.itemEva(target));
result.physical = this.isPhysical();
result.drain = this.isDrain();
if (result.isHit()) {
if (this.item().damage.type > 0) {
result.critical = (Math.random() < this.itemCri(target));
var value = this.makeDamageValue(target, result.critical);
this.executeDamage(target, value);
}
this.item().effects.forEach(function(effect) {
this.applyItemEffect(target, effect);
}, this);
this.applyItemUserEffect(target);
}
};
So, what I understand is, if it's not Physical, there's no +HIT added. (In other words, for skill without Physical, Invocation ($dataSkills[id].successRate) IS the Hit rate!
From there...
Window_BattleLog.prototype.displayDamage = function(target) {
if (target.result().missed) {
this.displayMiss(target);
} else if (target.result().evaded) {
this.displayEvasion(target);
} else {
this.displayHpDamage(target);
this.displayMpDamage(target);
this.displayTpDamage(target);
}
};
Window_BattleLog.prototype.displayMiss = function(target) {
var fmt;
if (target.result().physical) {
fmt = target.isActor() ? TextManager.actorNoHit : TextManager.enemyNoHit;
this.push('performMiss', target);
} else {
fmt = TextManager.actionFailure;
}
this.push('addText', fmt.format(target.name()));
};
This look like that for the battle log. In database:
actorNoHit = Miss! %1 took no damage!
enemyNoHit = Miss! %1 took no damage!
actionFailure = There was no effect on %1!
I guess I need to change something here to add : Your spell fizzles!
like if (target.result().magical)... fmt = TextManager.something
But... my test are not really working if i'm trying to change it..
Can't rename "actionFailure" tag and use it, because it's only for missed effect... im looking at missed skill.
Anyone got a idea?