- Joined
- Apr 4, 2017
- Messages
- 9
- Reaction score
- 0
- First Language
- English
- Primarily Uses
- RMMV
So, I've been trying to set up my damage formula similar to that of Final Fantasy 6 using Yanfly's Damage Core and keep getting tons of errors whenever an attack is used:
This is what I currently have the damage formula set up as:
I thought the issue was being caused by battler.rows() but after removing that section, I'm still getting errors.
Any help is appreciated
Code:
SyntaxError: Illegal return statement {stack: "SyntaxError: Illegal return statement↵ at Game_…ject1/js/plugins/YEP_BattleEngineCore.js:1870:10)", message: "Illegal return statement"}message: "Illegal return statement"stack: (...)get stack: function () { [native code] }set stack: function () { [native code] }__proto__:
ErrorYEP_RowFormation.js:2438 Yanfly.Util.displayError
YEP_DamageCore.js:1231 Game_Action.makeDamageValue
YEP_X_SelectionControl.js:1051 Game_Action.makeDamageValue
rpg_objects.js:1656 Game_Action.apply
YEP_BattleEngineCore.js:3273 Game_Action.apply
YEP_BattleAICore.js:780 Game_Action.apply
YEP_BuffsStatesCore.js:1676 Game_Action.apply
YEP_SkillCore.js:1041 Game_Action.apply
YEP_RowFormation.js:1405 Game_Action.apply
rpg_managers.js:2181 BattleManager.invokeNormalAction
YEP_BattleEngineCore.js:1870 BattleManager.invokeAction
YEP_BattleEngineCore.js:2482 (anonymous function)
YEP_BattleEngineCore.js:2479 BattleManager.actionActionEffect
YEP_BattleEngineCore.js:2075 BattleManager.processActionSequence
YEP_X_ActSeqPack1.js:870 BattleManager.processActionSequence
YEP_X_ActSeqPack2.js:575 BattleManager.processActionSequence
YEP_X_ActSeqPack3.js:393 BattleManager.processActionSequence
YED_SideviewBattler.js:498 BattleManager.processActionSequence
YEP_X_BattleSysATB.js:1305 BattleManager.processActionSequence
YEP_X_CounterControl.js:1394 BattleManager.processActionSequence
YEP_DamageCore.js:890 BattleManager.processActionSequence
YEP_ElementCore.js:424 BattleManager.processActionSequence
YEP_BattleEngineCore.js:2057 BattleManager.processActionSequenceCheck
YEP_BattleEngineCore.js:2013 BattleManager.updateActionTargetList
YEP_BattleEngineCore.js:1688 BattleManager.update
YEP_X_BattleSysATB.js:971 BattleManager.update
rpg_scenes.js:2050 Scene_Battle.updateBattleProcess
rpg_scenes.js:2042 Scene_Battle.update
YEP_BattleEngineCore.js:4308 Scene_Battle.update
YEP_RowFormation.js:2184 Scene_Battle.update
rpg_managers.js:1673 SceneManager.updateScene
Code:
var power = this.evalDamageFormula(target);
var damage = 0;
var value = 0
//Base Formula for Magical Skills
if (this.isMagical()){
damage = power * 4 + Math.int(user.level * user.mat * power / 32);
}
//Base Formula for Physical Skills
if (this.isPhysical()){
damage = power + Math.int((Math.pow(user.level, 2) * (power * user.atk)) / 256) * 3 / 2;
//Check if user in back row
if (battler.row() = 2) {
damage = damage / 2;
}
//Check if critical
if (critical) {
damage = damage * 2;
}
}
//Add variance
damage = Math.int(damage * Math.int((224 + Math.int(31 * Math.random())/256)));
//Magic Defense Reduction
if (this.isMagical()) {
damage = Math.int(damage * Math.int(255 - target.mdf) / 256);
//Check if target has Shell state
if (target.isStateAffected(50)) {
damage = Math.int(damage * 170 / 256);
}
}
//Defense Reduction
if (this.isPhysical()) {
damage = Math.int(damage * Math.int(255 - target.def) / 256);
//Check if Target has Protect state
if (target.isStateAffected(50)) {
damage = Math.int(damage * 170 / 256);
}
}
//Check if target is defending
if (target.isStateAffected(9)) {
damage = Math.int(damage / 2);
}
//Element Multipler
damage = Math.int(damage * this.calcElementRate(target));
value = damage
return value
Any help is appreciated
Last edited:

