數值計算可以在 資料庫>技能>傷害>公式 那邊 滑鼠放著等它跑出幫助視窗

把幫助視窗的內容打下來,如下:
公式
計算基本傷害的公式。
使用者以 a 表示,目標以 b 表示。
其中之一後面加一個點,以引用此後顯示的狀態。
例如,"a.atk"代表使用者的攻擊力。
攻擊
atk防禦
def魔法攻擊
mat魔法防禦
mdf敏捷度
agi運氣
luk最大 HP
mhp最大 MP
mmpHP
hpMP
mpTP
tp等級
level真的去看原生程式碼以後,發現 RM 內建的戰鬥判定過於簡單,
甚至閃避、命中、暴擊都沒有被基本數值(力量、敏捷、幸運)給影響
以下是我看 rmmz_objects 找到的內容:
敏捷 agi
影響 TPB 類型的戰鬥跑條速度 以及 回合制優先度
Game_Battler.prototype.tpbSpeed = function() {
return Math.sqrt(this.agi) + 1;
};
Game_Action.prototype.speed = function() {
const agi = this.subject().agi;
let speed = agi + Math.randomInt(Math.floor(5 + agi / 4));
if (this.item()) {
speed += this.item().speed;
}
if (this.isAttack()) {
speed += this.subject().attackSpeed();
}
return speed;
};
幸運 luk
影響上/被上狀態的成功率
Game_Action.prototype.itemEffectAddAttackState = function(target, effect) {
for (const stateId of this.subject().attackStates()) {
let chance = effect.value1;
chance *= target.stateRate(stateId);
chance *= this.subject().attackStatesRate(stateId);
chance *= this.lukEffectRate(target);
if (Math.random() < chance) {
target.addState(stateId);
this.makeSuccess(target);
}
}
};
Game_Action.prototype.itemEffectAddNormalState = function(target, effect) {
let chance = effect.value1;
if (!this.isCertainHit()) {
chance *= target.stateRate(effect.dataId);
chance *= this.lukEffectRate(target);
}
if (Math.random() < chance) {
target.addState(effect.dataId);
this.makeSuccess(target);
}
};
Game_Action.prototype.itemEffectAddDebuff = function(target, effect) {
let chance = target.debuffRate(effect.dataId) * this.lukEffectRate(target);
if (Math.random() < chance) {
target.addDebuff(effect.dataId, effect.value1);
this.makeSuccess(target);
}
};
Game_Action.prototype.lukEffectRate = function(target) {
return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};
閃避率 eva
當系統產的隨機數 < 目標的閃避率 時 閃避成功
Game_Action.prototype.apply = function(target) {
const 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);
const value = this.makeDamageValue(target, result.critical);
this.executeDamage(target, value);
}
for (const effect of this.item().effects) {
this.applyItemEffect(target, effect);
}
this.applyItemUserEffect(target);
}
this.updateLastTarget(target);
};
命中率 hit
物理攻擊的命中率:成功率的百分比 乘上 使用者的命中率
非物理攻擊的命中率:成功率的百分比
命中率可以在 資料庫>敵軍(或 角色/職業)>特性>能力值>追加能力值 看到
成功率可以在 資料庫>技能 看到
Game_Action.prototype.itemHit = function(/*target*/) {
const successRate = this.item().successRate;
if (this.isPhysical()) {
return successRate * 0.01 * this.subject().hit;
} else {
return successRate * 0.01;
}
};
暴擊率 cri
攻擊者的暴擊率 乘上(1-受擊者的暴擊迴避率)
暴擊迴避率可以在 資料庫>敵軍(或 角色/職業)>特性>能力值>追加能力值 看到
Game_Action.prototype.itemCri = function(target) {
return this.item().damage.critical
? this.subject().cri * (1 - target.cev)
: 0;
};
暴擊傷害
固定為傷害 乘上 3
Game_Action.prototype.applyCritical = function(damage) {
return damage * 3;
};
難怪會有那麼多擴充戰鬥系統的插件,
因為想讓戰鬥變得更有系統性的話,真的是要再找插件。










